我创建了一个用于堆栈对象层和闭包的类,但我的服务器还没有在php 5.6上运行.我想知道我怎么可以转换的...$parameters,因为我不能用替代一切修复它call_user_func_array()那么buildCoreClosure()方法将抛出错误,例如,由于关闭心不是一个数组...
class Stack
{
/**
* Method to call on the decoracted class.
*
* @var string
*/
protected $method;
/**
* Container.
*/
protected $container;
/**
* Middleware layers.
*
* @var array
*/
protected $layers = [];
public function __construct(Container $container = null, $method = null)
{
$this->container = $container ?: new Container;
$this->method = $method ?: 'handle';
}
public function addLayer($class, $inner = true)
{
return $inner ? array_unshift($this->layers, $class) …Run Code Online (Sandbox Code Playgroud)