Completed
Push — develop ( b3f423...097e50 )
by
unknown
07:51
created

Recipients::filter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8
 */
9
10
/**
11
 * This Filter calculates the reciptients of the notifications about incoming applications.
12
 */
13
namespace Organizations\Filter;
14
15
16
use Zend\Filter\Exception;
17
use Zend\Filter\FilterInterface;
18
use Jobs\Entity\Job;
19
20
/**
21
 * ${CARET}
22
 * 
23
 * @author Bleek Carsten <[email protected]>
24
 * @todo write test 
25
 */
26
class Recipients implements FilterInterface
27
{
28
    /*
29
     *
30
     * @param  array $value
31
     *
32
     * @throws Exception\RuntimeException If filtering $value is impossible
33
     * @return mixed
34
     */
35
    public function filter($value)
36
    {
37
        if (!$value instanceof Job){
0 ignored issues
show
Unused Code introduced by
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
38
39
        }
40
        $reciptients=[];
41
42
        return $reciptients;
43
    }
44
}
45