CrossTableException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fileNotFoundOrNotReadable() 0 4 1
A errorReadingCsvLine() 0 6 1
A errorParsingCsvLine() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Datapp\TableauExport;
6
7
/**
8
 * @author Manuel Dimmler
9
 */
10
class CrossTableException extends \RuntimeException
11
{
12
13
    const FILE_NOT_FOUND_OR_NOT_READABLE = 1;
14
    const ERROR_READING_CSV_LINE = 2;
15
    const ERROR_PARSING_CSV_LINE = 3;
16
17 1
    public static function fileNotFoundOrNotReadable(string $fileName): self
18
    {
19 1
        return new self(sprintf('file "%s" not found or not readable', $fileName), self::FILE_NOT_FOUND_OR_NOT_READABLE);
20
    }
21
22
    public static function errorReadingCsvLine(): self
23
    {
24
        // @codeCoverageIgnoreStart
25
        return new self('error reading csv line', self::ERROR_READING_CSV_LINE);
26
        // @codeCoverageIgnoreEnd
27
    }
28
29 1
    public static function errorParsingCsvLine(): self
30
    {
31 1
        return new self('error parsing csv line', self::ERROR_PARSING_CSV_LINE);
32
    }
33
}
34