ArrayWeFilter   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 7
c 3
b 0
f 0
lcom 0
cbo 2
dl 0
loc 61
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getDescription() 0 4 1
A getArgs() 0 4 1
A getType() 0 4 1
A getRequiredFunctions() 0 4 1
A getBannedFunctions() 0 4 1
A configure() 0 4 1
1
<?php
2
3
namespace PhpSchool\CallableFunctions\Exercise;
4
5
use PhpSchool\PhpWorkshop\Check\FunctionRequirementsCheck;
6
use PhpSchool\PhpWorkshop\Exercise\AbstractExercise;
7
use PhpSchool\PhpWorkshop\Exercise\CliExercise;
8
use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface;
9
use PhpSchool\PhpWorkshop\Exercise\ExerciseType;
10
use PhpSchool\PhpWorkshop\ExerciseCheck\FunctionRequirementsExerciseCheck;
11
use PhpSchool\PhpWorkshop\ExerciseCheck\StdOutExerciseCheck;
12
use PhpSchool\PhpWorkshop\ExerciseDispatcher;
13
14
/**
15
 * Class ArrayWeFilter
16
 * @package PhpSchool\CallableFunctions\Exercise
17
 */
18
class ArrayWeFilter extends AbstractExercise implements
19
    ExerciseInterface,
20
    CliExercise,
21
    FunctionRequirementsExerciseCheck
22
{
23
    /**
24
     * @return string
25
     */
26
    public function getName()
27
    {
28
        return 'Array we filter!';
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getDescription()
35
    {
36
        return 'Exercice with array filter';
37
    }
38
39
    /**
40
     * @return array
41
     */
42
    public function getArgs()
43
    {
44
        return [1, 2, 3, 4, 5];
45
    }
46
47
    /**
48
     * @return ExerciseType
49
     */
50
    public function getType()
51
    {
52
        return ExerciseType::CLI();
53
    }
54
55
    /**
56
     * @return string[]
57
     */
58
    public function getRequiredFunctions()
59
    {
60
        return ['array_filter'];
61
    }
62
63
    /**
64
     * @return string[]
65
     */
66
    public function getBannedFunctions()
67
    {
68
        return [];
69
    }
70
71
    /**
72
     * @param ExerciseDispatcher $dispatcher
73
     */
74
    public function configure(ExerciseDispatcher $dispatcher)
75
    {
76
        $dispatcher->requireCheck(FunctionRequirementsCheck::class);
77
    }
78
}
79