Completed
Push — master ( 9aea2e...2f8383 )
by Nastasia
02:07
created

ArrayWeFilter::getBannedFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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 View Code Duplication
class ArrayWeFilter extends AbstractExercise implements
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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, $dispatcher::CHECK_AFTER);
77
    }
78
}
79