Bristol SU Support Package
src
Logic
Specification
OrSpecification.php
Go to the documentation of this file.
1
<?php
2
3
4
namespace
BristolSU\Support\Logic\Specification
;
5
6
7
use
BristolSU\Support\Logic\Contracts\Specification
;
8
12
class
OrSpecification
implements
Specification
13
{
14
20
private
$specifications
;
21
25
public
function
__construct
(...
$specifications
)
26
{
27
$this->specifications =
$specifications
;
28
}
29
35
public
function
isSatisfied
() : bool
36
{
37
if
(count($this->specifications) === 0) {
38
return
true
;
39
}
40
foreach
($this->specifications as $specification) {
41
if
($specification->isSatisfied()) {
42
return
true
;
43
}
44
}
45
46
return
false
;
47
}
48
49
}
Specification
BristolSU\Support\Logic\Specification\OrSpecification\$specifications
$specifications
Definition:
OrSpecification.php:20
BristolSU\Support\Logic\Specification
Definition:
AndSpecification.php:4
BristolSU\Support\Logic\Specification\OrSpecification\isSatisfied
isSatisfied()
Definition:
OrSpecification.php:35
BristolSU\Support\Logic\Specification\OrSpecification
Definition:
OrSpecification.php:12
BristolSU\Support\Logic\Contracts\Specification
Definition:
Specification.php:10
BristolSU\Support\Logic\Specification\OrSpecification\__construct
__construct(... $specifications)
Definition:
OrSpecification.php:25
Generated by
1.8.13