Completed
Push — dev ( 088902...57261c )
by Matej
04:35
created

Events   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 3
c 3
b 1
f 1
lcom 0
cbo 0
dl 0
loc 29
ccs 6
cts 8
cp 0.75
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A all() 0 12 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