/** * Constructor * Each item in a list should be callable * @param array $list default empty array * @throws \Copycat\System\Exception */ public function __construct(array $list = array()) { foreach ($list as $callback) { System::checkCallable($callback); } parent::__construct($list); }
/** * Constructor * @param array|null $list default null * @throws \Copycat\Callback\Exception */ public function __construct(array $list = null) { parent::__construct(); if (!empty($list)) { foreach ($list as $key => $value) { if (!$value instanceof Collection) { throw new Exception('Wrond stucture is given for handling'); } $this->add($key, $value); } } }