@@ -35,7 +35,7 @@ class RobotLoader
3535 public $ acceptFiles = ['*.php ' ];
3636
3737 /** @var bool */
38- private $ autoRebuild = TRUE ;
38+ private $ autoRebuild = true ;
3939
4040 /** @var array */
4141 private $ scanPaths = [];
@@ -47,12 +47,12 @@ class RobotLoader
4747 private $ classes = [];
4848
4949 /** @var bool */
50- private $ refreshed = FALSE ;
50+ private $ refreshed = false ;
5151
5252 /** @var array of missing classes */
5353 private $ missing = [];
5454
55- /** @var string|NULL */
55+ /** @var string|null */
5656 private $ tempDirectory ;
5757
5858
@@ -69,10 +69,10 @@ public function __construct()
6969 * @param bool prepend autoloader?
7070 * @return static
7171 */
72- public function register ($ prepend = FALSE )
72+ public function register ($ prepend = false )
7373 {
7474 $ this ->loadCache ();
75- spl_autoload_register ([$ this , 'tryLoad ' ], TRUE , (bool ) $ prepend );
75+ spl_autoload_register ([$ this , 'tryLoad ' ], true , (bool ) $ prepend );
7676 return $ this ;
7777 }
7878
@@ -85,7 +85,7 @@ public function register($prepend = FALSE)
8585 public function tryLoad ($ type )
8686 {
8787 $ type = ltrim ($ type , '\\' ); // PHP namespace bug #49143
88- $ info = isset ($ this ->classes [$ type ]) ? $ this ->classes [$ type ] : NULL ;
88+ $ info = isset ($ this ->classes [$ type ]) ? $ this ->classes [$ type ] : null ;
8989
9090 if ($ this ->autoRebuild ) {
9191 if (!$ info || !is_file ($ info ['file ' ])) {
@@ -106,7 +106,7 @@ public function tryLoad($type)
106106 }
107107 $ this ->saveCache ();
108108 }
109- $ info = isset ($ this ->classes [$ type ]) ? $ this ->classes [$ type ] : NULL ;
109+ $ info = isset ($ this ->classes [$ type ]) ? $ this ->classes [$ type ] : null ;
110110 }
111111
112112 if ($ info ) {
@@ -171,7 +171,7 @@ public function rebuild()
171171 */
172172 private function refresh ()
173173 {
174- $ this ->refreshed = TRUE ; // prevents calling refresh() or updateFile() in tryLoad()
174+ $ this ->refreshed = true ; // prevents calling refresh() or updateFile() in tryLoad()
175175 $ files = [];
176176 foreach ($ this ->classes as $ class => $ info ) {
177177 $ files [$ info ['file ' ]]['time ' ] = $ info ['time ' ];
@@ -217,7 +217,7 @@ private function createFileIterator($dir)
217217 $ disallow = [];
218218 foreach (array_merge ($ ignoreDirs , $ this ->excludeDirs ) as $ item ) {
219219 if ($ item = realpath ($ item )) {
220- $ disallow [str_replace ('\\' , '/ ' , $ item )] = TRUE ;
220+ $ disallow [str_replace ('\\' , '/ ' , $ item )] = true ;
221221 }
222222 }
223223
@@ -232,7 +232,7 @@ private function createFileIterator($dir)
232232 if (is_file ("$ path/netterobots.txt " )) {
233233 foreach (file ("$ path/netterobots.txt " ) as $ s ) {
234234 if (preg_match ('#^(?:disallow \\s*:)? \\s*( \\S+)#i ' , $ s , $ matches )) {
235- $ disallow [$ path . rtrim ('/ ' . ltrim ($ matches [1 ], '/ ' ), '/ ' )] = TRUE ;
235+ $ disallow [$ path . rtrim ('/ ' . ltrim ($ matches [1 ], '/ ' ), '/ ' )] = true ;
236236 }
237237 }
238238 }
@@ -277,7 +277,7 @@ private function updateFile($file)
277277 */
278278 private function scanPhp ($ code )
279279 {
280- $ expected = FALSE ;
280+ $ expected = false ;
281281 $ namespace = '' ;
282282 $ level = $ minLevel = 0 ;
283283 $ classes = [];
@@ -332,7 +332,7 @@ private function scanPhp($code)
332332 $ minLevel = $ token === '{ ' ? 1 : 0 ;
333333 }
334334
335- $ expected = NULL ;
335+ $ expected = null ;
336336 }
337337
338338 if ($ token === '{ ' ) {
@@ -352,7 +352,7 @@ private function scanPhp($code)
352352 * Sets auto-refresh mode.
353353 * @return static
354354 */
355- public function setAutoRefresh ($ on = TRUE )
355+ public function setAutoRefresh ($ on = true )
356356 {
357357 $ this ->autoRebuild = (bool ) $ on ;
358358 return $ this ;
@@ -410,13 +410,13 @@ private function loadCache()
410410 private function saveCache ()
411411 {
412412 $ file = $ this ->getCacheFile ();
413- $ code = "<?php \nreturn " . var_export ([$ this ->classes , $ this ->missing ], TRUE ) . "; \n" ;
413+ $ code = "<?php \nreturn " . var_export ([$ this ->classes , $ this ->missing ], true ) . "; \n" ;
414414 if (file_put_contents ("$ file.tmp " , $ code ) !== strlen ($ code ) || !rename ("$ file.tmp " , $ file )) {
415415 @unlink ("$ file.tmp " ); // @ - file may not exist
416416 throw new \RuntimeException ("Unable to create ' $ file'. " );
417417 }
418418 if (function_exists ('opcache_invalidate ' )) {
419- @opcache_invalidate ($ file , TRUE ); // @ can be restricted
419+ @opcache_invalidate ($ file , true ); // @ can be restricted
420420 }
421421 }
422422
0 commit comments