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

ArrayWeMap::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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 ArrayWeMap
16
 * @package PhpSchool\CallableFunctions\Exercise
17
 */
18 View Code Duplication
class ArrayWeMap extends AbstractExercise implements ExerciseInterface, CliExercise, FunctionRequirementsExerciseCheck
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
{
20
    /**
21
     * @return string
22
     */
23
    public function getName()
24
    {
25
        return 'Array we map!';
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getDescription()
32
    {
33
        return 'Exercice with array map';
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    public function getArgs()
40
    {
41
        return ['Sarra', 'Helen', 'Anas'];
42
    }
43
44
    /**
45
     * @return ExerciseType
46
     */
47
    public function getType()
48
    {
49
        return ExerciseType::CLI();
50
    }
51
52
    /**
53
     * @return string[]
54
     */
55
    public function getRequiredFunctions()
56
    {
57
        return ['array_map'];
58
    }
59
60
    /**
61
     * @return string[]
62
     */
63
    public function getBannedFunctions()
64
    {
65
        return [];
66
    }
67
68
    /**
69
     * @param ExerciseDispatcher $dispatcher
70
     */
71
    public function configure(ExerciseDispatcher $dispatcher)
72
    {
73
        $dispatcher->requireCheck(FunctionRequirementsCheck::class, $dispatcher::CHECK_AFTER);
74
    }
75
}
76