flexible-shipping
/
vendor_prefixed
/
octolize
/
wp-octolize-tracker
/
src
/
OptInNotice
/
ShouldDisplayAndConditions.php
flexible-shipping
/
vendor_prefixed
/
octolize
/
wp-octolize-tracker
/
src
/
OptInNotice
Last commit date
views
3 weeks ago
OptInNotice.php
3 weeks ago
ShouldDisplay.php
3 weeks ago
ShouldDisplayAlways.php
3 weeks ago
ShouldDisplayAndConditions.php
3 weeks ago
ShouldDisplayGetParameterPresent.php
3 weeks ago
ShouldDisplayGetParameterValue.php
3 weeks ago
ShouldDisplayNever.php
3 weeks ago
ShouldDisplayOrConditions.php
3 weeks ago
ShouldDisplayShippingMethodInstanceSettings.php
3 weeks ago
ShouldDisplayAndConditions.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace FSVendor\Octolize\Tracker\OptInNotice; |
| 4 | |
| 5 | /** |
| 6 | * Should display AND conditions. |
| 7 | */ |
| 8 | class ShouldDisplayAndConditions implements ShouldDisplay |
| 9 | { |
| 10 | /** |
| 11 | * @var ShouldDisplay[] |
| 12 | */ |
| 13 | private $conditions = []; |
| 14 | /** |
| 15 | * @param ShouldDisplay $should_display |
| 16 | * |
| 17 | * @return void |
| 18 | */ |
| 19 | public function add_should_diaplay_condition(ShouldDisplay $should_display) |
| 20 | { |
| 21 | $this->conditions[] = $should_display; |
| 22 | } |
| 23 | /** |
| 24 | * @inheritDoc |
| 25 | */ |
| 26 | public function should_display() |
| 27 | { |
| 28 | foreach ($this->conditions as $condition) { |
| 29 | if (!$condition->should_display()) { |
| 30 | return \false; |
| 31 | } |
| 32 | } |
| 33 | return \true; |
| 34 | } |
| 35 | } |
| 36 |