예제 #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();
 }