Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
38 / 38
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
_HtmlXData
100.00% covered (success)
100.00%
38 / 38
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getLocalXCodes
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
1
 getXMessageTemplates
100.00% covered (success)
100.00%
19 / 19
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            InvalidNumberOfParametersException::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        ];
41    }
42
43    public function getXMessageTemplates(): array
44    {
45        return [
46            AttributeNotAllowedException::class => 'Attribute ${attributeDefId} is not permitted inside a(n) ${elementDefId} element.',
47            InvalidDefinitionsFileException::class => '${filePath} either does not exist or contains invalid definitions',
48            InvalidAttributeIdNameException::class => 'Attribute id ${badName} is not a valid identifier for an attributeArrayElement id.',
49            InvalidAttributeValueException::class => 'Error trying to set attributeArrayElement ${attributeName} to invalid value [${badValue}].',
50            InvalidAttributeValueTesterNameException::class => '${attributeValueTesterDefId} is not a valid value tester definition id',
51            InvalidCustomDataNameException::class => 'Invalid custom data name [${badName}] - must be only lower case letters.',
52            DTOInvalidPropertyValueException::class => 'DTO ${className} error - cannot assign value ${value} to property ${propertyName}',
53            InvalidEventNameException::class => '${eventName} is not a valid event id.',
54            InvalidNumberOfParametersException::class => 'Invalid number of parameters: expected ${expectedNumberOfParameters}',
55            ChildElementNotAllowedException::class => 'Invalid subtag [${badDefId}] - either the subtag is invalid or it is a duplicate of a required subtag (see HtmlConfig).',
56            InvalidTagNameException::class => '${elementDefId} is not a valid element id.',
57            MakeDefinitionException::class => 'Unable to make definition of type ${type}.',
58            DuplicateDefinitionIdException::class => 'Definition id ${defId} already exists in the container.',
59            InvalidDefinitionIdException::class => 'No definition exists for defId ${defId}.',
60            DTOMissingPropertyException::class => 'DTO ${className} constructor is missing the following properties: [${missingPropertyNames}].',
61            DTOExtraPropertyException::class => 'DTO ${className} constructor was passed an extra property [${extraPropertyName}]',
62            InvalidAttributeException::class => '${badAttributeName} is not a valid attributeArrayElement.',
63        ];
64    }
65}