Permalink
Browse files

coding style: TRUE/FALSE/NULL -> true/false/null

  • Loading branch information...
dg committed Jul 11, 2017
1 parent 837350d commit 2903af6d14db49d731e13dcef76afdd8ed5451cd
@@ -42,6 +42,6 @@ public function authenticate(array $credentials): Security\IIdentity
$arr = $row->toArray();
unset($arr['password']);
return new Security\Identity($row->id, NULL, $arr);
return new Security\Identity($row->id, null, $arr);
}
}
@@ -68,30 +68,30 @@ public function getRound()
}
public function isClickable($x, $y, &$rel = NULL)
public function isClickable($x, $y, &$rel = null)
{
$rel = NULL;
$rel = null;
$pos = $x + $y * $this->width;
$empty = $this->searchEmpty();
$y = (int) ($empty / $this->width);
$x = $empty % $this->width;
if ($x > 0 && $pos === $empty - 1) {
$rel = '-1,';
return TRUE;
return true;
}
if ($x < $this->width - 1 && $pos === $empty + 1) {
$rel = '+1,';
return TRUE;
return true;
}
if ($y > 0 && $pos === $empty - $this->width) {
$rel = ',-1';
return TRUE;
return true;
}
if ($y < $this->width - 1 && $pos === $empty + $this->width) {
$rel = ',+1';
return TRUE;
return true;
}
return FALSE;
return false;
}
@@ -15,16 +15,16 @@ public function __construct($path, $cachePath)
$routes = require $cacheFile;
} else {
$routes = $this->scanRoutes($path);
file_put_contents($cacheFile, '<?php return ' . var_export($routes, TRUE) . ';');
file_put_contents($cacheFile, '<?php return ' . var_export($routes, true) . ';');
}
foreach ($routes as $mask => $file) {
$this[] = new Routers\Route($mask, function ($presenter) use ($file, $cachePath) {
return $presenter->createTemplate(NULL, function () use ($cachePath) {
return $presenter->createTemplate(null, function () use ($cachePath) {
$latte = new Latte\Engine;
$latte->setTempDirectory($cachePath . '/cache');
$macroSet = new Latte\Macros\MacroSet($latte->getCompiler());
$macroSet->addMacro('url', function () {}, NULL, NULL, $macroSet::ALLOWED_IN_HEAD); // ignore
$macroSet->addMacro('url', function () {}, null, null, $macroSet::ALLOWED_IN_HEAD); // ignore
return $latte;
})->setFile($file);
});
@@ -39,7 +39,7 @@ public function scanRoutes($path)
$macroSet = new Latte\Macros\MacroSet($latte->getCompiler());
$macroSet->addMacro('url', function ($node) use (&$routes, &$file) {
$routes[$node->args] = (string) $file;
}, NULL, NULL, $macroSet::ALLOWED_IN_HEAD);
}, null, null, $macroSet::ALLOWED_IN_HEAD);
foreach (Nette\Utils\Finder::findFiles('*.latte')->from($path) as $file) {
$latte->compile($file);
}
@@ -11,10 +11,10 @@ abstract class BasePresenter extends Nette\Application\UI\Presenter
protected function beforeRender()
{
$this->template->viewName = $this->getView();
$this->template->root = isset($_SERVER['SCRIPT_FILENAME']) ? realpath(dirname(dirname($_SERVER['SCRIPT_FILENAME']))) : NULL;
$this->template->root = isset($_SERVER['SCRIPT_FILENAME']) ? realpath(dirname(dirname($_SERVER['SCRIPT_FILENAME']))) : null;
$a = strrpos($this->getName(), ':');
if ($a === FALSE) {
if ($a === false) {
$this->template->moduleName = '';
$this->template->presenterName = $this->getName();
} else {

0 comments on commit 2903af6

Please sign in to comment.