| @@ 14-49 (lines=36) @@ | ||
| 11 | * Class MakeConstantYourArrays |
|
| 12 | * @package PhpSchool\Php7Way\Exercise |
|
| 13 | */ |
|
| 14 | class MakeConstantYourArrays extends AbstractExercise implements |
|
| 15 | ExerciseInterface, |
|
| 16 | CliExercise |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @return string |
|
| 20 | */ |
|
| 21 | public function getName() |
|
| 22 | { |
|
| 23 | return 'Make constant your arrays'; |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @return string |
|
| 28 | */ |
|
| 29 | public function getDescription() |
|
| 30 | { |
|
| 31 | return 'Define an array as constant'; |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @return array |
|
| 36 | */ |
|
| 37 | public function getArgs() |
|
| 38 | { |
|
| 39 | return ['A', 'B', 'C']; |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @return ExerciseType |
|
| 44 | */ |
|
| 45 | public function getType() |
|
| 46 | { |
|
| 47 | return ExerciseType::CLI(); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||
| @@ 14-49 (lines=36) @@ | ||
| 11 | * Class NewGenerationBack |
|
| 12 | * @package PhpSchool\Php7Way\Exercise |
|
| 13 | */ |
|
| 14 | class NewGenerationBack extends AbstractExercise implements |
|
| 15 | ExerciseInterface, |
|
| 16 | CliExercise |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @return string |
|
| 20 | */ |
|
| 21 | public function getName() |
|
| 22 | { |
|
| 23 | return 'The new generation is back'; |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @return string |
|
| 28 | */ |
|
| 29 | public function getDescription() |
|
| 30 | { |
|
| 31 | return 'Use generators returning a value'; |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @return array |
|
| 36 | */ |
|
| 37 | public function getArgs() |
|
| 38 | { |
|
| 39 | return [1, 2, 3]; |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @return ExerciseType |
|
| 44 | */ |
|
| 45 | public function getType() |
|
| 46 | { |
|
| 47 | return ExerciseType::CLI(); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||
| @@ 14-49 (lines=36) @@ | ||
| 11 | * Class NullITsNot |
|
| 12 | * @package PhpSchool\Php7Way\Exercise |
|
| 13 | */ |
|
| 14 | class NullItsNot extends AbstractExercise implements |
|
| 15 | ExerciseInterface, |
|
| 16 | CliExercise |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @return string |
|
| 20 | */ |
|
| 21 | public function getName() |
|
| 22 | { |
|
| 23 | return 'Null, it\'s not!'; |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @return string |
|
| 28 | */ |
|
| 29 | public function getDescription() |
|
| 30 | { |
|
| 31 | return 'Use the null coalescing operator to check if the value exists'; |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @return array |
|
| 36 | */ |
|
| 37 | public function getArgs() |
|
| 38 | { |
|
| 39 | return ["FirstArgument"]; |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @return ExerciseType |
|
| 44 | */ |
|
| 45 | public function getType() |
|
| 46 | { |
|
| 47 | return ExerciseType::CLI(); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||
| @@ 14-49 (lines=36) @@ | ||
| 11 | * Class NullItsNull |
|
| 12 | * @package PhpSchool\Php7Way\Exercise |
|
| 13 | */ |
|
| 14 | class NullItsNull extends AbstractExercise implements |
|
| 15 | ExerciseInterface, |
|
| 16 | CliExercise |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @return string |
|
| 20 | */ |
|
| 21 | public function getName() |
|
| 22 | { |
|
| 23 | return 'Null, it\'s null!'; |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @return string |
|
| 28 | */ |
|
| 29 | public function getDescription() |
|
| 30 | { |
|
| 31 | return 'Use the null coalescing operator to check if the value is null'; |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @return array |
|
| 36 | */ |
|
| 37 | public function getArgs() |
|
| 38 | { |
|
| 39 | return ["FirstArgument", "SecondArgument"]; |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @return ExerciseType |
|
| 44 | */ |
|
| 45 | public function getType() |
|
| 46 | { |
|
| 47 | return ExerciseType::CLI(); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||