Issues (224)

src/Composer/Package/Extensions.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the box project.
7
 *
8
 * (c) Kevin Herrera <[email protected]>
9
 *     Théo Fidry <[email protected]>
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14
15
namespace KevinGH\Box\Composer\Package;
16
17
use ArrayIterator;
18
use Countable;
19
use IteratorAggregate;
20
use Traversable;
21
use function count;
22
23
final readonly class Extensions implements IteratorAggregate, Countable
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 23 at column 6
Loading history...
24
{
25
    /**
26
     * @param list<Extension> $extensions
27
     */
28
    public function __construct(
29
        public array $extensions = []
30
    ) {
31
    }
32
33
    public function getIterator(): Traversable
34
    {
35
        return new ArrayIterator($this->extensions);
36
    }
37
38
    public function count(): int
39
    {
40
        return count($this->extensions);
41
    }
42
}
43