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

ArrayWeReduce::getRequiredFunctions()   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 ArrayWeReduce
16
 * @package PhpSchool\CallableFunctions\Exercise
17
 */
18 View Code Duplication
class ArrayWeReduce 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 reduce!';
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getDescription()
35
    {
36
        return 'Exercice with array reduce';
37
    }
38
39
    /**
40
     * @return array
41
     */
42
    public function getArgs()
43
    {
44
        return [1, 2, 3];
45
    }
46
47
    /**
48
     * @return ExerciseType
49
     */
50
    public function getType()
51
    {
52
        return ExerciseType::CLI();
53
    }
54
55
56
    /**
57
     * @return string[]
58
     */
59
    public function getRequiredFunctions()
60
    {
61
        return ['array_reduce'];
62
    }
63
64
    /**
65
     * @return string[]
66
     */
67
    public function getBannedFunctions()
68
    {
69
        return [];
70
    }
71
72
    /**
73
     * @param ExerciseDispatcher $dispatcher
74
     */
75
    public function configure(ExerciseDispatcher $dispatcher)
76
    {
77
        $dispatcher->requireCheck(FunctionRequirementsCheck::class, $dispatcher::CHECK_AFTER);
78
    }
79
}
80