Lines Matching refs:options

45      * @param array            $options
49 public function __invoke(RequestInterface $request, array $options) argument
53 if (empty($options['allow_redirects'])) {
54 return $fn($request, $options);
57 if ($options['allow_redirects'] === true) {
58 $options['allow_redirects'] = self::$defaultSettings;
59 } elseif (!is_array($options['allow_redirects'])) {
63 $options['allow_redirects'] += self::$defaultSettings;
66 if (empty($options['allow_redirects']['max'])) {
67 return $fn($request, $options);
70 return $fn($request, $options)
71 ->then(function (ResponseInterface $response) use ($request, $options) {
72 return $this->checkRedirect($request, $options, $response);
78 * @param array $options
85 array $options, argument
94 $this->guardMax($request, $options);
95 $nextRequest = $this->modifyRequest($request, $options, $response);
97 if (isset($options['allow_redirects']['on_redirect'])) {
99 $options['allow_redirects']['on_redirect'],
107 $promise = $this($nextRequest, $options);
110 if (!empty($options['allow_redirects']['track_redirects'])) {
150 private function guardMax(RequestInterface $request, array &$options) argument
152 $current = isset($options['__redirect_count'])
153 ? $options['__redirect_count']
155 $options['__redirect_count'] = $current + 1;
156 $max = $options['allow_redirects']['max'];
158 if ($options['__redirect_count'] > $max) {
168 * @param array $options
175 array $options, argument
180 $protocols = $options['allow_redirects']['protocols'];
187 ($statusCode <= 302 && !$options['allow_redirects']['strict'])
194 if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
195 … $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion'];
204 if ($options['allow_redirects']['referer']