1 | <?php |
||
18 | class GoutteDriverFactory implements IMinkDriverFactory |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Returns driver name, that can be used in browser configuration. |
||
23 | * |
||
24 | * @return string |
||
25 | */ |
||
26 | 10 | public function getDriverName() |
|
30 | |||
31 | /** |
||
32 | * Returns default values for browser configuration. |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | 1 | public function getDriverDefaults() |
|
45 | |||
46 | /** |
||
47 | * Returns a new driver instance according to the browser configuration. |
||
48 | * |
||
49 | * @param BrowserConfiguration $browser The browser configuration. |
||
50 | * |
||
51 | * @return DriverInterface |
||
52 | * @throws \RuntimeException When driver isn't installed. |
||
53 | */ |
||
54 | 1 | public function createDriver(BrowserConfiguration $browser) |
|
79 | |||
80 | /** |
||
81 | * Builds Guzzle 6 client. |
||
82 | * |
||
83 | * @param array $parameters Parameters. |
||
84 | * |
||
85 | * @return \GuzzleHttp\Client |
||
86 | */ |
||
87 | private function _buildGuzzle6Client(array $parameters) |
||
96 | |||
97 | /** |
||
98 | * Builds Guzzle 4 client. |
||
99 | * |
||
100 | * @param array $parameters Parameters. |
||
101 | * |
||
102 | * @return \GuzzleHttp\Client |
||
103 | */ |
||
104 | private function _buildGuzzle4Client(array $parameters) |
||
113 | |||
114 | /** |
||
115 | * Builds Guzzle 3 client. |
||
116 | * |
||
117 | * @param array $parameters Parameters. |
||
118 | * |
||
119 | * @return \Guzzle\Http\Client |
||
120 | */ |
||
121 | private function _buildGuzzle3Client(array $parameters) |
||
128 | |||
129 | /** |
||
130 | * Determines Goutte client version. |
||
131 | * |
||
132 | * @return boolean |
||
133 | */ |
||
134 | private function _isGoutte1() |
||
144 | |||
145 | /** |
||
146 | * Determines Guzzle version. |
||
147 | * |
||
148 | * @return boolean |
||
149 | */ |
||
150 | private function _isGuzzle6() |
||
155 | |||
156 | } |
||
157 |