| Total Complexity | 13 |
| Total Lines | 108 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class PostTermConstrainer implements ConstrainerInterface |
||
| 12 | { |
||
| 13 | use ExpectsPostTrait; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $taxonomy; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var WP_Term[] |
||
| 22 | */ |
||
| 23 | protected $terms = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var bool |
||
| 27 | */ |
||
| 28 | protected $matchAll = false; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * |
||
| 32 | */ |
||
| 33 | public function __construct(string $taxonomy, int ...$terms) |
||
| 34 | { |
||
| 35 | $this->taxonomy = $taxonomy; |
||
| 36 | $this->terms = $terms; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the value of terms |
||
| 41 | * |
||
| 42 | * @return array |
||
| 43 | */ |
||
| 44 | public function getTerms(): array |
||
| 45 | { |
||
| 46 | return $this->terms; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * |
||
| 51 | */ |
||
| 52 | public function addTerm(int $term) |
||
| 53 | { |
||
| 54 | $this->terms[] = $term; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get the value of matchAll |
||
| 59 | * |
||
| 60 | * @return bool |
||
| 61 | */ |
||
| 62 | public function shouldMatchAll(): bool |
||
| 63 | { |
||
| 64 | return $this->matchAll; |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Set the value of matchAll |
||
| 69 | * |
||
| 70 | * @param bool $matchAll |
||
| 71 | * |
||
| 72 | * @return self |
||
| 73 | */ |
||
| 74 | public function setMatchAll(bool $matchAll) |
||
| 75 | { |
||
| 76 | $this->matchAll = $matchAll; |
||
| 77 | |||
| 78 | return $this; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * |
||
| 83 | */ |
||
| 84 | public function requestMeetsCriteria(ServerRequestInterface $request): bool |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * |
||
| 95 | */ |
||
| 96 | protected function matchesSingleTerm(WP_Post $post): bool |
||
| 105 | } |
||
| 106 | |||
| 107 | /** |
||
| 108 | * |
||
| 109 | */ |
||
| 110 | protected function matchesAllTerms(WP_Post $post): bool |
||
| 119 | } |
||
| 120 | } |
||
| 121 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths