Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
32 / 32
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
_ParserXData
100.00% covered (success)
100.00%
32 / 32
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getLocalXCodes
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
1
 getXMessageTemplates
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * @author: Doug Wilbourne (dougwilbourne@gmail.com)
5 * @noinspection PhpCSValidationInspection
6 */
7declare(strict_types=1);
8
9namespace pvc\parser\err;
10
11use pvc\err\XDataAbstract;
12
13/**
14 * Class _ParserXData
15 */
16class _ParserXData extends XDataAbstract
17{
18
19    public function getLocalXCodes(): array
20    {
21        return [
22            InvalidMsgIdException::class => 1000,
23            InvalidColumnHeadingException::class => 1001,
24            DuplicateColumnHeadingException::class => 1002,
25            InvalidLineTerminationException::class => 1003,
26            InvalidFieldDelimiterException::class => 1004,
27            InvalidFieldEnclosureCharException::class => 1005,
28            InvalidEscapeCharacterException::class => 1006,
29            NonExistentColumnHeadingException::class => 1007,
30            NonExistentFilePathException::class => 1008,
31            InvalidReturnTypeException::class => 1009,
32            InvalidQuerystringSeparatorException::class => 1010,
33            InvalidDateTimeTypeException::class => 1011,
34            OpenFileException::class => 1012,
35            CsvParserException::class => 1013,
36        ];
37    }
38
39    public function getXMessageTemplates(): array
40    {
41        return [
42            InvalidMsgIdException::class => 'msgid ${msgId} not found in messages file / array',
43            InvalidColumnHeadingException::class => 'Invalid column heading.  Must be printable characters',
44            DuplicateColumnHeadingException::class => 'Column headings must be unique - duplicated value \'${heading}\'',
45            InvalidLineTerminationException::class => 'Invalid line termination character(s) specified.  Should be CR or CRLF (Windows).',
46            InvalidFieldDelimiterException::class => 'field delimiter must be a single character and be visible',
47            InvalidFieldEnclosureCharException::class => 'Field enclosure character must be a single character and be visible',
48            InvalidEscapeCharacterException::class => 'Escape character must be a single character',
49            NonExistentColumnHeadingException::class => 'Flag set to get column headings from first row of data but data is empty.',
50            NonExistentFilePathException::class => 'Cannot open file ${filePath}',
51            InvalidDateTimeTypeException::class => 'Invalid Date Type / Time Type specified - see documentation for the php IntlDateFormatter class',
52            InvalidReturnTypeException::class => 'Invalid return type, must be either NumberFormatter::TYPE_INT64, or NumberFormatter::TYPE_DOUBLE',
53            InvalidQuerystringSeparatorException::class => 'Querystring separator cannot be empty.',
54            OpenFileException::class => 'Error trying to open file ${fileName}',
55            CsvParserException::class => 'Error parsing a line in csv file ${fileName}.'
56        ];
57    }
58}