Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
Criteria
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getCriteria
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 addCriterion
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Specification;
4
5use App\Specification\Criterion\Criterion;
6
7/**
8 * @author Wilhelm Zwertvaegher
9 * Criteria collection
10 */
11class Criteria
12{
13    /**
14     * @param array<Criterion> $criteria
15     */
16    public function __construct(private array $criteria = [])
17    {
18    }
19
20    /**
21     * @return array<Criterion>
22     * */
23    public function getCriteria(): array
24    {
25        return $this->criteria;
26    }
27
28    public function addCriterion(Criterion $criterion): void
29    {
30        $this->criteria[] = $criterion;
31    }
32}

Branches

Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

Criteria->__construct
16    public function __construct(private array $criteria = [])
17    {
18    }
Criteria->addCriterion
28    public function addCriterion(Criterion $criterion): void
29    {
30        $this->criteria[] = $criterion;
31    }
Criteria->getCriteria
25        return $this->criteria;
26    }