Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
36 / 36
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
_TreeXData
100.00% covered (success)
100.00%
36 / 36
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getLocalXCodes
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
1 / 1
1
 getXMessageTemplates
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/** @noinspection SpellCheckingInspection */
3
4/**
5 * @author: Doug Wilbourne (dougwilbourne@gmail.com)
6 * @noinspection PhpCSValidationInspection
7 */
8
9declare(strict_types=1);
10
11namespace pvc\struct\tree\err;
12
13use pvc\err\XDataAbstract;
14
15class _TreeXData extends XDataAbstract
16{
17
18    public function getLocalXCodes(): array
19    {
20        return [
21            AlreadySetNodeidException::class => 1001,
22            AlreadySetRootException::class => 1002,
23            ChildCollectionException::class => 1004,
24            CircularGraphException::class => 1005,
25            DeleteInteriorNodeException::class => 1006,
26            InvalidNodeIdException::class => 1008,
27            InvalidValueException::class => 1009,
28            InvalidParentNodeException::class => 1010,
29            InvalidTreeidException::class => 1011,
30            NodeNotInTreeException::class => 1012,
31            NoRootFoundException::class => 1013,
32            RootCannotBeMovedException::class => 1014,
33            SetTreeIdException::class => 1015,
34            NodeNotEmptyHydrationException::class => 1019,
35            TreeNotInitializedException::class => 1021,
36            TreenodeFactoryNotInitializedException::class => 1022,
37        ];
38    }
39
40    public function getXMessageTemplates(): array
41    {
42        return [
43            AlreadySetNodeidException::class => 'nodeid ${nodeid} already exists in the tree.',
44            AlreadySetRootException::class => 'set root error - root of tree is already set.',
45            ChildCollectionException::class => 'Child collection supplied to the constructor must be empty.',
46            CircularGraphException::class => 'circular graph error: nodeid ${nodeid} cannot be its own ancestor.',
47            DeleteInteriorNodeException::class => 'cannot delete nodeid ${nodeid} - must be a leaf.',
48            InvalidNodeIdException::class => 'Invalid nodeid ${nodeid} - must be an integer >= 0.',
49            InvalidValueException::class => 'Invalid node payload.',
50            InvalidParentNodeException::class => 'Parentid ${parentid} does not exist in the current tree.',
51            InvalidTreeidException::class => 'Invalid treeid ${treeid} - must be an integer >= 0',
52            NodeNotInTreeException::class => 'treeid ${treeid} does not contain nodeid ${nodeid}.',
53            NoRootFoundException::class => 'no root node found in tree node payload object array.',
54            RootCannotBeMovedException::class => 'The root node cannot be moved to another place in the tree.',
55            SetTreeIdException::class => 'cannot set the treeid on a tree which is not empty.',
56            NodeNotEmptyHydrationException::class => 'cannot hydrate a non-empty node - nodeid ${nodeId} is already set.',
57            TreeNotInitializedException::class => 'cannot use Tree until it has been initialized.',
58            TreenodeFactoryNotInitializedException::class => 'cannot use TreeNodeFactory until it has been initialized.',
59        ];
60    }
61}