Total Complexity | 6 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 72.72% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | final class OscaroteroEmbedAdapter implements EmbedAdapterInterface |
||
22 | { |
||
23 | private EmbedLib $embedLib; |
||
24 | |||
25 | 2 | public function __construct(?EmbedLib $embed = null) |
|
26 | { |
||
27 | 2 | if ($embed === null) { |
|
28 | if (! \class_exists(EmbedLib::class)) { |
||
29 | throw new MissingDependencyException('The embed/embed package is not installed. Please install it with Composer to use this adapter.'); |
||
30 | } |
||
31 | |||
32 | $embed = new EmbedLib(); |
||
33 | } |
||
34 | |||
35 | 2 | $this->embedLib = $embed; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * {@inheritDoc} |
||
40 | */ |
||
41 | 2 | public function updateEmbeds(array $embeds): void |
|
47 | } |
||
48 | } |
||
51 |