doc module: Add `DocIterator::count()'
Method used to count available markdown documentation files. refs #4820
This commit is contained in:
parent
a8e6dda783
commit
c48f7f9fba
|
@ -34,11 +34,12 @@ class FileLockingIterator extends ArrayIterator
|
|||
}
|
||||
}
|
||||
|
||||
use Countable;
|
||||
use IteratorAggregate;
|
||||
use RecursiveIteratorIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
|
||||
class DocIterator implements IteratorAggregate
|
||||
class DocIterator implements Countable, IteratorAggregate
|
||||
{
|
||||
protected $fileInfos;
|
||||
|
||||
|
@ -54,6 +55,11 @@ class DocIterator implements IteratorAggregate
|
|||
$this->fileInfos = $fileInfos;
|
||||
}
|
||||
|
||||
public function count()
|
||||
{
|
||||
return count($this->fileInfos);
|
||||
}
|
||||
|
||||
public function getIterator()
|
||||
{
|
||||
return new FileLockingIterator($this->fileInfos);
|
||||
|
|
Loading…
Reference in New Issue