Skip to content

Commit

Permalink
Merge branch '3.4' into 4.4
Browse files Browse the repository at this point in the history
* 3.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
  • Loading branch information
nicolas-grekas committed Sep 2, 2020
2 parents 2a78590 + 5214065 commit 5ef0f6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function sort(\Closure $closure)
public function sortByName(/* bool $useNaturalSort = false */)
{
if (\func_num_args() < 1 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
@trigger_error(sprintf('The "%s()" method will have a new "bool $useNaturalSort = false" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method will have a new "bool $useNaturalSort = false" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), \E_USER_DEPRECATED);
}
$useNaturalSort = 0 < \func_num_args() && func_get_arg(0);

Expand Down Expand Up @@ -595,7 +595,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 @@ -715,7 +715,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 @@ -750,7 +750,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 5ef0f6c

Please sign in to comment.