コード例 #1
0
ファイル: Collection.php プロジェクト: colonB/Copycat
 /**
  * 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);
 }
コード例 #2
0
ファイル: Handler.php プロジェクト: colonB/Copycat
 /**
  * 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);
         }
     }
 }