Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
CommonHandler
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
4
100.00% covered (success)
100.00%
1 / 1
 apply
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
3
 properties
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Cosray\Field\Schema;
6
7use Cosray\Exception\RuntimeException;
8use Cosray\Field\Blocks;
9use Cosray\Field\Field;
10use Cosray\Schema\Common;
11use Override;
12
13final class CommonHandler extends Handler
14{
15    #[Override]
16    public function apply(object $meta, Field $field): void
17    {
18        if ($field instanceof Blocks && $meta instanceof Common) {
19            $field->common(...$meta->types);
20
21            return;
22        }
23
24        throw new RuntimeException($this->capabilityErrorMessage($field, Blocks::class));
25    }
26
27    #[Override]
28    public function properties(object $meta, Field $field): array
29    {
30        return [];
31    }
32}