Ejemplo n.º 1
0
 /**
  * @param \ArrayObject|\ArrayObject[] $logs
  * @param bool $amsterdamSuffix
  *
  * @return string
  */
 protected function drawHTML($logs, $amsterdamSuffix = false)
 {
     $displayLog = '';
     if ($logs && $logs->count()) {
         foreach ($logs as $log) {
             if ($log['action_id'] == Logger::ACTION_BLOB) {
                 $displayLog .= $this->blobBeautifier($log['value']);
             } else {
                 $displayLog .= $this->concatFieldsHTML($log, $amsterdamSuffix);
             }
         }
     }
     return $displayLog;
 }
Ejemplo n.º 2
0
 /**
  * @return \Nano\Route\Common|null
  * @param string $method
  * @param string $location
  */
 protected function findRoute($method, $location)
 {
     if (!$this->routes->offsetExists($method)) {
         return null;
     }
     foreach ($this->routes->offsetGet($method) as $route) {
         if ($route->match($location)) {
             $route->addParams($this->params);
             return $route;
         }
     }
     return null;
 }
Ejemplo n.º 3
0
 /**
  * Resolve this dependency graph. In the end a valid path will be returned.
  *
  * @return DependencyNode[]
  */
 public function resolve()
 {
     if ($this->dependencies->count() === 0) {
         return array();
     }
     $resolved = new ArrayObject();
     foreach ($this->findRootNodes() as $rootNode) {
         $this->innerResolve($rootNode, $resolved, new ArrayObject());
     }
     //all resolved?
     if ($resolved->count() !== count($this->nodes)) {
         throw new CircularDependencyException();
     }
     $resolvedElements = array_map(function (DependencyNode $node) {
         return $node->getElement();
     }, $resolved->getArrayCopy());
     return $resolvedElements;
 }