1515 *
1616 * @property-read string $name
1717 * @property-read string $sanitizedName
18- * @property-read string|NULL $contentType
18+ * @property-read string|null $contentType
1919 * @property-read int $size
2020 * @property-read string $temporaryFile
2121 * @property-read int $error
2222 * @property-read bool $ok
23- * @property-read string|NULL $contents
23+ * @property-read string|null $contents
2424 */
2525class FileUpload
2626{
@@ -73,17 +73,17 @@ public function getName()
7373 */
7474 public function getSanitizedName ()
7575 {
76- return trim (Nette \Utils \Strings::webalize ($ this ->name , '. ' , FALSE ), '.- ' );
76+ return trim (Nette \Utils \Strings::webalize ($ this ->name , '. ' , false ), '.- ' );
7777 }
7878
7979
8080 /**
8181 * Returns the MIME content type of an uploaded file.
82- * @return string|NULL
82+ * @return string|null
8383 */
8484 public function getContentType ()
8585 {
86- if ($ this ->isOk () && $ this ->type === NULL ) {
86+ if ($ this ->isOk () && $ this ->type === null ) {
8787 $ this ->type = finfo_file (finfo_open (FILEINFO_MIME_TYPE ), $ this ->tmpName );
8888 }
8989 return $ this ->type ;
@@ -157,7 +157,7 @@ public function hasFile()
157157 public function move ($ dest )
158158 {
159159 $ dir = dirname ($ dest );
160- @mkdir ($ dir , 0777 , TRUE ); // @ - dir may already exist
160+ @mkdir ($ dir , 0777 , true ); // @ - dir may already exist
161161 if (!is_dir ($ dir )) {
162162 throw new Nette \InvalidStateException ("Directory ' $ dir' cannot be created. " . error_get_last ()['message ' ]);
163163 }
@@ -181,7 +181,7 @@ function ($message) use ($dest) {
181181 */
182182 public function isImage ()
183183 {
184- return in_array ($ this ->getContentType (), ['image/gif ' , 'image/png ' , 'image/jpeg ' ], TRUE );
184+ return in_array ($ this ->getContentType (), ['image/gif ' , 'image/png ' , 'image/jpeg ' ], true );
185185 }
186186
187187
@@ -198,21 +198,21 @@ public function toImage()
198198
199199 /**
200200 * Returns the dimensions of an uploaded image as array.
201- * @return array|NULL
201+ * @return array|null
202202 */
203203 public function getImageSize ()
204204 {
205- return $ this ->isOk () ? @getimagesize ($ this ->tmpName ) : NULL ; // @ - files smaller than 12 bytes causes read error
205+ return $ this ->isOk () ? @getimagesize ($ this ->tmpName ) : null ; // @ - files smaller than 12 bytes causes read error
206206 }
207207
208208
209209 /**
210210 * Get file contents.
211- * @return string|NULL
211+ * @return string|null
212212 */
213213 public function getContents ()
214214 {
215215 // future implementation can try to work around safe_mode and open_basedir limitations
216- return $ this ->isOk () ? file_get_contents ($ this ->tmpName ) : NULL ;
216+ return $ this ->isOk () ? file_get_contents ($ this ->tmpName ) : null ;
217217 }
218218}
0 commit comments