Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
80.00% |
8 / 10 |
|
80.00% |
8 / 10 |
CRAP | |
0.00% |
0 / 1 |
| FieldOwner | |
80.00% |
8 / 10 |
|
80.00% |
8 / 10 |
10.80 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| uid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| locale | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| defaultLocale | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| locales | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| origin | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| config | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| assets | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| paths | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| create | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Node; |
| 6 | |
| 7 | use Cosray\Assets\Repository; |
| 8 | use Cosray\Config; |
| 9 | use Cosray\Context; |
| 10 | use Cosray\Field\Owner; |
| 11 | use Cosray\Locale; |
| 12 | use Cosray\Locales; |
| 13 | use Override; |
| 14 | |
| 15 | class FieldOwner implements Owner |
| 16 | { |
| 17 | public function __construct( |
| 18 | private readonly Context $context, |
| 19 | private readonly string $nodeUid, |
| 20 | ) {} |
| 21 | |
| 22 | #[Override] |
| 23 | public function uid(): string |
| 24 | { |
| 25 | return $this->nodeUid; |
| 26 | } |
| 27 | |
| 28 | #[Override] |
| 29 | public function locale(): Locale |
| 30 | { |
| 31 | return $this->context->locale(); |
| 32 | } |
| 33 | |
| 34 | #[Override] |
| 35 | public function defaultLocale(): Locale |
| 36 | { |
| 37 | return $this->context->defaultLocale(); |
| 38 | } |
| 39 | |
| 40 | #[Override] |
| 41 | public function locales(): Locales |
| 42 | { |
| 43 | return $this->context->locales(); |
| 44 | } |
| 45 | |
| 46 | #[Override] |
| 47 | public function origin(): string |
| 48 | { |
| 49 | return $this->context->origin(); |
| 50 | } |
| 51 | |
| 52 | #[Override] |
| 53 | public function config(): Config |
| 54 | { |
| 55 | return $this->context->config; |
| 56 | } |
| 57 | |
| 58 | #[Override] |
| 59 | public function assets(): Repository |
| 60 | { |
| 61 | return $this->context->assets(); |
| 62 | } |
| 63 | |
| 64 | #[Override] |
| 65 | public function paths(): UrlPaths |
| 66 | { |
| 67 | return $this->context->paths(); |
| 68 | } |
| 69 | |
| 70 | #[Override] |
| 71 | public function create(string $class, array $types = []): object |
| 72 | { |
| 73 | return $this->context->create($class, $types); |
| 74 | } |
| 75 | } |