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