Completed
Push — master ( 3cc9b0...d35865 )
by Timur
02:56
created

RecipesManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
A list() 0 4 1
A get() 0 4 1
1
<?php
2
3
namespace Laravel\Forge\Recipes;
4
5
use Laravel\Forge\Recipes\Commands\GetRecipeCommand;
6
use Laravel\Forge\Recipes\Commands\ListRecipesCommand;
7
use Laravel\Forge\Recipes\Commands\CreateRecipeCommand;
8
9
class RecipesManager
10
{
11
    /**
12
     * Initialize new create recipe command.
13
     *
14
     * @param string $name
15
     * @param string $script
16
     *
17
     * @return \Laravel\Forge\Recipes\Commands\CreateRecipeCommand
18
     */
19
    public function create(string $name, string $script)
20
    {
21
        return (new CreateRecipeCommand())
22
            ->identifiedAs($name)
23
            ->usingScript($script);
24
    }
25
26
    /**
27
     * Initialize new list recipes command.
28
     *
29
     * @return \Laravel\Forge\Recipes\Commands\ListRecipesCommand
30
     */
31
    public function list()
32
    {
33
        return new ListRecipesCommand();
34
    }
35
36
    /**
37
     * Initialize new get recipe command.
38
     *
39
     * @param int $recipeId
40
     *
41
     * @return \Laravel\Forge\Recipes\Commands\GetRecipeCommand
42
     */
43
    public function get(int $recipeId)
44
    {
45
        return (new GetRecipeCommand())->setResourceId($recipeId);
46
    }
47
}
48