Skip to content

Commit 5eea65b

Browse files
author
Jamie Hannaford
committed
use correct return types
1 parent a3fbe53 commit 5eea65b

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/Common/Api/Operator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ public function newInstance(): self
129129
}
130130

131131
/**
132-
* @return \GuzzleHttp\Psr7\Uri
132+
* @return \GuzzleHttp\Psr7\Uri:null
133133
*/
134-
protected function getHttpBaseUrl(): Uri
134+
protected function getHttpBaseUrl()
135135
{
136136
return $this->client->getConfig('base_uri');
137137
}

src/Common/Api/Parameter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ public function getPath(): string
338338
/**
339339
* Retrieves the common schema that an array parameter applies to all its child elements.
340340
*
341-
* @return Parameter
341+
* @return Parameter|null
342342
*/
343-
public function getItemSchema(): Parameter
343+
public function getItemSchema()
344344
{
345345
return $this->itemSchema;
346346
}

src/Common/Resource/AbstractResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function populateFromArray(array $array): self
8484
$reflClass = new \ReflectionClass($this);
8585

8686
foreach ($array as $key => $val) {
87-
$propertyName = isset($this->aliases[$key]) ? $this->aliases[$key] : $key;
87+
$propertyName = (string) (isset($this->aliases[$key]) ? $this->aliases[$key] : $key);
8888

8989
if (property_exists($this, $propertyName)) {
9090
if ($type = $this->extractTypeFromDocBlock($reflClass, $propertyName)) {

src/Common/Resource/Creatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ interface Creatable
1515
* @param array $userOptions
1616
* @return self
1717
*/
18-
public function create(array $userOptions): self;
18+
public function create(array $userOptions): Creatable;
1919
}

src/Common/Resource/HasMetadata.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public function getMetadata(): array;
3232
*
3333
* @param array $metadata The new metadata items
3434
*
35-
* @return mixed
35+
* @return void
3636
*/
37-
public function mergeMetadata(array $metadata): array;
37+
public function mergeMetadata(array $metadata);
3838

3939
/**
4040
* Replaces all of the existing metadata items for a resource with a new set of values. Any metadata items which
@@ -52,9 +52,9 @@ public function mergeMetadata(array $metadata): array;
5252
*
5353
* @param array $metadata The new metadata items
5454
*
55-
* @return mixed
55+
* @return void
5656
*/
57-
public function resetMetadata(array $metadata): array;
57+
public function resetMetadata(array $metadata);
5858

5959
/**
6060
* Extracts metadata from a response object and returns it in the form of an associative array.

src/Common/Transport/JsonSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function stockJson(Parameter $param, $userValue, array $json): array
8787
if ($param->isArray()) {
8888
$userValue = $this->stockArrayJson($param, $userValue);
8989
} elseif ($param->isObject()) {
90-
$userValue = $this->stockObjectJson($param, $userValue);
90+
$userValue = $this->stockObjectJson($param, (object) $userValue);
9191
}
9292
// Populate the final value
9393
return $this->stockValue($param, $userValue, $json);

0 commit comments

Comments
 (0)