From 6fbed8a83fc838ab7249d2cce6933dc4de660df8 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 28 Jul 2017 01:04:52 +0200 Subject: [PATCH] cs & strict code fixes --- CD-collection/app/bootstrap.php | 2 +- CD-collection/app/model/Authenticator.php | 2 +- Fifteen/app/components/FifteenControl.php | 4 ++-- Modules-Usage/app/bootstrap.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CD-collection/app/bootstrap.php b/CD-collection/app/bootstrap.php index 9f70e45..3a96fee 100644 --- a/CD-collection/app/bootstrap.php +++ b/CD-collection/app/bootstrap.php @@ -27,7 +27,7 @@ $container = $configurator->createContainer(); // Setup router using mod_rewrite detection -if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) { +if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) { $router = $container->getByType(Nette\Application\IRouter::class); $router[] = new Route('index.php', 'Dashboard:default', Route::ONE_WAY); $router[] = new Route('/[/]', 'Dashboard:default'); diff --git a/CD-collection/app/model/Authenticator.php b/CD-collection/app/model/Authenticator.php index 5cdbcd3..647e548 100644 --- a/CD-collection/app/model/Authenticator.php +++ b/CD-collection/app/model/Authenticator.php @@ -30,7 +30,7 @@ public function __construct(Nette\Database\Context $database) */ public function authenticate(array $credentials): Security\IIdentity { - list($username, $password) = $credentials; + [$username, $password] = $credentials; $row = $this->database->table('users')->where('username', $username)->fetch(); if (!$row) { diff --git a/Fifteen/app/components/FifteenControl.php b/Fifteen/app/components/FifteenControl.php index 458276f..eed3fe7 100644 --- a/Fifteen/app/components/FifteenControl.php +++ b/Fifteen/app/components/FifteenControl.php @@ -106,7 +106,7 @@ private function move($x, $y) private function searchEmpty() { - return array_search(0, $this->order); + return array_search(0, $this->order, true); } @@ -125,7 +125,7 @@ public function render() public function loadState(array $params): void { if (isset($params['order'])) { - $params['order'] = explode('.', (string) $params['order']); + $params['order'] = array_map('intval', explode('.', (string) $params['order'])); // validate $copy = $params['order']; diff --git a/Modules-Usage/app/bootstrap.php b/Modules-Usage/app/bootstrap.php index 72d326b..074b966 100644 --- a/Modules-Usage/app/bootstrap.php +++ b/Modules-Usage/app/bootstrap.php @@ -28,7 +28,7 @@ $container = $configurator->createContainer(); // Setup router using mod_rewrite detection -if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) { +if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) { $router = $container->getByType(Nette\Application\IRouter::class); $router[] = new Route('index.php', 'Front:Default:default', Route::ONE_WAY);