Posts   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getIterator() 0 2 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