Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
44 / 44
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
_HtmlXData
100.00% covered (success)
100.00%
44 / 44
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getLocalXCodes
100.00% covered (success)
100.00%
22 / 22
100.00% covered (success)
100.00%
1 / 1
1
 getXMessageTemplates
100.00% covered (success)
100.00%
22 / 22
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * @author: Doug Wilbourne (dougwilbourne@gmail.com)
5 * @noinspection PhpCSValidationInspection
6 */
7
8declare (strict_types=1);
9
10namespace pvc\html\err;
11
12use pvc\err\XDataAbstract;
13
14/**
15 * Class _HtmlXData
16 */
17class _HtmlXData extends XDataAbstract
18{
19
20    public function getLocalXCodes(): array
21    {
22        return [
23            AttributeNotAllowedException::class             => 1002,
24            InvalidDefinitionsFileException::class          => 1003,
25            InvalidAttributeIdNameException::class          => 1004,
26            InvalidAttributeValueException::class           => 1005,
27            InvalidCustomDataNameException::class           => 1006,
28            InvalidEventNameException::class                => 1007,
29            InvalidNumberOfAttributeValuesException::class  => 1011,
30            ChildElementNotAllowedException::class          => 1012,
31            InvalidTagNameException::class                  => 1013,
32            MakeDefinitionException::class                  => 1016,
33            DTOInvalidPropertyValueException::class         => 1017,
34            InvalidAttributeValueTesterNameException::class => 1018,
35            DuplicateDefinitionIdException::class           => 1019,
36            InvalidDefinitionIdException::class             => 1020,
37            DTOMissingPropertyException::class              => 1021,
38            DTOExtraPropertyException::class                => 1025,
39            InvalidAttributeException::class                => 1026,
40            GetDataTypeException::class => 1027,
41            IncompatibleDomContentException::class => 1028,
42            UnsetAttributeValueException::class             => 1029,
43        ];
44    }
45
46    public function getXMessageTemplates(): array
47    {
48        return [
49            AttributeNotAllowedException::class             => 'Attribute ${attributeDefId} is not permitted inside a(n) ${elementDefId} element.',
50            InvalidDefinitionsFileException::class          => '${filePath} either does not exist or contains invalid definitions',
51            InvalidAttributeIdNameException::class          => 'Attribute id ${badName} is not a valid identifier for an attribute id.',
52            InvalidAttributeValueException::class           => 'Error trying to set attribute ${attributeName} to invalid value [${badValue}].',
53            InvalidAttributeValueTesterNameException::class => '${attributeValueTesterDefId} is not a valid value tester definition id',
54            InvalidCustomDataNameException::class           => 'Invalid custom data name [${badName}] - must be only lower case letters.',
55            DTOInvalidPropertyValueException::class         => 'DTO ${className} error - cannot assign value ${value} to property ${propertyName}',
56            InvalidEventNameException::class                => '${eventName} is not a valid event id.',
57            InvalidNumberOfAttributeValuesException::class  => 'Invalid number of parameters: expected ${expectedNumberOfParameters}',
58            ChildElementNotAllowedException::class          => 'Invalid subtag [${badDefId}] - either the subtag is invalid or it is a duplicate of a required subtag (see HtmlConfig).',
59            InvalidTagNameException::class                  => '${elementDefId} is not a valid element id.',
60            MakeDefinitionException::class                  => 'Unable to make definition of type ${type}.',
61            DuplicateDefinitionIdException::class           => 'Definition id ${defId} already exists in the container.',
62            InvalidDefinitionIdException::class             => 'No definition exists for defId ${defId}.',
63            DTOMissingPropertyException::class              => 'DTO ${className} constructor is missing the following properties: [${missingPropertyNames}].',
64            DTOExtraPropertyException::class                => 'DTO ${className} constructor was passed an extra property [${extraPropertyName}]',
65            InvalidAttributeException::class                => '${badAttributeName} is not a valid attribute.',
66            GetDataTypeException::class                     => 'invalid data tpe encountered while constructing ${name}.',
67            IncompatibleDomContentException::class          => '${domNodeName} cannot be put in this place in the DOM tree',
68            UnsetAttributeValueException::class               => '${attributeName} does not have an assigned value.',
69        ];
70    }
71}