Passed
Push — master ( 35ee53...f51ed5 )
by Smoren
01:55
created

ErrorsLevelMask::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Smoren\Schemator\Structs;
4
5
use Smoren\BitmapTools\Interfaces\BitmapInterface;
6
use Smoren\BitmapTools\Models\Bitmap;
7
use Smoren\Schemator\Exceptions\SchematorException;
8
9
/**
10
 * Class ErrorsLevelMask
11
 * @author Smoren <[email protected]>
12
 */
13
class ErrorsLevelMask extends Bitmap
14
{
15
    /**
16
     * Creates bitmap of all errors
17
     * @return BitmapInterface
18
     */
19
    public static function all(): BitmapInterface
20
    {
21
        return new static(static::create([
22
            SchematorException::FILTER_NOT_FOUND,
23
            SchematorException::FILTER_ERROR,
24
            SchematorException::CANNOT_GET_VALUE,
25
            SchematorException::UNSUPPORTED_SOURCE_TYPE,
26
            SchematorException::UNSUPPORTED_KEY_TYPE,
27
            SchematorException::UNSUPPORTED_FILTER_CONFIG_TYPE,
28
        ])->getValue());
29
    }
30
31
    /**
32
     * Creates bitmap of default errors
33
     * @return BitmapInterface
34
     */
35
    public static function default(): BitmapInterface
36
    {
37
        return static::create([
38
            SchematorException::FILTER_NOT_FOUND,
39
            SchematorException::UNSUPPORTED_SOURCE_TYPE,
40
            SchematorException::UNSUPPORTED_KEY_TYPE,
41
            SchematorException::UNSUPPORTED_FILTER_CONFIG_TYPE,
42
        ]);
43
    }
44
45
    /**
46
     * Creates bitmap of no errors
47
     * @return BitmapInterface
48
     */
49
    public static function nothing(): BitmapInterface
50
    {
51
        return static::create([]);
52
    }
53
}
54