Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
  • Loading branch information
nicolas-grekas committed Sep 2, 2020
2 parents 2b765f0 + 5ef0f6c commit 2c3ba7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,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 @@ -700,7 +700,7 @@ private function searchInDirectory(string $dir): \Iterator
}

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

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

$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, int $minDepth = 0, int $maxDepth = PHP_INT_MAX)
public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $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
2 changes: 1 addition & 1 deletion SplFileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getFilenameWithoutExtension(): string
{
$filename = $this->getFilename();

return pathinfo($filename, PATHINFO_FILENAME);
return pathinfo($filename, \PATHINFO_FILENAME);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Tests/Iterator/DepthRangeFilterIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,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 2c3ba7a

Please sign in to comment.