コード例 #1
0
ファイル: Bus.php プロジェクト: cubiche/cubiche
 /**
  * Adds a middleware to the middleware list. The higher priority value, the earlier a middleware
  * will be triggered in the chain (defaults to 0).
  *
  * @param MiddlewareInterface $middleware
  * @param int                 $priority
  */
 public function addMiddleware(MiddlewareInterface $middleware, $priority = 0)
 {
     if (!$this->middlewares->containsKey($priority)) {
         $this->middlewares->set($priority, new ArrayList());
     }
     /** @var ArrayList $middlewares */
     $middlewares = $this->middlewares->get($priority);
     if ($middlewares->findOne(Criteria::eq($middleware)) === null) {
         $middlewares->add($middleware);
     }
 }
コード例 #2
0
 /**
  * @return int
  */
 public function count()
 {
     return $this->store->count();
 }