Completed
Push — master ( 6f37d5...aba46f )
by Matej
8s
created

Events::all()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Velikonja\LabbyBundle;
4
5
final class Events
6
{
7
    const PRE_SYNC     = 'velikonja_labby.pre_sync';
8
    const POST_SYNC    = 'velikonja_labby.post_sync';
9
    const PRE_SYNC_FS  = 'velikonja_labby.pre_sync.fs';
10
    const POST_SYNC_FS = 'velikonja_labby.post_sync.fs';
11
    const PRE_SYNC_DB  = 'velikonja_labby.pre_sync.db';
12
    const POST_SYNC_DB = 'velikonja_labby.post_sync.db';
13
14
    /**
15
     * Private constructor. This class cannot be instantiated.
16
     */
17
    private function __construct()
18
    {
19
    }
20
21 15
    public static function all()
22
    {
23 15
        $reflection = new \ReflectionClass(get_class());
24 15
        $constants  = array();
25
26
        //search for all constants in this class that start with $prefix
27 15
        foreach ($reflection->getConstants() as $constName => $constValue) {
28 15
            $constants[$constName] = $constValue;
29
        }
30
31 15
        return $constants;
32
    }
33
}
34