Upgrade to 3.7.1

This commit is contained in:
Bastian Allgeier
2022-07-12 13:33:21 +02:00
parent 7931eb5e47
commit 1ad1eaf387
377 changed files with 63981 additions and 63824 deletions

View File

@@ -16,80 +16,80 @@ namespace Kirby\Cms;
*/
class Ingredients
{
/**
* @var array
*/
protected $ingredients = [];
/**
* @var array
*/
protected $ingredients = [];
/**
* Creates a new ingredient collection
*
* @param array $ingredients
*/
public function __construct(array $ingredients)
{
$this->ingredients = $ingredients;
}
/**
* Creates a new ingredient collection
*
* @param array $ingredients
*/
public function __construct(array $ingredients)
{
$this->ingredients = $ingredients;
}
/**
* Magic getter for single ingredients
*
* @param string $method
* @param array|null $args
* @return mixed
*/
public function __call(string $method, array $args = null)
{
return $this->ingredients[$method] ?? null;
}
/**
* Magic getter for single ingredients
*
* @param string $method
* @param array|null $args
* @return mixed
*/
public function __call(string $method, array $args = null)
{
return $this->ingredients[$method] ?? null;
}
/**
* Improved `var_dump` output
*
* @return array
*/
public function __debugInfo(): array
{
return $this->ingredients;
}
/**
* Improved `var_dump` output
*
* @return array
*/
public function __debugInfo(): array
{
return $this->ingredients;
}
/**
* Get a single ingredient by key
*
* @param string $key
* @return mixed
*/
public function __get(string $key)
{
return $this->ingredients[$key] ?? null;
}
/**
* Get a single ingredient by key
*
* @param string $key
* @return mixed
*/
public function __get(string $key)
{
return $this->ingredients[$key] ?? null;
}
/**
* Resolves all ingredient callbacks
* and creates a plain array
*
* @internal
* @param array $ingredients
* @return static
*/
public static function bake(array $ingredients)
{
foreach ($ingredients as $name => $ingredient) {
if (is_a($ingredient, 'Closure') === true) {
$ingredients[$name] = $ingredient($ingredients);
}
}
/**
* Resolves all ingredient callbacks
* and creates a plain array
*
* @internal
* @param array $ingredients
* @return static
*/
public static function bake(array $ingredients)
{
foreach ($ingredients as $name => $ingredient) {
if (is_a($ingredient, 'Closure') === true) {
$ingredients[$name] = $ingredient($ingredients);
}
}
return new static($ingredients);
}
return new static($ingredients);
}
/**
* Returns all ingredients as plain array
*
* @return array
*/
public function toArray(): array
{
return $this->ingredients;
}
/**
* Returns all ingredients as plain array
*
* @return array
*/
public function toArray(): array
{
return $this->ingredients;
}
}