| @@ 10-36 (lines=27) @@ | ||
| 7 | ||
| 8 | use UCD\Infrastructure\Repository\CharacterRepository\XMLRepository\ElementParser\Properties\GeneralParser; |
|
| 9 | ||
| 10 | class NonCharacterParser implements CodepointAwareParser |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var GeneralParser |
|
| 14 | */ |
|
| 15 | private $generalParser; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @param GeneralParser $generalParser |
|
| 19 | */ |
|
| 20 | public function __construct(GeneralParser $generalParser) |
|
| 21 | { |
|
| 22 | $this->generalParser = $generalParser; |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @param \DOMElement $element |
|
| 27 | * @param Codepoint $codepoint |
|
| 28 | * @return NonCharacter |
|
| 29 | */ |
|
| 30 | public function parseElement(\DOMElement $element, Codepoint $codepoint) |
|
| 31 | { |
|
| 32 | $general = $this->generalParser->parseElement($element, $codepoint); |
|
| 33 | ||
| 34 | return new NonCharacter($codepoint, $general); |
|
| 35 | } |
|
| 36 | } |
|
| @@ 10-36 (lines=27) @@ | ||
| 7 | ||
| 8 | use UCD\Infrastructure\Repository\CharacterRepository\XMLRepository\ElementParser\Properties\GeneralParser; |
|
| 9 | ||
| 10 | class SurrogateParser implements CodepointAwareParser |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var GeneralParser |
|
| 14 | */ |
|
| 15 | private $generalParser; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @param GeneralParser $generalParser |
|
| 19 | */ |
|
| 20 | public function __construct(GeneralParser $generalParser) |
|
| 21 | { |
|
| 22 | $this->generalParser = $generalParser; |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @param \DOMElement $element |
|
| 27 | * @param Codepoint $codepoint |
|
| 28 | * @return Surrogate |
|
| 29 | */ |
|
| 30 | public function parseElement(\DOMElement $element, Codepoint $codepoint) |
|
| 31 | { |
|
| 32 | $general = $this->generalParser->parseElement($element, $codepoint); |
|
| 33 | ||
| 34 | return new Surrogate($codepoint, $general); |
|
| 35 | } |
|
| 36 | } |
|