Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SameNameChildNotPermitted | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| test | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace pvc\html\rules\content_rules\not_permitted; |
| 4 | |
| 5 | use pvc\html\rules\AbstractRule; |
| 6 | use pvc\interfaces\html\content_model\ContentPermission; |
| 7 | use pvc\interfaces\html\dom\DomNodeInterface; |
| 8 | use pvc\interfaces\html\rules\ContentRuleInterface; |
| 9 | |
| 10 | class SameNameChildNotPermitted extends AbstractRule implements ContentRuleInterface |
| 11 | { |
| 12 | |
| 13 | public function test(DomNodeInterface $content): ContentPermission |
| 14 | { |
| 15 | return ($content->getDomElement()->getName() === $content->getDomElement()->getName()) ? |
| 16 | ContentPermission::DENIED : |
| 17 | ContentPermission::NOT_APPLICABLE; |
| 18 | } |
| 19 | } |