Skip to content

Commit

Permalink
Countable is deprecated (BC break)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 6, 2022
1 parent 8073fb7 commit 01c556b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Utils/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,10 @@ private static function buildPattern(array $masks): ?string
/********************* iterator generator ****************d*g**/


/**
* Get the number of found files and/or directories.
*/
/** @deprecated */
public function count(): int
{
trigger_error('Nette\Utils\Finder::count is deprecated.', E_USER_DEPRECATED);
return iterator_count($this->getIterator());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/Finder.basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function export($iterator)

test('count the results', function () {
$finder = Finder::findFiles('file.txt')->in('files');
Assert::count(1, $finder);
@Assert::count(1, $finder); // is deprecated
});


Expand Down

0 comments on commit 01c556b

Please sign in to comment.