Skip to content

Commit

Permalink
Upgraded to "rector/rector": "^0.14.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotimi Ade committed Aug 30, 2022
1 parent 8406da4 commit 51b6ffc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"phpunit/phpunit": "^9.0",
"php-coveralls/php-coveralls": "^2.0",
"symfony/polyfill-mbstring": "^1.8",
"rector/rector": "^0.13.0",
"rector/rector": "^0.14.0",
"vimeo/psalm": "^4.7"
},
"autoload": {
Expand Down
13 changes: 5 additions & 8 deletions src/CollectionInterfaceImplementationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2086,8 +2086,7 @@ public function column($column_key, $index_key=null): GenericCollection
) {
$function = __FUNCTION__;
$class = \get_class($this);
$item_type = ($item instanceof ArrayAccess)
? \get_class($item) : Utils::gettype($item);
$item_type = Utils::gettype($item);

$msg = "Error [{$class}::{$function}(...)]:"
. " An item of type `$item_type` without the specified column key `$column_key`"
Expand All @@ -2106,8 +2105,7 @@ public function column($column_key, $index_key=null): GenericCollection
) {
$function = __FUNCTION__;
$class = \get_class($this);
$item_type = ($item instanceof ArrayAccess)
? \get_class($item) : Utils::gettype($item);
$item_type = Utils::gettype($item);

$msg = "Error [{$class}::{$function}(...)]:"
. " An item of type `$item_type` without the specified index key `$index_key`"
Expand Down Expand Up @@ -2150,8 +2148,7 @@ public function column($column_key, $index_key=null): GenericCollection

$function = __FUNCTION__;
$class = \get_class($this);
$item_type = ($item instanceof ArrayAccess)
? \get_class($item) : Utils::gettype($item);
$item_type = Utils::gettype($item);

$msg = "Error [{$class}::{$function}(...)]:"
. " Error occured while accessing an item of type `$item_type` with the specified index key `$index_key`"
Expand All @@ -2160,7 +2157,7 @@ public function column($column_key, $index_key=null): GenericCollection
throw new RuntimeException($msg);
}

} else if( \is_object($item) ) {
} else { // \is_object($item) === true && !($item instanceof ArrayAccess)

if(
!\is_null($index_key)
Expand Down Expand Up @@ -2197,7 +2194,7 @@ public function column($column_key, $index_key=null): GenericCollection

$function = __FUNCTION__;
$class = \get_class($this);
$item_type = \get_class($item);
$item_type = Utils::gettype($item);
$msg = "Error [{$class}::{$function}(...)]:"
. " Error occured while accessing an item of type `$item_type` with the specified index key `$index_key`"
. " and specified column key `$column_key` with this key `$coll_key` in the collection." . PHP_EOL
Expand Down
7 changes: 4 additions & 3 deletions tests/objects/ArrayAccessObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(array $array=[]) {
$this->container = $array;
}

public function offsetSet($offset, $value) {
public function offsetSet($offset, $value): void {

if (is_null($offset)) {

Expand All @@ -26,16 +26,17 @@ public function offsetSet($offset, $value) {
}
}

public function offsetExists($offset) {
public function offsetExists($offset): bool {

return array_key_exists($offset, $this->container);
}

public function offsetUnset($offset) {
public function offsetUnset($offset): void {

unset($this->container[$offset]);
}

#[\ReturnTypeWillChange]
public function offsetGet($offset) {

if( $this->offsetExists($offset) ) {
Expand Down

0 comments on commit 51b6ffc

Please sign in to comment.