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