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

ConfigsManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A update() 0 6 1
1
<?php
2
3
namespace Laravel\Forge\Configs;
4
5
use Laravel\Forge\Configs\Commands\GetConfigFileCommand;
6
use Laravel\Forge\Configs\Commands\UpdateConfigFileCommand;
7
8
class ConfigsManager
9
{
10
    /**
11
     * Initialize new get configuration command.
12
     *
13
     * @param string $name
14
     *
15
     * @return \Laravel\Forge\Configs\Commands\GetConfigFileCommand
16
     */
17
    public function get(string $name)
18
    {
19
        return (new GetConfigFileCommand())->usingFile($name);
20
    }
21
22
    /**
23
     * Initialize new update configuration command.
24
     *
25
     * @param string $name
26
     * @param string $content
27
     *
28
     * @return \Laravel\Forge\Configs\Commands\UpdateConfigFileCommand
29
     */
30
    public function update(string $name, string $content)
31
    {
32
        return (new UpdateConfigFileCommand())
33
            ->usingFile($name)
34
            ->withPayload(['content' => $content]);
35
    }
36
}
37