Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

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 21, 2017
1 parent 837350d commit 2903af6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CD-collection/app/model/Authenticator.php
Expand Up @@ -42,6 +42,6 @@ public function authenticate(array $credentials): Security\IIdentity


$arr = $row->toArray(); $arr = $row->toArray();
unset($arr['password']); unset($arr['password']);
return new Security\Identity($row->id, NULL, $arr); return new Security\Identity($row->id, null, $arr);
} }
} }
14 changes: 7 additions & 7 deletions Fifteen/app/components/FifteenControl.php
Expand Up @@ -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; $pos = $x + $y * $this->width;
$empty = $this->searchEmpty(); $empty = $this->searchEmpty();
$y = (int) ($empty / $this->width); $y = (int) ($empty / $this->width);
$x = $empty % $this->width; $x = $empty % $this->width;
if ($x > 0 && $pos === $empty - 1) { if ($x > 0 && $pos === $empty - 1) {
$rel = '-1,'; $rel = '-1,';
return TRUE; return true;
} }
if ($x < $this->width - 1 && $pos === $empty + 1) { if ($x < $this->width - 1 && $pos === $empty + 1) {
$rel = '+1,'; $rel = '+1,';
return TRUE; return true;
} }
if ($y > 0 && $pos === $empty - $this->width) { if ($y > 0 && $pos === $empty - $this->width) {
$rel = ',-1'; $rel = ',-1';
return TRUE; return true;
} }
if ($y < $this->width - 1 && $pos === $empty + $this->width) { if ($y < $this->width - 1 && $pos === $empty + $this->width) {
$rel = ',+1'; $rel = ',+1';
return TRUE; return true;
} }
return FALSE; return false;
} }




Expand Down
8 changes: 4 additions & 4 deletions Micro-blog/www/data/TemplateRouter.php
Expand Up @@ -15,16 +15,16 @@ public function __construct($path, $cachePath)
$routes = require $cacheFile; $routes = require $cacheFile;
} else { } else {
$routes = $this->scanRoutes($path); $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) { foreach ($routes as $mask => $file) {
$this[] = new Routers\Route($mask, function ($presenter) use ($file, $cachePath) { $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 = new Latte\Engine;
$latte->setTempDirectory($cachePath . '/cache'); $latte->setTempDirectory($cachePath . '/cache');
$macroSet = new Latte\Macros\MacroSet($latte->getCompiler()); $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; return $latte;
})->setFile($file); })->setFile($file);
}); });
Expand All @@ -39,7 +39,7 @@ public function scanRoutes($path)
$macroSet = new Latte\Macros\MacroSet($latte->getCompiler()); $macroSet = new Latte\Macros\MacroSet($latte->getCompiler());
$macroSet->addMacro('url', function ($node) use (&$routes, &$file) { $macroSet->addMacro('url', function ($node) use (&$routes, &$file) {
$routes[$node->args] = (string) $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) { foreach (Nette\Utils\Finder::findFiles('*.latte')->from($path) as $file) {
$latte->compile($file); $latte->compile($file);
} }
Expand Down
4 changes: 2 additions & 2 deletions Modules-Usage/app/modules/Base/BasePresenter.php
Expand Up @@ -11,10 +11,10 @@ abstract class BasePresenter extends Nette\Application\UI\Presenter
protected function beforeRender() protected function beforeRender()
{ {
$this->template->viewName = $this->getView(); $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(), ':'); $a = strrpos($this->getName(), ':');
if ($a === FALSE) { if ($a === false) {
$this->template->moduleName = ''; $this->template->moduleName = '';
$this->template->presenterName = $this->getName(); $this->template->presenterName = $this->getName();
} else { } else {
Expand Down

0 comments on commit 2903af6

Please sign in to comment.