Files
kiri-core/http-helper/Route/Any.php
T

41 lines
496 B
PHP
Raw Normal View History

2020-08-31 01:27:08 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-08-31 01:27:08 +08:00
2021-08-17 16:43:50 +08:00
namespace Http\Route;
2020-08-31 01:27:08 +08:00
/**
* Class Any
2021-08-11 01:04:57 +08:00
* @package Kiri\Kiri\Route
2020-08-31 01:27:08 +08:00
*/
class Any
{
2020-12-17 14:09:14 +08:00
private array $nodes = [];
2020-08-31 01:27:08 +08:00
/**
* Any constructor.
* @param array $nodes
*/
public function __construct(array $nodes)
{
$this->nodes = $nodes;
}
/**
* @param $name
* @param $arguments
* @return $this
*/
2020-12-17 14:09:14 +08:00
public function __call($name, $arguments): static
2020-08-31 01:27:08 +08:00
{
foreach ($this->nodes as $node) {
$node->{$name}(...$arguments);
}
return $this;
}
}