diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 98b1237..9661ad1 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -51,7 +51,6 @@ return (new PhpCsFixer\Config()) // TODO: fix these 'psr_autoloading' => false, - 'strict_comparison' => false, ]) ->setFinder($finder) ->setIndent(" ") diff --git a/inc/navbar.php b/inc/navbar.php index 3d8d20e..c719044 100644 --- a/inc/navbar.php +++ b/inc/navbar.php @@ -18,7 +18,7 @@ function navbar($depth, $active = null) { ]; foreach ($menuItems as $caption => $link) { $isActive = $active === $link; - if (substr($link, 0, 4) != 'http') { + if (substr($link, 0, 4) !== 'http') { $link = rtrim(str_repeat('../', $depth) . $link, '/') . '/'; } diff --git a/src/pvv/admin/usermanager.php b/src/pvv/admin/usermanager.php index 84e63ef..50f53c3 100644 --- a/src/pvv/admin/usermanager.php +++ b/src/pvv/admin/usermanager.php @@ -98,7 +98,7 @@ class UserManager { $statement->execute(); $row = $statement->fetch(); - if ($row == false) { + if ($row === false) { return 0; } diff --git a/src/pvv/side/social/animekveldactivity.php b/src/pvv/side/social/animekveldactivity.php index 0714ba1..19dbcb8 100644 --- a/src/pvv/side/social/animekveldactivity.php +++ b/src/pvv/side/social/animekveldactivity.php @@ -8,11 +8,11 @@ use pvv\side\Activity; class AnimekveldActivity implements Activity { public function nextDate(\DateTimeImmutable $date) { - if ($date->format('H') > 20 || $date->format('H') == 19 && $date->format('i') > 30) { + if (intval($date->format('H')) > 20 || intval($date->format('H')) === 19 && intval($date->format('i')) > 30) { return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(19, 30, 0)); } $date = $date->setTime(19, 30, 0); - if ($date->format('N') != 5) { + if (intval($date->format('N')) !== 5) { return $this->nextDate($date->add(new \DateInterval('P1D'))); } @@ -20,11 +20,11 @@ class AnimekveldActivity implements Activity { } public function prevDate(\DateTimeImmutable $date) { - if ($date->format('H') < 19 || $date->format('H') == 20 && $date->format('i') < 30) { + if (intval($date->format('H')) < 19 || intval($date->format('H')) === 20 && intval($date->format('i')) < 30) { return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(19, 30, 0)); } $date = $date->setTime(19, 30, 0); - if ($date->format('N') != 5) { + if (intval($date->format('N')) !== 5) { return $this->prevDate($date->sub(new \DateInterval('P1D'))); } diff --git a/src/pvv/side/social/brettspillactivity.php b/src/pvv/side/social/brettspillactivity.php index 2d8a982..0931d67 100644 --- a/src/pvv/side/social/brettspillactivity.php +++ b/src/pvv/side/social/brettspillactivity.php @@ -8,14 +8,14 @@ use pvv\side\Activity; class BrettspillActivity implements Activity { public function nextDate(\DateTimeImmutable $date) { - if ($date->format('H') > 17 || $date->format('H') == 16 && $date->format('i') > 15) { + if (intval($date->format('H')) > 17 || intval($date->format('H')) === 16 && intval($date->format('i')) > 15) { return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(16, 15, 0)); } $date = $date->setTime(16, 15, 0); - if ($date->format('N') != 7) { + if (intval($date->format('N')) !== 7) { return $this->nextDate($date->add(new \DateInterval('P1D'))); } - if ($date->format('W') % 2 - 1) { + if (intval($date->format('W')) % 2 - 1) { return $this->nextDate($date->add(new \DateInterval('P7D'))); } @@ -23,14 +23,14 @@ class BrettspillActivity implements Activity { } public function prevDate(\DateTimeImmutable $date) { - if ($date->format('H') < 16 || $date->format('H') == 17 && $date->format('i') < 15) { + if (intval($date->format('H')) < 16 || intval($date->format('H')) === 17 && intval($date->format('i')) < 15) { return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(16, 15, 0)); } $date = $date->setTime(16, 15, 0); - if ($date->format('N') != 7) { + if (intval($date->format('N')) !== 7) { return $this->prevDate($date->sub(new \DateInterval('P1D'))); } - if ($date->format('W') % 2 - 1) { + if (intval($date->format('W')) % 2 - 1) { return $this->prevDate($date->sub(new \DateInterval('P7D'))); } diff --git a/src/pvv/side/social/driftkveldactivity.php b/src/pvv/side/social/driftkveldactivity.php index ec50c40..4a61779 100644 --- a/src/pvv/side/social/driftkveldactivity.php +++ b/src/pvv/side/social/driftkveldactivity.php @@ -8,14 +8,14 @@ use pvv\side\Activity; class DriftkveldActivity implements Activity { public function nextDate(\DateTimeImmutable $date) { - if ($date->format('H') > 18 || $date->format('H') == 17 && $date->format('i') > 30) { + if (intval($date->format('H')) > 18 || intval($date->format('H')) === 17 && intval($date->format('i')) > 30) { return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(18, 15, 0)); } $date = $date->setTime(18, 15, 0); - if ($date->format('N') != 6) { + if (intval($date->format('N')) !== 6) { return $this->nextDate($date->add(new \DateInterval('P1D'))); } - if ($date->format('W') % 2 - 1) { + if (intval($date->format('W')) % 2 - 1) { return $this->nextDate($date->add(new \DateInterval('P7D'))); } @@ -23,14 +23,14 @@ class DriftkveldActivity implements Activity { } public function prevDate(\DateTimeImmutable $date) { - if ($date->format('H') < 17 || $date->format('H') == 18 && $date->format('i') < 30) { + if (intval($date->format('H')) < 17 || intval($date->format('H')) === 18 && intval($date->format('i')) < 30) { return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(18, 15, 0)); } $date = $date->setTime(18, 15, 0); - if ($date->format('N') != 6) { + if (intval($date->format('N')) !== 6) { return $this->prevDate($date->sub(new \DateInterval('P1D'))); } - if ($date->format('W') % 2 - 1) { + if (intval($date->format('W')) % 2 - 1) { return $this->prevDate($date->sub(new \DateInterval('P7D'))); } diff --git a/src/pvv/side/social/hackekveldactivity.php b/src/pvv/side/social/hackekveldactivity.php index 3e94384..4c75711 100644 --- a/src/pvv/side/social/hackekveldactivity.php +++ b/src/pvv/side/social/hackekveldactivity.php @@ -8,14 +8,14 @@ use pvv\side\Activity; class HackekveldActivity implements Activity { public function nextDate(\DateTimeImmutable $date) { - if ($date->format('H') > 18 || $date->format('H') == 17 && $date->format('i') > 30) { + if (intval($date->format('H')) > 18 || intval($date->format('H')) === 17 && intval($date->format('i')) > 30) { return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(18, 15, 0)); } $date = $date->setTime(16, 15, 0); - if ($date->format('N') != 6) { + if (intval($date->format('N')) !== 6) { return $this->nextDate($date->add(new \DateInterval('P1D'))); } - if ($date->format('W') % 2) { + if (intval($date->format('W')) % 2) { return $this->nextDate($date->add(new \DateInterval('P7D'))); } @@ -23,14 +23,14 @@ class HackekveldActivity implements Activity { } public function prevDate(\DateTimeImmutable $date) { - if ($date->format('H') < 17 || $date->format('H') == 18 && $date->format('i') < 30) { + if (intval($date->format('H')) < 17 || intval($date->format('H')) === 18 && intval($date->format('i')) < 30) { return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(18, 15, 0)); } $date = $date->setTime(18, 15, 0); - if ($date->format('N') != 6) { + if (intval($date->format('N')) !== 6) { return $this->prevDate($date->sub(new \DateInterval('P1D'))); } - if ($date->format('W') % 2) { + if (intval($date->format('W')) % 2) { return $this->prevDate($date->sub(new \DateInterval('P7D'))); } diff --git a/src/pvv/side/social/nerdepitsaactivity.php b/src/pvv/side/social/nerdepitsaactivity.php index 5032e00..d6a82a2 100644 --- a/src/pvv/side/social/nerdepitsaactivity.php +++ b/src/pvv/side/social/nerdepitsaactivity.php @@ -8,14 +8,14 @@ use pvv\side\Activity; class NerdepitsaActivity implements Activity { public function nextDate(\DateTimeImmutable $date) { - if ($date->format('H') > 19) { + if (intval($date->format('H')) > 19) { return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(19, 0, 0)); } $date = $date->setTime(19, 0, 0); - if ($date->format('N') != 5) { + if (intval($date->format('N')) !== 5) { return $this->nextDate($date->add(new \DateInterval('P1D'))); } - if ($date->format('W') % 2) { + if (intval($date->format('W')) % 2) { return $this->nextDate($date->add(new \DateInterval('P7D'))); } @@ -23,14 +23,14 @@ class NerdepitsaActivity implements Activity { } public function prevDate(\DateTimeImmutable $date) { - if ($date->format('H') < 19) { + if (intval($date->format('H')) < 19) { return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(19, 0, 0)); } $date = $date->setTime(19, 0, 0); - if ($date->format('N') != 5) { + if (intval($date->format('N')) !== 5) { return $this->prevDate($date->sub(new \DateInterval('P1D'))); } - if ($date->format('W') % 2) { + if (intval($date->format('W')) % 2) { return $this->prevDate($date->sub(new \DateInterval('P7D'))); }