PeaceWalk   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 7
c 3
b 0
f 1
lcom 0
cbo 2
dl 0
loc 58
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 PeaceWalk
16
 * @package PhpSchool\CallableFunctions\Exercise
17
 */
18
class PeaceWalk extends AbstractExercise implements ExerciseInterface, CliExercise, FunctionRequirementsExerciseCheck
19
{
20
    /**
21
     * @return string
22
     */
23
    public function getName()
24
    {
25
        return 'Peace walk';
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getDescription()
32
    {
33
        return 'Exercice with array_walk';
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_walk'];
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);
74
    }
75
}
76