DispatchingRuleSet   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A compare() 0 7 3
1
<?php
2
namespace Workana\AsyncJobs\Dispatcher;
3
4
use SplPriorityQueue;
5
6
/**
7
 * @author Carlos Frutos <[email protected]>
8
 */
9
class DispatchingRuleSet extends SplPriorityQueue
10
{
11
    /**
12
     * {@inheritDoc}
13
     */
14
    public function compare($priority1, $priority2) 
15
    { 
16
        if ($priority1 === $priority2) {
17
            return 0;
18
        }
19
        return $priority1 < $priority2 ? -1 : 1; 
20
    }
21
}