Conditions | 3 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types=1); |
||
36 | public function setHosts(array $hosts): void |
||
37 | { |
||
38 | $siteId = $this->getSiteId(); |
||
39 | if (!isset($this->configurator->registeredVars['MediaEmbed.sites'][$siteId])) |
||
40 | { |
||
41 | $this->configurator->MediaEmbed->add($siteId); |
||
42 | } |
||
43 | |||
44 | // Remove previously set hosts for this site |
||
45 | $unsetHosts = array_keys( |
||
46 | (array) $this->configurator->registeredVars['MediaEmbed.hosts'], |
||
47 | $siteId, |
||
48 | true |
||
49 | ); |
||
50 | foreach ($unsetHosts as $host) |
||
51 | { |
||
52 | unset($this->configurator->registeredVars['MediaEmbed.hosts'][$host]); |
||
53 | } |
||
54 | |||
55 | $this->addHosts($hosts); |
||
56 | } |
||
57 | } |