| 1 | <?php |
||
| 20 | class SelectorComparator extends Comparator |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var Delegate |
||
| 24 | */ |
||
| 25 | protected $selector; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var Direction |
||
| 29 | */ |
||
| 30 | protected $direction; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param callable $selector |
||
| 34 | * @param Direction $direction |
||
| 35 | */ |
||
| 36 | public function __construct(callable $selector, Direction $direction = null) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return callable |
||
| 44 | */ |
||
| 45 | public function selector() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return \Cubiche\Core\Comparable\Direction |
||
| 52 | */ |
||
| 53 | public function direction() |
||
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | */ |
||
| 61 | public function compare($a, $b) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * {@inheritdoc} |
||
| 71 | */ |
||
| 72 | public function reverse() |
||
| 76 | } |
||
| 77 |