Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| Iframe | |
100.00% |
6 / 6 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| control | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| value | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| structure | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Field; |
| 6 | |
| 7 | use Cosray\Value\Iframe as IframeValue; |
| 8 | use Override; |
| 9 | |
| 10 | class Iframe extends Text implements Capability\Multiline |
| 11 | { |
| 12 | use Capability\IsMultiline; |
| 13 | |
| 14 | #[Override] |
| 15 | public function control(): Control |
| 16 | { |
| 17 | return Control::iframe(); |
| 18 | } |
| 19 | |
| 20 | #[Override] |
| 21 | public function value(): IframeValue |
| 22 | { |
| 23 | return new IframeValue($this->owner, $this, $this->valueContext); |
| 24 | } |
| 25 | |
| 26 | #[Override] |
| 27 | public function structure(mixed $value = null): array |
| 28 | { |
| 29 | $result = $this->getTranslatableStructure('iframe', $value); |
| 30 | $result['meta']['iframeWidth'] = [self::NEUTRAL_LOCALE => '100%']; |
| 31 | $result['meta']['iframeHeight'] = [self::NEUTRAL_LOCALE => '75%']; |
| 32 | |
| 33 | return $result; |
| 34 | } |
| 35 | } |