Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| Semantics | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| addAnnotation | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getAnnotation | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAnnotations | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace PhpOffice\Math\Element; |
| 6 | |
| 7 | class Semantics extends AbstractGroupElement |
| 8 | { |
| 9 | /** |
| 10 | * @var array<string, string> |
| 11 | */ |
| 12 | protected $annotations = []; |
| 13 | |
| 14 | public function addAnnotation(string $encoding, string $annotation): self |
| 15 | { |
| 16 | $this->annotations[$encoding] = $annotation; |
| 17 | |
| 18 | return $this; |
| 19 | } |
| 20 | |
| 21 | public function getAnnotation(string $encoding): ?string |
| 22 | { |
| 23 | return $this->annotations[$encoding] ?? null; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @return array<string, string> |
| 28 | */ |
| 29 | public function getAnnotations(): array |
| 30 | { |
| 31 | return $this->annotations; |
| 32 | } |
| 33 | } |