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;
11
12final class CommonHandler extends Handler
13{
14    public function apply(object $meta, Field $field): void
15    {
16        if ($field instanceof Blocks && $meta instanceof Common) {
17            $field->common(...$meta->types);
18
19            return;
20        }
21
22        throw new RuntimeException($this->capabilityErrorMessage($field, Blocks::class));
23    }
24
25    public function properties(object $meta, Field $field): array
26    {
27        return [];
28    }
29}