@@ -30,7 +30,7 @@ class Native extends AdapterAbstract
3030
3131 const SECTIONS_AS_ARRAYS = true ;
3232 const SECTIONS_FLAT = false ;
33-
33+
3434 const SECTION_FILE = 'FILE ' ;
3535 const SECTION_COMPUTED = 'COMPUTED ' ;
3636 const SECTION_IFD0 = 'IFD0 ' ;
@@ -45,7 +45,7 @@ class Native extends AdapterAbstract
4545 *
4646 * @var array
4747 */
48- protected $ sections = array ();
48+ protected $ requiredSections = array ();
4949
5050 /**
5151 * Include the thumbnail in the EXIF data?
@@ -85,7 +85,7 @@ class Native extends AdapterAbstract
8585 */
8686 public function getRequiredSections ()
8787 {
88- return $ this ->sections ;
88+ return $ this ->requiredSections ;
8989 }
9090
9191 /**
@@ -96,7 +96,7 @@ public function getRequiredSections()
9696 */
9797 public function setRequiredSections (array $ sections )
9898 {
99- $ this ->sections = $ sections ;
99+ $ this ->requiredSections = $ sections ;
100100
101101 return $ this ;
102102 }
@@ -109,8 +109,8 @@ public function setRequiredSections(array $sections)
109109 */
110110 public function addRequiredSection ($ section )
111111 {
112- if (!in_array ($ section , $ this ->sections )) {
113- array_push ($ this ->sections , $ section );
112+ if (!in_array ($ section , $ this ->requiredSections )) {
113+ array_push ($ this ->requiredSections , $ section );
114114 }
115115
116116 return $ this ;
@@ -128,10 +128,10 @@ public function setIncludeThumbnail($value)
128128
129129 return $ this ;
130130 }
131-
131+
132132 /**
133133 * Returns if the thumbnail should be included into the EXIF data or not
134- *
134+ *
135135 * @return boolean
136136 */
137137 public function getIncludeThumbnail ()
@@ -145,23 +145,23 @@ public function getIncludeThumbnail()
145145 * @param boolean $value
146146 * @return \PHPExif\Reader Current instance for chaining
147147 */
148- public function setSectionsAsArray ($ value )
148+ public function setSectionsAsArrays ($ value )
149149 {
150- $ this ->sectionsAsArrays = $ value ;
150+ $ this ->sectionsAsArrays = ( bool ) $ value ;
151151
152152 return $ this ;
153153 }
154-
154+
155155 /**
156156 * Returns if the sections should be parsed as arrays
157- *
157+ *
158158 * @return boolean
159159 */
160- public function getSectionsAsArray ()
160+ public function getSectionsAsArrays ()
161161 {
162162 return $ this ->sectionsAsArrays ;
163163 }
164-
164+
165165 /**
166166 * Reads & parses the EXIF data from given file
167167 *
@@ -178,7 +178,7 @@ public function getExifFromFile($file)
178178 $ data = @exif_read_data (
179179 $ file ,
180180 $ sections ,
181- $ this ->getSectionsAsArray (),
181+ $ this ->getSectionsAsArrays (),
182182 $ this ->getIncludeThumbnail ()
183183 );
184184
@@ -224,10 +224,10 @@ public function getIptcData($file)
224224
225225 return $ arrData ;
226226 }
227-
227+
228228 /**
229229 * Maps native data to Exif format
230- *
230+ *
231231 * @param array $source
232232 * @return array
233233 */
@@ -238,19 +238,19 @@ public function mapData(array $source)
238238 $ parts = explode ('/ ' , $ source ['FocalLength ' ]);
239239 $ focalLength = (int )reset ($ parts ) / (int )end ($ parts );
240240 }
241-
241+
242242 $ horResolution = false ;
243243 if (isset ($ source ['XResolution ' ])) {
244244 $ resolutionParts = explode ('/ ' , $ source ['XResolution ' ]);
245245 $ horResolution = (int )reset ($ resolutionParts );
246246 }
247-
247+
248248 $ vertResolution = false ;
249249 if (isset ($ source ['YResolution ' ])) {
250250 $ resolutionParts = explode ('/ ' , $ source ['YResolution ' ]);
251251 $ vertResolution = (int )reset ($ resolutionParts );
252252 }
253-
253+
254254 return array (
255255 Exif::APERTURE => (!isset ($ source [self ::SECTION_COMPUTED ]['ApertureFNumber ' ])) ? false : $ source [self ::SECTION_COMPUTED ]['ApertureFNumber ' ],
256256 Exif::AUTHOR => (!isset ($ source ['Artist ' ])) ? false : $ source ['Artist ' ],
0 commit comments