Issues (172)

src/functions/iterable_count.php (1 issue)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Improved;
6
7
/**
8
 * Count element of an iterable.
9
 *
10
 * @param iterable $iterable
11
 * @return int
12
 */
13
function iterable_count(iterable $iterable): int
0 ignored issues
show
Function Improved\iterable_count() has parameter $iterable with no value type specified in iterable type iterable.
Loading history...
14
{
15
    /** @var array|\Traversable $iterable */
16 8
    return is_array($iterable) || $iterable instanceof \Countable ? count($iterable) : iterator_count($iterable);
17
}
18