Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

PlaceholderProviderRegistry.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\Imagine;
8
9 use InvalidArgumentException;
10
11 class PlaceholderProviderRegistry
12 {
14 private $providers;
15
21 public function __construct(array $providers = [])
22 {
23 $this->providers = $providers;
24 }
25
26 public function addProvider(string $type, PlaceholderProvider $provider)
27 {
28 $this->providers[$type] = $provider;
29 }
30
31 public function supports(string $type): bool
32 {
33 return isset($this->providers[$type]);
34 }
35
36 public function getProvider(string $type): PlaceholderProvider
37 {
38 if (!$this->supports($type)) {
39 throw new InvalidArgumentException("Unknown placeholder provider: $type");
40 }
41
42 return $this->providers[$type];
43 }
44 }
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProviderRegistry
Definition: PlaceholderProviderRegistry.php:12
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProviderRegistry\getProvider
getProvider(string $type)
Definition: PlaceholderProviderRegistry.php:36
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProviderRegistry\addProvider
addProvider(string $type, PlaceholderProvider $provider)
Definition: PlaceholderProviderRegistry.php:26
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProviderRegistry\__construct
__construct(array $providers=[])
PlaceholderProviderRegistry constructor.
Definition: PlaceholderProviderRegistry.php:21
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProviderRegistry\supports
supports(string $type)
Definition: PlaceholderProviderRegistry.php:31
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProviderRegistry\$providers
$providers
Definition: PlaceholderProviderRegistry.php:14
eZ\Bundle\EzPublishCoreBundle\Imagine\PlaceholderProvider
Definition: PlaceholderProvider.php:12
eZ\Bundle\EzPublishCoreBundle\Imagine
Definition: AliasCleaner.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.