EqualId.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\ListScreenRepository\Rule; |
| 4 | |
| 5 | use AC\ListScreenRepository\Rule; |
| 6 | use AC\Type\ListScreenId; |
| 7 | |
| 8 | class EqualId implements Rule { |
| 9 | |
| 10 | /** |
| 11 | * @var ListScreenId |
| 12 | */ |
| 13 | private $id; |
| 14 | |
| 15 | public function __construct( ListScreenId $id ) { |
| 16 | $this->id = $id; |
| 17 | } |
| 18 | |
| 19 | public function match( array $args ) { |
| 20 | if ( ! isset( $args[ self::ID ] ) ) { |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | return $this->id->equals( $args[ self::ID ] ); |
| 25 | } |
| 26 | |
| 27 | } |