Skip to content

Commit

Permalink
chore: CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and nicolas-grekas committed Mar 20, 2024
1 parent beeac2b commit 9bfc6ff
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function files(): static
public function depth(string|int|array $levels): static
{
foreach ((array) $levels as $level) {
$this->depths[] = new Comparator\NumberComparator($level);
$this->depths[] = new NumberComparator($level);
}

return $this;
Expand Down Expand Up @@ -152,7 +152,7 @@ public function depth(string|int|array $levels): static
public function date(string|array $dates): static
{
foreach ((array) $dates as $date) {
$this->dates[] = new Comparator\DateComparator($date);
$this->dates[] = new DateComparator($date);
}

return $this;
Expand Down Expand Up @@ -307,7 +307,7 @@ public function notPath(string|array $patterns): static
public function size(string|int|array $sizes): static
{
foreach ((array) $sizes as $size) {
$this->sizes[] = new Comparator\NumberComparator($size);
$this->sizes[] = new NumberComparator($size);
}

return $this;
Expand Down Expand Up @@ -436,7 +436,7 @@ public function sort(\Closure $closure): static
*/
public function sortByExtension(): static
{
$this->sort = Iterator\SortableIterator::SORT_BY_EXTENSION;
$this->sort = SortableIterator::SORT_BY_EXTENSION;

return $this;
}
Expand All @@ -452,7 +452,7 @@ public function sortByExtension(): static
*/
public function sortByName(bool $useNaturalSort = false): static
{
$this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME;
$this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL : SortableIterator::SORT_BY_NAME;

return $this;
}
Expand All @@ -468,7 +468,7 @@ public function sortByName(bool $useNaturalSort = false): static
*/
public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static
{
$this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : Iterator\SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;
$this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;

return $this;
}
Expand All @@ -484,7 +484,7 @@ public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static
*/
public function sortBySize(): static
{
$this->sort = Iterator\SortableIterator::SORT_BY_SIZE;
$this->sort = SortableIterator::SORT_BY_SIZE;

return $this;
}
Expand All @@ -500,7 +500,7 @@ public function sortBySize(): static
*/
public function sortByType(): static
{
$this->sort = Iterator\SortableIterator::SORT_BY_TYPE;
$this->sort = SortableIterator::SORT_BY_TYPE;

return $this;
}
Expand All @@ -518,7 +518,7 @@ public function sortByType(): static
*/
public function sortByAccessedTime(): static
{
$this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME;
$this->sort = SortableIterator::SORT_BY_ACCESSED_TIME;

return $this;
}
Expand Down Expand Up @@ -550,7 +550,7 @@ public function reverseSorting(): static
*/
public function sortByChangedTime(): static
{
$this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME;
$this->sort = SortableIterator::SORT_BY_CHANGED_TIME;

return $this;
}
Expand All @@ -568,7 +568,7 @@ public function sortByChangedTime(): static
*/
public function sortByModifiedTime(): static
{
$this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME;
$this->sort = SortableIterator::SORT_BY_MODIFIED_TIME;

return $this;
}
Expand Down Expand Up @@ -671,7 +671,7 @@ public function getIterator(): \Iterator
$iterator = $this->searchInDirectory($this->dirs[0]);

if ($this->sort || $this->reverseSorting) {
$iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
$iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
}

return $iterator;
Expand All @@ -687,7 +687,7 @@ public function getIterator(): \Iterator
}

if ($this->sort || $this->reverseSorting) {
$iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
$iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
}

return $iterator;
Expand Down Expand Up @@ -790,37 +790,37 @@ private function searchInDirectory(string $dir): \Iterator
$iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs);

if ($exclude) {
$iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude);
$iterator = new ExcludeDirectoryFilterIterator($iterator, $exclude);
}

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

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

if ($this->mode) {
$iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode);
}

if ($this->names || $this->notNames) {
$iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames);
$iterator = new FilenameFilterIterator($iterator, $this->names, $this->notNames);
}

if ($this->contains || $this->notContains) {
$iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
$iterator = new FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
}

if ($this->sizes) {
$iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes);
$iterator = new SizeRangeFilterIterator($iterator, $this->sizes);
}

if ($this->dates) {
$iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates);
$iterator = new DateRangeFilterIterator($iterator, $this->dates);
}

if ($this->filters) {
$iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
$iterator = new CustomFilterIterator($iterator, $this->filters);
}

if ($this->paths || $notPaths) {
Expand Down

0 comments on commit 9bfc6ff

Please sign in to comment.