Passed
Push — master ( d96a4c...76b07c )
by Carlos C
05:39
created

Reviews::isValidMember()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
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 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpCfdi\SatCatalogosPopulate\Origins;
6
7
use PhpCfdi\SatCatalogosPopulate\AbstractCollection;
8
9
/**
10
 * @method Review[] all(): array
11
 * @method Review get(int $index): Review
12
 */
13
class Reviews extends AbstractCollection
14
{
15 2
    public function isValidMember($member): bool
16
    {
17 2
        return ($member instanceof Review);
18
    }
19
20
    public function filterStatus(ReviewStatus $status): self
21
    {
22
        return new self(array_filter($this->all(), function (Review $review) use ($status) {
23
            return $status === $review->status();
24
        }));
25
    }
26
}
27