| 1 | <?php |
||
| 7 | class Acronym extends AbstractMode |
||
| 8 | { |
||
| 9 | // A list |
||
| 10 | protected $acronyms = array(); |
||
| 11 | protected $pattern = ''; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Acronym constructor. |
||
| 15 | * |
||
| 16 | * @param string[] $acronyms |
||
| 17 | */ |
||
| 18 | public function __construct($acronyms) |
||
| 23 | |||
| 24 | /** @inheritdoc */ |
||
| 25 | public function preConnect() |
||
| 33 | |||
| 34 | /** @inheritdoc */ |
||
| 35 | public function connectTo($mode) |
||
| 43 | |||
| 44 | /** @inheritdoc */ |
||
| 45 | public function getSort() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * sort callback to order by string length descending |
||
| 52 | * |
||
| 53 | * @param string $a |
||
| 54 | * @param string $b |
||
| 55 | * |
||
| 56 | * @return int |
||
| 57 | */ |
||
| 58 | protected function compare($a, $b) |
||
| 70 | } |
||
| 71 |