Skip to content

Commit

Permalink
Fix redundant type casts
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Nov 25, 2021
1 parent e99b65a commit 384b28e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Resource/ClassExistenceResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(string $resource, bool $exists = null)
{
$this->resource = $resource;
if (null !== $exists) {
$this->exists = [(bool) $exists, null];
$this->exists = [$exists, null];
}
}

Expand Down
4 changes: 2 additions & 2 deletions Util/XmlUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ public static function phpize($value)
$raw = $value;
$cast = (int) $value;

return '0' == $value[0] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
return '0' == $value[0] ? octdec($value) : (($raw === (string) $cast) ? $cast : $raw);
case isset($value[1]) && '-' === $value[0] && ctype_digit(substr($value, 1)):
$raw = $value;
$cast = (int) $value;

return '0' == $value[1] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
return '0' == $value[1] ? octdec($value) : (($raw === (string) $cast) ? $cast : $raw);
case 'true' === $lowercaseValue:
return true;
case 'false' === $lowercaseValue:
Expand Down

0 comments on commit 384b28e

Please sign in to comment.