mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-11 17:33:56 +09:00
Updates to vendors etc
This commit is contained in:
@@ -23,19 +23,17 @@ class CollectionConfigurator
|
||||
use Traits\HostTrait;
|
||||
use Traits\RouteTrait;
|
||||
|
||||
private RouteCollection $parent;
|
||||
private ?CollectionConfigurator $parentConfigurator;
|
||||
private ?array $parentPrefixes;
|
||||
private string|array|null $host = null;
|
||||
|
||||
public function __construct(RouteCollection $parent, string $name, ?self $parentConfigurator = null, ?array $parentPrefixes = null)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
public function __construct(
|
||||
private RouteCollection $parent,
|
||||
string $name,
|
||||
private ?self $parentConfigurator = null, // for GC control
|
||||
private ?array $parentPrefixes = null,
|
||||
) {
|
||||
$this->name = $name;
|
||||
$this->collection = new RouteCollection();
|
||||
$this->route = new Route('');
|
||||
$this->parentConfigurator = $parentConfigurator; // for GC control
|
||||
$this->parentPrefixes = $parentPrefixes;
|
||||
}
|
||||
|
||||
public function __sleep(): array
|
||||
@@ -43,10 +41,7 @@ class CollectionConfigurator
|
||||
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function __wakeup()
|
||||
public function __wakeup(): void
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
||||
}
|
||||
@@ -84,11 +79,11 @@ class CollectionConfigurator
|
||||
if (null === $this->parentPrefixes) {
|
||||
// no-op
|
||||
} elseif ($missing = array_diff_key($this->parentPrefixes, $prefix)) {
|
||||
throw new \LogicException(sprintf('Collection "%s" is missing prefixes for locale(s) "%s".', $this->name, implode('", "', array_keys($missing))));
|
||||
throw new \LogicException(\sprintf('Collection "%s" is missing prefixes for locale(s) "%s".', $this->name, implode('", "', array_keys($missing))));
|
||||
} else {
|
||||
foreach ($prefix as $locale => $localePrefix) {
|
||||
if (!isset($this->parentPrefixes[$locale])) {
|
||||
throw new \LogicException(sprintf('Collection "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $this->name, $locale));
|
||||
throw new \LogicException(\sprintf('Collection "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $this->name, $locale));
|
||||
}
|
||||
|
||||
$prefix[$locale] = $this->parentPrefixes[$locale].$localePrefix;
|
||||
|
||||
Reference in New Issue
Block a user