manifests[$name] = $manifest; if ($isDefault) { $this->defaultManifest = $name; } } public function registerManifest( string $name, string $path, string $baseUrl, string $parserClass = JsonManifestParser::class, bool $isDefault = false, ): void { $this->addManifest( $name, new Manifest($path, $baseUrl, $parserClass), $isDefault ); } public function getManifests(): array { return $this->manifests; } public function getManifest(string $name): Manifest { return $this->getManifests()[$name]; } public function setDefaultManifest(?string $name): void { if ($name !== null && ($this->manifests[$name] ?? false) === false) { throw new InvalidArgumentException( "No manifest with name {$name} exists" ); } $this->defaultManifest = $name; } public function getDefaultManifest(): ?Manifest { return ( $this->defaultManifest === null ? null : $this->getManifest($this->defaultManifest) ); } public function getFileManifest(FileString $file): ?Manifest { if ($file->manifestName !== null) { return $this->getManifest($file->manifestName); } else { return $this->getDefaultManifest(); } } public function queueFile(string $file, string $fileClass, bool $footer): void { $file = new FileString($file); $manifest = $this->getFileManifest($file); } public function queueScript(string $file, bool $footer = true): void { $this->queueFile($file, ScriptFile::class, $footer); } public function queueStyle(string $file): void { $this->queueFile($file, StyleFile::class, false); } public function getQueuedHeadFiles(): array { return $this->queuedHeadFiles; } public function getQueuedFooterFiles(): array { return $this->queuedFooterFiles; } }