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

ConfigsManager::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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