Skip to content

Commit

Permalink
Added casting for stdClass obj in search method
Browse files Browse the repository at this point in the history
  • Loading branch information
overclokk committed Oct 4, 2021
1 parent 7c47681 commit f571a52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function __clone() {
private static function search( array $array, $key, $default = null ) {

if ( \is_int($key) || \strripos( $key, self::$delimiter ) === false ) {
return \array_key_exists( $key, $array ) ? $array[ $key ] : $default;
return \array_key_exists( $key, (array) $array ) ? $array[ $key ] : $default;
}

$levels = (array) \explode( self::$delimiter, $key );
Expand All @@ -197,7 +197,7 @@ private static function search( array $array, $key, $default = null ) {
$array = \iterator_to_array( $array );
}

if ( ! \array_key_exists( \strval( $level ), $array ) ) {
if ( ! \array_key_exists( \strval( $level ), (array) $array ) ) {
return $default;
}

Expand Down

0 comments on commit f571a52

Please sign in to comment.