Skip to content

Commit 31729ca

Browse files
one more round of small fixes
1 parent 963d8f5 commit 31729ca

File tree

7 files changed

+34
-35
lines changed

7 files changed

+34
-35
lines changed

src/AQL/BindContainer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public function __construct()
3636
* Add validation to value being set.
3737
* All values must be primitives data types
3838
*
39-
* @param int|string $key
40-
* @param mixed $value
39+
* @param int|string $key
40+
* @param mixed $value
4141
* @throws InvalidParameterException
4242
*/
43-
public function put($key, $value): void
43+
public function put(int|string $key, mixed $value): void
4444
{
4545
$this->validator->setAttributes($value);
4646
if ($this->validator->validate()) {

src/Admin/Task/Task.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Task implements EntityInterface
4141
*
4242
* @var array
4343
*/
44-
protected $attributes;
44+
protected array $attributes;
4545

4646
/**
4747
* Connection object.
@@ -55,7 +55,7 @@ class Task implements EntityInterface
5555
*
5656
* @var array
5757
*/
58-
protected $defaultOptions = [
58+
protected array $defaultOptions = [
5959
'offset' => 30,
6060
'period' => 30,
6161
'params' => []
@@ -67,7 +67,7 @@ class Task implements EntityInterface
6767
*
6868
* @var bool
6969
*/
70-
protected $isNew = true;
70+
protected bool $isNew = true;
7171

7272
/**
7373
* Task constructor.
@@ -260,7 +260,7 @@ public function delete(): bool
260260
/**
261261
* Return a JSON representation of Task object.
262262
*
263-
* @return array|mixed
263+
* @return mixed
264264
*/
265265
public function jsonSerialize(): mixed
266266
{

src/Auth/Authenticable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function authenticate(array $credentials): void
7474
*
7575
* @return array
7676
*/
77-
protected function getAuthorizationHeader()
77+
protected function getAuthorizationHeader(): array
7878
{
7979
$header = [];
8080
if (is_array($this->authToken)) {
@@ -103,7 +103,7 @@ private function getCredentials(): array
103103
*
104104
* @return string
105105
*/
106-
private function getAuthenticationEndpoint()
106+
private function getAuthenticationEndpoint(): string
107107
{
108108
return sprintf(Api::DB . "%s" . Api::AUTH_BASE, $this->getDatabaseName());
109109
}

src/Connection/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getDefaultHeaders(): array
8484
*
8585
* @param array $headers The default array to add on all requests.
8686
*/
87-
public function setDefaultHeaders(array $headers)
87+
public function setDefaultHeaders(array $headers): void
8888
{
8989
$this->defaultHeaders = $headers;
9090
}

src/DataStructures/ArrayList.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function last()
7474
* @param int|string $key KeyType to verify on list.
7575
* @return mixed
7676
*/
77-
public function get($key)
77+
public function get(int|string $key)
7878
{
7979
if (array_key_exists($key, $this->content)) {
8080
return $this->content[$key];
@@ -88,40 +88,40 @@ public function get($key)
8888
*
8989
* @param mixed $value Value to add.
9090
*/
91-
public function push($value): void
91+
public function push(mixed $value): void
9292
{
9393
$this->content[] = $value;
9494
}
9595

9696
/**
9797
* Put a object into list on given key
9898
*
99-
* @param string|integer $key KeyType for manage the value.
99+
* @param integer|string $key KeyType for manage the value.
100100
* @param mixed $value Value to add.
101101
*/
102-
public function put($key, $value): void
102+
public function put(int|string $key, mixed $value): void
103103
{
104104
$this->content[$key] = $value;
105105
}
106106

107107
/**
108108
* Check if a given key exists on list
109109
*
110-
* @param $key Key to verify on list.
110+
* @param $key int|string to verify on list.
111111
* @return bool True if key exists, false otherwise.
112112
*/
113-
public function has($key): bool
113+
public function has(int|string $key): bool
114114
{
115115
return array_key_exists($key, $this->content);
116116
}
117117

118118
/**
119119
* Remove a value by it's key on list
120120
*
121-
* @param $key Key to remove from list.
121+
* @param $key int|string to remove from list.
122122
* @return mixed
123123
*/
124-
public function remove($key)
124+
public function remove(int|string $key)
125125
{
126126
unset($this->content[$key]);
127127
}

src/DataStructures/Contracts/ListInterface.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,52 @@ interface ListInterface extends \Iterator, \JsonSerializable, \Countable
1717
*
1818
* @return mixed
1919
*/
20-
public function first();
20+
public function first(): mixed;
2121

2222
/**
2323
* Get the last value of list
2424
*
2525
* @return mixed
2626
*/
27-
public function last();
27+
public function last(): mixed;
2828

2929
/**
30-
* Get a value by it's key
30+
* Get a value by its key
3131
*
32-
* @param $key Key to verify on list.
32+
* @param integer|string $key key to verify on list.
3333
* @return mixed
3434
*/
35-
public function get($key);
35+
public function get(int|string $key): mixed;
3636

3737
/**
3838
* Add a value to list
3939
*
4040
* @param mixed $value Value to add.
4141
*/
42-
public function push($value): void;
42+
public function push(mixed $value): void;
4343

4444
/**
45-
* Put a object into list on given key
45+
* Put an object into list on given key
4646
*
47-
* @param string|integer $key KeyType for manage the value.
47+
* @param integer|string $key KeyType for manage the value.
4848
* @param mixed $value Value to add.
4949
*/
50-
public function put($key, $value): void;
50+
public function put(int|string $key, mixed $value): void;
5151

5252
/**
5353
* Check if a given key exists on list
5454
*
55-
* @param $key Key to verify on list.
55+
* @param integer|string $key Key to verify on list.
5656
* @return bool True if key exists, false otherwise.
5757
*/
58-
public function has($key): bool;
58+
public function has(int|string $key): bool;
5959

6060
/**
61-
* Remove a value by it's key on list
61+
* Remove a value by its key on list
6262
*
63-
* @param $key Key to remove from list.
64-
* @return mixed
63+
* @param integer|string $key key to remove from list.
6564
*/
66-
public function remove($key);
65+
public function remove(int|string $key): void;
6766

6867
/**
6968
* Return an array representation for list

src/Http/Api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ abstract class Api
8282
public const JWT_AUTH_BASE = "/_open/auth";
8383

8484
/**
85-
* Add an URI param to an URI
85+
* Add a param to the URI
8686
*
8787
* @param string $baseUri Base URI to add a parameter.
8888
* @param string|integer $param Parameter value.
@@ -95,7 +95,7 @@ public static function addUriParam(string $baseUri, $param): string
9595
}
9696

9797
/**
98-
* Add an URI query
98+
* Add a URI query
9999
*
100100
* @param string $baseUri Base URI to add a query.
101101
* @param array $data Query data.

0 commit comments

Comments
 (0)