Skip to content

Commit

Permalink
coding style: TRUE/FALSE/NULL -> true/false/null
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 11, 2017
1 parent 74e467e commit 73149b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/RobotLoader/RobotLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RobotLoader
public $acceptFiles = '*.php, *.php5';

/** @var bool @deprecated */
public $autoRebuild = TRUE;
public $autoRebuild = true;

/** @var array */
private $scanPaths = [];
Expand All @@ -37,7 +37,7 @@ class RobotLoader
private $classes = [];

/** @var bool */
private $refreshed = FALSE;
private $refreshed = false;

/** @var array of missing classes in this request */
private $missing = [];
Expand All @@ -59,10 +59,10 @@ public function __construct()
* @param bool prepend autoloader?
* @return static
*/
public function register($prepend = FALSE)
public function register($prepend = false)
{
$this->classes = $this->getCache()->load($this->getKey(), [$this, 'rebuildCallback']);
spl_autoload_register([$this, 'tryLoad'], TRUE, (bool) $prepend);
spl_autoload_register([$this, 'tryLoad'], true, (bool) $prepend);
return $this;
}

Expand Down Expand Up @@ -105,7 +105,7 @@ public function tryLoad($type)
}
call_user_func(function ($file) { require $file; }, $this->classes[$type]['file']);
} else {
$this->missing[$type] = TRUE;
$this->missing[$type] = true;
}
}

Expand Down Expand Up @@ -156,7 +156,7 @@ public function rebuild()
*/
public function rebuildCallback()
{
$this->refreshed = TRUE; // prevents calling rebuild() or updateFile() in tryLoad()
$this->refreshed = true; // prevents calling rebuild() or updateFile() in tryLoad()
$files = $missing = [];
foreach ($this->classes as $class => $info) {
if (is_array($info)) {
Expand Down Expand Up @@ -207,7 +207,7 @@ private function createFileIterator($dir)
$disallow = [];
foreach ($ignoreDirs as $item) {
if ($item = realpath($item)) {
$disallow[$item] = TRUE;
$disallow[$item] = true;
}
}

Expand All @@ -222,7 +222,7 @@ private function createFileIterator($dir)
if (is_file("$path/netterobots.txt")) {
foreach (file("$path/netterobots.txt") as $s) {
if (preg_match('#^(?:disallow\\s*:)?\\s*(\\S+)#i', $s, $matches)) {
$disallow[$path . str_replace('/', DIRECTORY_SEPARATOR, rtrim('/' . ltrim($matches[1], '/'), '/'))] = TRUE;
$disallow[$path . str_replace('/', DIRECTORY_SEPARATOR, rtrim('/' . ltrim($matches[1], '/'), '/'))] = true;
}
}
}
Expand Down Expand Up @@ -268,7 +268,7 @@ private function updateFile($file)
*/
private function scanPhp($code)
{
$expected = FALSE;
$expected = false;
$namespace = '';
$level = $minLevel = 0;
$classes = [];
Expand Down Expand Up @@ -323,7 +323,7 @@ private function scanPhp($code)
$minLevel = $token === '{' ? 1 : 0;
}

$expected = NULL;
$expected = null;
}

if ($token === '{') {
Expand All @@ -343,7 +343,7 @@ private function scanPhp($code)
* Sets auto-refresh mode.
* @return static
*/
public function setAutoRefresh($on = TRUE)
public function setAutoRefresh($on = true)
{
$this->autoRebuild = (bool) $on;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion tests/Loaders/files/conditional.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

if (FALSE) {
if (false) {
class ConditionalClass
{
}
Expand Down

0 comments on commit 73149b9

Please sign in to comment.