Completed
Push — master ( 2ff2f4...64e7ee )
by Aydin
02:08
created

BabySteps   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getDescription() 0 4 1
A getArgs() 0 11 2
1
<?php
2
3
namespace PhpSchool\LearnYouPhp\Exercise;
4
5
use PhpSchool\PhpWorkshop\Exercise\AbstractExercise;
6
use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface;
7
use PhpSchool\PhpWorkshop\ExerciseCheck\StdOutExerciseCheck;
8
9
/**
10
 * Class BabySteps
11
 * @package PhpSchool\LearnYouPhp\Exercise
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class BabySteps extends AbstractExercise implements ExerciseInterface, StdOutExerciseCheck
15
{
16
17
    /**
18
     * @return string
19
     */
20
    public function getName()
21
    {
22
        return 'Baby Steps';
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getDescription()
29
    {
30
        return 'Simple Addition';
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function getArgs()
37
    {
38
        $numArgs = rand(0, 10);
39
40
        $args = [];
41
        for ($i = 0; $i < $numArgs; $i ++) {
42
            $args[] = rand(0, 100);
43
        }
44
45
        return $args;
46
    }
47
}
48