Skip to content

Commit

Permalink
Enable "native_constant_invocation" CS rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 2, 2020
1 parent 5ec813c commit 5214065
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ public function in($dirs)
foreach ((array) $dirs as $dir) {
if (is_dir($dir)) {
$resolvedDirs[] = $this->normalizeDir($dir);
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR | GLOB_NOSORT)) {
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) {
sort($glob);
$resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
} else {
Expand Down Expand Up @@ -658,7 +658,7 @@ private function searchInDirectory($dir)
}

$minDepth = 0;
$maxDepth = PHP_INT_MAX;
$maxDepth = \PHP_INT_MAX;

foreach ($this->depths as $comparator) {
switch ($comparator->getOperator()) {
Expand Down Expand Up @@ -693,7 +693,7 @@ private function searchInDirectory($dir)

$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);

if ($minDepth > 0 || $maxDepth < PHP_INT_MAX) {
if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) {
$iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth);
}

Expand Down
4 changes: 2 additions & 2 deletions Iterator/DepthRangeFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class DepthRangeFilterIterator extends FilterIterator
* @param int $minDepth The min depth
* @param int $maxDepth The max depth
*/
public function __construct(\RecursiveIteratorIterator $iterator, $minDepth = 0, $maxDepth = PHP_INT_MAX)
public function __construct(\RecursiveIteratorIterator $iterator, $minDepth = 0, $maxDepth = \PHP_INT_MAX)
{
$this->minDepth = $minDepth;
$iterator->setMaxDepth(PHP_INT_MAX === $maxDepth ? -1 : $maxDepth);
$iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth);

parent::__construct($iterator);
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Iterator/DepthRangeFilterIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public function getAcceptData()
return [
[0, 0, $this->toAbsolute($lessThan1)],
[0, 1, $this->toAbsolute($lessThanOrEqualTo1)],
[2, PHP_INT_MAX, []],
[1, PHP_INT_MAX, $this->toAbsolute($graterThanOrEqualTo1)],
[2, \PHP_INT_MAX, []],
[1, \PHP_INT_MAX, $this->toAbsolute($graterThanOrEqualTo1)],
[1, 1, $this->toAbsolute($equalTo1)],
];
}
Expand Down

0 comments on commit 5214065

Please sign in to comment.