Completed
Pull Request — master (#18)
by
unknown
06:19
created

CreateSiteCommand::asLaravel()   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 0
1
<?php
2
3
namespace Laravel\Forge\Sites\Commands;
4
5
class CreateSiteCommand extends SiteCommand
6
{
7
    /**
8
     * Set domain name.
9
     *
10
     * @param string $domain
11
     *
12
     * @return static
13
     */
14
    public function identifiedAs(string $domain)
15
    {
16
        return $this->attachPayload('domain', $domain);
17
    }
18
19
    /**
20
     * Indicates that site will be created as General PHP/Laravel Application.
21
     *
22
     * @return static
23
     */
24
    public function asPhp()
25
    {
26
        return $this->attachPayload('project_type', 'php');
27
    }
28
29
    /**
30
     * Identifies which web directory the public app will reside at
31
     *
32
     * @param string $directory
33
     *
34
     * @return static
35
     */
36
    public function withDirectory(string $directory)
37
    {
38
        return $this->attachPayload('directory', $directory);
39
    }
40
41
    /**
42
     * Indicates that site will be created as Static HTML site.
43
     *
44
     * @return static
45
     */
46
    public function asStatic()
47
    {
48
        return $this->attachPayload('project_type', 'html');
49
    }
50
51
    /**
52
     * Indicates that site will be created as Symfony Application.
53
     *
54
     * @return static
55
     */
56
    public function asSymfony()
57
    {
58
        return $this->attachPayload('project_type', 'symfony');
59
    }
60
61
    /**
62
     * Indicates that site will be created as Symfony (Dev) Application.
63
     *
64
     * @return static
65
     */
66
    public function asSymfonyDev()
67
    {
68
        return $this->attachPayload('project_type', 'symfony_dev');
69
    }
70
71
    /**
72
     * Alias for "asPhp" method.
73
     *
74
     * @return static
75
     */
76
    public function asLaravel()
77
    {
78
        return $this->asPhp();
79
    }
80
81
    /**
82
     * Alias for "asPhp" method.
83
     *
84
     * @return static
85
     */
86
    public function asGeneralPhp()
87
    {
88
        return $this->asPhp();
89
    }
90
91
    /**
92
     * Alias for "asStatic" method.
93
     *
94
     * @return static
95
     */
96
    public function asHtml()
97
    {
98
        return $this->asStatic();
99
    }
100
}
101