1 | <?php |
||
17 | class GoutteDriverFactory implements IMinkDriverFactory |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Returns driver name, that can be used in browser configuration. |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | 10 | public function getDriverName() |
|
29 | |||
30 | /** |
||
31 | * Returns default values for browser configuration. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | 1 | public function getDriverDefaults() |
|
44 | |||
45 | /** |
||
46 | * Returns a new driver instance according to the browser configuration. |
||
47 | * |
||
48 | * @param BrowserConfiguration $browser The browser configuration. |
||
49 | * |
||
50 | * @return DriverInterface |
||
51 | * @throws \RuntimeException When driver isn't installed. |
||
52 | */ |
||
53 | 1 | public function createDriver(BrowserConfiguration $browser) |
|
76 | |||
77 | /** |
||
78 | * Builds Guzzle 6 client. |
||
79 | * |
||
80 | * @param array $parameters Parameters. |
||
81 | * |
||
82 | * @return \GuzzleHttp\Client |
||
83 | */ |
||
84 | private function _buildGuzzle6Client(array $parameters) |
||
92 | |||
93 | /** |
||
94 | * Builds Guzzle 4 client. |
||
95 | * |
||
96 | * @param array $parameters Parameters. |
||
97 | * |
||
98 | * @return \GuzzleHttp\Client |
||
99 | */ |
||
100 | private function _buildGuzzle4Client(array $parameters) |
||
108 | |||
109 | /** |
||
110 | * Builds Guzzle 3 client. |
||
111 | * |
||
112 | * @param array $parameters Parameters. |
||
113 | * |
||
114 | * @return \Guzzle\Http\Client |
||
115 | */ |
||
116 | private function _buildGuzzle3Client(array $parameters) |
||
123 | |||
124 | /** |
||
125 | * Determines Goutte client version. |
||
126 | * |
||
127 | * @return boolean |
||
128 | */ |
||
129 | private function _isGoutte1() |
||
139 | |||
140 | /** |
||
141 | * Determines Guzzle version. |
||
142 | * |
||
143 | * @return boolean |
||
144 | */ |
||
145 | private function _isGuzzle6() |
||
150 | } |
||
151 |