Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
83.33% |
5 / 6 |
|
75.00% |
3 / 4 |
CRAP | |
0.00% |
0 / 1 |
| Video | |
83.33% |
5 / 6 |
|
75.00% |
3 / 4 |
5.12 | |
0.00% |
0 / 1 |
| control | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| supportedTranslateModes | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| value | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| structure | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Field; |
| 6 | |
| 7 | use Cosray\Schema\TranslateMode; |
| 8 | use Cosray\Value; |
| 9 | |
| 10 | class Video extends File |
| 11 | { |
| 12 | public function control(): Control |
| 13 | { |
| 14 | return Control::video(); |
| 15 | } |
| 16 | |
| 17 | /** @return list<TranslateMode> */ |
| 18 | protected function supportedTranslateModes(): array |
| 19 | { |
| 20 | return [TranslateMode::Symmetric, TranslateMode::Asymmetric]; |
| 21 | } |
| 22 | |
| 23 | public function value(): Value\Video |
| 24 | { |
| 25 | return new Value\Video($this->owner, $this, $this->valueContext); |
| 26 | } |
| 27 | |
| 28 | public function structure(mixed $value = null): array |
| 29 | { |
| 30 | if ($this->isAsymmetricallyTranslated()) { |
| 31 | return $this->getTranslatableFileStructure('video', $value); |
| 32 | } |
| 33 | |
| 34 | return $this->getFileStructure('video', $value); |
| 35 | } |
| 36 | } |