| 1 | <?php |
||
| 18 | class LocatorStrategyFactory |
||
| 19 | { |
||
| 20 | const DEFAULT_STRATEGY = 'css'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Available strategies |
||
| 24 | * |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | protected static $strategyList = [ |
||
| 28 | 'css' => 'WebinoDraw\Dom\Locator\Strategy\CssStrategy', |
||
| 29 | 'xpath' => 'WebinoDraw\Dom\Locator\Strategy\XpathStrategy', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $type Strategy type |
||
| 34 | * @return TransformatorInterface |
||
| 35 | * @throws OutOfBoundsException |
||
| 36 | */ |
||
| 37 | public function createStrategy($type) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Return provided or default strategy type |
||
| 49 | * |
||
| 50 | * @param string $type |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | protected function determineStrategy($type) |
||
| 60 | } |
||
| 61 |