Skip to content

Commit

Permalink
removed support for PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 1, 2021
1 parent 171985d commit 856a083
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,8 @@ private function preprocessParams(array &$params): bool
}

if ($fixity !== null) {
if (PHP_VERSION_ID < 80000
? $params[$name] === $meta[self::VALUE]
: $params[$name] == $meta[self::VALUE] // default value may be object, intentionally ==
) { // remove default values; null values are retain
if ($params[$name] == $meta[self::VALUE]) { // default value may be object, intentionally ==
// remove default values; null values are retain
unset($params[$name]);
continue;

Expand Down
5 changes: 1 addition & 4 deletions src/Routing/SimpleRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ public function constructUrl(array $params, Nette\Http\UrlScript $refUrl): ?stri
{
// remove default values; null values are retain
foreach ($this->defaults as $key => $value) {
if (isset($params[$key]) && (PHP_VERSION_ID < 80000 && is_scalar($params[$key]) && is_scalar($value)
? (string) $params[$key] === (string) $value
: $params[$key] == $value // default value may be object, intentionally ==
)) {
if (isset($params[$key]) && $params[$key] == $value) { // default value may be object, intentionally ==
unset($params[$key]);
}
}
Expand Down

0 comments on commit 856a083

Please sign in to comment.