• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orchestral / canvas-core / 6217080730

18 Sep 2023 01:19AM UTC coverage: 90.909% (+4.8%) from 86.066%
6217080730

Pull #7

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Pull Request #7: Use `Illuminate\Console\GeneratorCommand`

30 of 30 new or added lines in 4 files covered. (100.0%)

30 of 33 relevant lines covered (90.91%)

1.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.74
/src/Presets/Laravel.php
1
<?php
2

3
namespace Orchestra\Canvas\Core\Presets;
4

5
class Laravel extends Preset
6
{
7
    /**
8
     * Preset name.
9
     *
10
     * @return string
11
     */
12
    public function name()
13
    {
14
        return 'laravel';
2✔
15
    }
16

17
    /**
18
     * Get the path to the base working directory.
19
     *
20
     * @return string
21
     */
22
    public function basePath()
23
    {
24
        return $this->app->basePath();
1✔
25
    }
26

27
    /**
28
     * Get the path to the source directory.
29
     *
30
     * @return string
31
     */
32
    public function sourcePath()
33
    {
34
        return $this->app->basePath('app');
1✔
35
    }
36

37
    /**
38
     * Get the path to the testing directory.
39
     *
40
     * @return string
41
     */
42
    public function testingPath()
43
    {
44
        return $this->app->basePath('tests');
1✔
45
    }
46

47
    /**
48
     * Get the path to the resource directory.
49
     *
50
     * @return string
51
     */
52
    public function resourcePath()
53
    {
54
        return $this->app->resourcePath();
1✔
55
    }
56

57
    /**
58
     * Get the path to the view directory.
59
     *
60
     * @return string
61
     */
62
    public function viewPath()
63
    {
64
        return $this->app['config']['view.paths'][0] ?? $this->app->resourcePath('views');
1✔
65
    }
66

67
    /**
68
     * Get the path to the factory directory.
69
     *
70
     * @return string
71
     */
72
    public function factoryPath()
73
    {
74
        return $this->app->databasePath('factories');
1✔
75
    }
76

77
    /**
78
     * Get the path to the migration directory.
79
     *
80
     * @return string
81
     */
82
    public function migrationPath()
83
    {
84
        return $this->app->databasePath('migrations');
1✔
85
    }
86

87
    /**
88
     * Get the path to the seeder directory.
89
     */
90
    public function seederPath(): string
91
    {
92
        if (is_dir($seederPath = $this->app->databasePath('seeds'))) {
1✔
93
            return $seederPath;
×
94
        }
95

96
        return $this->app->databasePath('seeders');
1✔
97
    }
98

99
    /**
100
     * Preset namespace.
101
     *
102
     * @return string
103
     */
104
    public function rootNamespace()
105
    {
106
        return $this->app->getNamespace();
1✔
107
    }
108

109
    /**
110
     * Command namespace.
111
     *
112
     * @return string
113
     */
114
    public function commandNamespace()
115
    {
116
        return "{$this->rootNamespace()}Console\Commands\\";
1✔
117
    }
118

119
    /**
120
     * Model namespace.
121
     *
122
     * @return string
123
     */
124
    public function modelNamespace()
125
    {
126
        return is_dir("{$this->sourcePath()}/Models") ? "{$this->rootNamespace()}Models\\" : $this->rootNamespace();
1✔
127
    }
128

129
    /**
130
     * Provider namespace.
131
     *
132
     * @return string
133
     */
134
    public function providerNamespace()
135
    {
136
        return "{$this->rootNamespace()}Providers\\";
1✔
137
    }
138

139
    /**
140
     * Testing namespace.
141
     *
142
     * @return string
143
     */
144
    public function testingNamespace()
145
    {
146
        return 'Tests\\';
1✔
147
    }
148

149
    /**
150
     * Database factory namespace.
151
     *
152
     * @return string
153
     */
154
    public function factoryNamespace()
155
    {
156
        return 'Database\Factories\\';
1✔
157
    }
158

159
    /**
160
     * Database seeder namespace.
161
     *
162
     * @return string
163
     */
164
    public function seederNamespace()
165
    {
166
        return 'Database\Seeders\\';
1✔
167
    }
168

169
    /**
170
     * Preset has custom stub path.
171
     *
172
     * @return bool
173
     */
174
    public function hasCustomStubPath()
175
    {
176
        return true;
1✔
177
    }
178
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc