1 | <?php |
||
21 | class Transformator extends ArrayObject implements |
||
22 | TransformatorInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var LocatorStrategyFactory |
||
26 | */ |
||
27 | protected $strategyFactory; |
||
28 | |||
29 | /** |
||
30 | * @param array $array |
||
31 | */ |
||
32 | public function __construct(array $array = []) |
||
36 | |||
37 | /** |
||
38 | * @return LocatorStrategyFactory |
||
39 | */ |
||
40 | public function getStrategyFactory() |
||
48 | |||
49 | /** |
||
50 | * @param LocatorStrategyFactory $factory |
||
51 | * @return Transformator |
||
52 | */ |
||
53 | public function setStrategyFactory(LocatorStrategyFactory $factory) |
||
58 | |||
59 | /** |
||
60 | * @param string $index Strategy type |
||
61 | * @return mixed |
||
62 | */ |
||
63 | public function offsetGet($index) |
||
74 | |||
75 | /** |
||
76 | * Add strategy |
||
77 | * |
||
78 | * @param string $index Strategy type |
||
79 | * @param TransformatorInterface $strategy |
||
80 | * @throws Exception\UnexpectedValueException |
||
81 | */ |
||
82 | public function offsetSet($index, $strategy) |
||
92 | |||
93 | /** |
||
94 | * Select strategy and transform locator to XPath |
||
95 | * |
||
96 | * @param string $locator |
||
97 | * @return string |
||
98 | */ |
||
99 | public function locator2Xpath($locator) |
||
105 | } |
||
106 |