-
Notifications
You must be signed in to change notification settings - Fork 5
/
NovaeZCloudinaryBundle.php
47 lines (40 loc) · 1.3 KB
/
NovaeZCloudinaryBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Novactive eZ Cloudinary Bundle.
*
* @package Novactive\Bundle\eZCloudinary
*
* @author Novactive <novacloudinarybundle@novactive.com>
* @copyright 2015 Novactive
* @license https://github.com/Novactive/NovaeZCloudinaryBundle/blob/master/LICENSE MIT Licence
*/
declare(strict_types=1);
namespace Novactive\Bundle\eZCloudinaryBundle;
use LogicException;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class NovaeZCloudinaryBundle extends Bundle
{
public function getContainerExtension(): ?ExtensionInterface
{
if (null === $this->extension) {
$extension = $this->createContainerExtension();
if (null !== $extension) {
if (!$extension instanceof ExtensionInterface) {
throw new LogicException(
sprintf(
'Extension %s must implement '.ExtensionInterface::class,
\get_class($extension)
)
);
}
$this->extension = $extension;
} else {
$this->extension = false;
}
}
if ($this->extension) {
return $this->extension;
}
}
}