@@ -239,7 +239,7 @@ |
||
239 | 239 | * @param string $name Name of the data point to retrieve or null to |
240 | 240 | * retrieve all of the extra data. |
241 | 241 | * |
242 | - * @return mixed|null |
|
242 | + * @return string |
|
243 | 243 | */ |
244 | 244 | public function getData($name = null) |
245 | 245 | { |
@@ -241,7 +241,7 @@ |
||
241 | 241 | * |
242 | 242 | * @param \XMLWriter $writer |
243 | 243 | * |
244 | - * @return \string the writer resource |
|
244 | + * @return string the writer resource |
|
245 | 245 | */ |
246 | 246 | protected function finishDocument($writer) |
247 | 247 | { |
@@ -121,7 +121,7 @@ |
||
121 | 121 | foreach ((array) $root['namespaces'] as $prefix => $uri) { |
122 | 122 | $nsLabel = 'xmlns'; |
123 | 123 | if (!is_numeric($prefix)) { |
124 | - $nsLabel .= ':'.$prefix; |
|
124 | + $nsLabel .= ':' . $prefix; |
|
125 | 125 | } |
126 | 126 | $writer->writeAttribute($nsLabel, $uri); |
127 | 127 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * @param string $type Parameter type |
59 | 59 | * @param mixed $value Value to determine the type |
60 | 60 | * |
61 | - * @return string|bool Returns the matching type on |
|
61 | + * @return string|false Returns the matching type on |
|
62 | 62 | */ |
63 | 63 | protected function determineType($type, $value) |
64 | 64 | { |
@@ -245,12 +245,12 @@ |
||
245 | 245 | |
246 | 246 | // Strings can have enums which are a list of predefined values |
247 | 247 | if (($enum = $param->getEnum()) && !in_array($value, $enum)) { |
248 | - $this->errors[] = "{$path} must be one of " . implode(' or ', array_map(function ($s) { |
|
248 | + $this->errors[] = "{$path} must be one of " . implode(' or ', array_map(function($s) { |
|
249 | 249 | return '"' . addslashes($s) . '"'; |
250 | 250 | }, $enum)); |
251 | 251 | } |
252 | 252 | // Strings can have a regex pattern that the value must match |
253 | - if (($pattern = $param->getPattern()) && !preg_match($pattern, $value)) { |
|
253 | + if (($pattern = $param->getPattern()) && !preg_match($pattern, $value)) { |
|
254 | 254 | $this->errors[] = "{$path} must match the following regular expression: {$pattern}"; |
255 | 255 | } |
256 | 256 |
@@ -97,7 +97,7 @@ |
||
97 | 97 | /** |
98 | 98 | * Get the basePath/baseUri of the description |
99 | 99 | * |
100 | - * @return Uri |
|
100 | + * @return string |
|
101 | 101 | */ |
102 | 102 | public function getBaseUri() |
103 | 103 | { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @param DescriptionInterface $description |
44 | - * @param $process |
|
44 | + * @param boolean $process |
|
45 | 45 | * @param ResponseLocationInterface[] $responseLocations Extra response locations |
46 | 46 | */ |
47 | 47 | public function __construct( |
@@ -277,7 +277,7 @@ |
||
277 | 277 | continue; |
278 | 278 | } |
279 | 279 | |
280 | - if (isset($error['phrase']) && ! ($error['phrase'] === $response->getReasonPhrase())) { |
|
280 | + if (isset($error['phrase']) && !($error['phrase'] === $response->getReasonPhrase())) { |
|
281 | 281 | continue; |
282 | 282 | } |
283 | 283 |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | /** |
474 | 474 | * Get whether or not the default value can be changed |
475 | 475 | * |
476 | - * @return mixed|null |
|
476 | + * @return boolean |
|
477 | 477 | */ |
478 | 478 | public function getStatic() |
479 | 479 | { |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | /** |
569 | 569 | * Get the enum of strings that are valid for the parameter |
570 | 570 | * |
571 | - * @return array|null |
|
571 | + * @return string |
|
572 | 572 | */ |
573 | 573 | public function getEnum() |
574 | 574 | { |
@@ -7,8 +7,6 @@ |
||
7 | 7 | use GuzzleHttp\Command\Guzzle\RequestLocation\HeaderLocation; |
8 | 8 | use GuzzleHttp\Command\Guzzle\RequestLocation\JsonLocation; |
9 | 9 | use GuzzleHttp\Command\Guzzle\RequestLocation\MultiPartLocation; |
10 | -use GuzzleHttp\Command\Guzzle\RequestLocation\PostFieldLocation; |
|
11 | -use GuzzleHttp\Command\Guzzle\RequestLocation\PostFileLocation; |
|
12 | 10 | use GuzzleHttp\Command\Guzzle\RequestLocation\QueryLocation; |
13 | 11 | use GuzzleHttp\Command\Guzzle\RequestLocation\RequestLocationInterface; |
14 | 12 | use GuzzleHttp\Command\Guzzle\RequestLocation\XmlLocation; |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __invoke(callable $handler) |
39 | 39 | { |
40 | - return function (CommandInterface $command) use ($handler) { |
|
40 | + return function(CommandInterface $command) use ($handler) { |
|
41 | 41 | $errors = []; |
42 | 42 | $operation = $this->description->getOperation($command->getName()); |
43 | 43 | |
44 | 44 | foreach ($operation->getParams() as $name => $schema) { |
45 | 45 | $value = $command[$name]; |
46 | - if (! $this->validator->validate($schema, $value)) { |
|
46 | + if (!$this->validator->validate($schema, $value)) { |
|
47 | 47 | $errors = array_merge($errors, $this->validator->getErrors()); |
48 | 48 | } elseif ($value !== $command[$name]) { |
49 | 49 | // Update the config value if it changed and no validation |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | if ($params = $operation->getAdditionalParameters()) { |
56 | 56 | foreach ($command->toArray() as $name => $value) { |
57 | 57 | // It's only additional if it isn't defined in the schema |
58 | - if (! $operation->hasParam($name)) { |
|
58 | + if (!$operation->hasParam($name)) { |
|
59 | 59 | // Always set the name so that error messages are useful |
60 | 60 | $params->setName($name); |
61 | - if (! $this->validator->validate($params, $value)) { |
|
61 | + if (!$this->validator->validate($params, $value)) { |
|
62 | 62 | $errors = array_merge($errors, $this->validator->getErrors()); |
63 | 63 | } elseif ($value !== $command[$name]) { |
64 | 64 | $command[$name] = $value; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | private function getSerializer($commandToRequestTransformer) |
98 | 98 | { |
99 | - return $commandToRequestTransformer ==! null |
|
99 | + return $commandToRequestTransformer == !null |
|
100 | 100 | ? $commandToRequestTransformer |
101 | 101 | : new Serializer($this->description); |
102 | 102 | } |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | */ |
110 | 110 | private function getDeserializer($responseToResultTransformer) |
111 | 111 | { |
112 | - $process = (! isset($this->config['process']) || $this->config['process'] === true); |
|
112 | + $process = (!isset($this->config['process']) || $this->config['process'] === true); |
|
113 | 113 | |
114 | - return $responseToResultTransformer ==! null |
|
114 | + return $responseToResultTransformer == !null |
|
115 | 115 | ? $responseToResultTransformer |
116 | 116 | : new Deserializer($this->description, $process); |
117 | 117 | } |