Upgrade to 3.9.0

This commit is contained in:
Bastian Allgeier
2023-01-17 14:50:16 +01:00
parent 0ebe0c7b16
commit 6e5c9d1f48
132 changed files with 1664 additions and 1254 deletions

View File

@@ -19,8 +19,6 @@ class Obj extends stdClass
{
/**
* Constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
@@ -31,10 +29,6 @@ class Obj extends stdClass
/**
* Magic getter
*
* @param string $property
* @param array $arguments
* @return mixed
*/
public function __call(string $property, array $arguments)
{
@@ -43,8 +37,6 @@ class Obj extends stdClass
/**
* Improved `var_dump` output
*
* @return array
*/
public function __debugInfo(): array
{
@@ -53,9 +45,6 @@ class Obj extends stdClass
/**
* Magic property getter
*
* @param string $property
* @return mixed
*/
public function __get(string $property)
{
@@ -65,19 +54,15 @@ class Obj extends stdClass
/**
* Gets one or multiple properties of the object
*
* @param string|array $property
* @param mixed $fallback If multiple properties are requested:
* Associative array of fallback values per key
* @return mixed
*/
public function get($property, $fallback = null)
public function get(string|array $property, $fallback = null)
{
if (is_array($property)) {
if ($fallback === null) {
$fallback = [];
}
$fallback ??= [];
if (!is_array($fallback)) {
if (is_array($fallback) === false) {
throw new InvalidArgumentException('The fallback value must be an array when getting multiple properties');
}
@@ -93,8 +78,6 @@ class Obj extends stdClass
/**
* Converts the object to an array
*
* @return array
*/
public function toArray(): array
{
@@ -116,9 +99,6 @@ class Obj extends stdClass
/**
* Converts the object to a json string
*
* @param mixed ...$arguments
* @return string
*/
public function toJson(...$arguments): string
{