Dependency updates and update version number

This commit is contained in:
Kode
2018-06-13 19:35:28 +01:00
parent 18ec208381
commit e3ec7de23a
1261 changed files with 45582 additions and 29687 deletions

View File

@@ -23,13 +23,15 @@ class CollectionConfigurator
use Traits\RouteTrait;
private $parent;
private $parentConfigurator;
public function __construct(RouteCollection $parent, $name)
public function __construct(RouteCollection $parent, $name, self $parentConfigurator = null)
{
$this->parent = $parent;
$this->name = $name;
$this->collection = new RouteCollection();
$this->route = new Route('');
$this->parentConfigurator = $parentConfigurator; // for GC control
}
public function __destruct()
@@ -50,7 +52,7 @@ class CollectionConfigurator
{
$this->collection->add($this->name.$name, $route = clone $this->route);
return new RouteConfigurator($this->collection, $route->setPath($path), $this->name);
return new RouteConfigurator($this->collection, $route->setPath($path), $this->name, $this);
}
/**
@@ -60,7 +62,7 @@ class CollectionConfigurator
*/
final public function collection($name = '')
{
return new self($this->collection, $this->name.$name);
return new self($this->collection, $this->name.$name, $this);
}
/**

View File

@@ -22,10 +22,13 @@ class RouteConfigurator
use Traits\AddTrait;
use Traits\RouteTrait;
public function __construct(RouteCollection $collection, Route $route, $name = '')
private $parentConfigurator;
public function __construct(RouteCollection $collection, Route $route, $name = '', CollectionConfigurator $parentConfigurator = null)
{
$this->collection = $collection;
$this->route = $route;
$this->name = $name;
$this->parentConfigurator = $parentConfigurator; // for GC control
}
}

View File

@@ -39,9 +39,17 @@ class RoutingConfigurator
final public function import($resource, $type = null, $ignoreErrors = false)
{
$this->loader->setCurrentDir(dirname($this->path));
$subCollection = $this->loader->import($resource, $type, $ignoreErrors, $this->file);
$imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file);
if (!is_array($imported)) {
return new ImportConfigurator($this->collection, $imported);
}
return new ImportConfigurator($this->collection, $subCollection);
$mergedCollection = new RouteCollection();
foreach ($imported as $subCollection) {
$mergedCollection->addCollection($subCollection);
}
return new ImportConfigurator($this->collection, $mergedCollection);
}
/**

View File

@@ -34,9 +34,10 @@ trait AddTrait
*/
final public function add($name, $path)
{
$parentConfigurator = $this instanceof RouteConfigurator ? $this->parentConfigurator : null;
$this->collection->add($this->name.$name, $route = new Route($path));
return new RouteConfigurator($this->collection, $route);
return new RouteConfigurator($this->collection, $route, '', $parentConfigurator);
}
/**