Posts::getIterator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types = 1);
0 ignored issues
show
introduced by
Expected 1 line before declare statement, found 0.
Loading history...
2
3
namespace App\Entities;
4
5
class Posts implements \IteratorAggregate {
6
7
	/** @var array<\App\Entities\Post> */
8
	private array $posts;
9
10 1
	public function __construct( Post ...$posts ) {
11 1
		$this->posts = $posts;
12 1
	}
13
14
	/**
15
	 * {@inheritDoc}
16
	 */
17 1
	public function getIterator() {
18 1
		return new \ArrayIterator( $this->posts );
19
	}
20
21
}
22