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

orchestral / canvas / 6334368997

28 Sep 2023 04:02AM UTC coverage: 94.065% (+3.1%) from 90.922%
6334368997

Pull #24

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Pull Request #24: Use Laravel Generator Preset

16 of 16 new or added lines in 2 files covered. (100.0%)

317 of 337 relevant lines covered (94.07%)

30.81 hits per line

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

93.33
/src/Presets/Package.php
1
<?php
2

3
namespace Orchestra\Canvas\Presets;
4

5
use InvalidArgumentException;
6

7
class Package extends Preset
8
{
9
    /**
10
     * Preset name.
11
     */
12
    public function name(): string
13
    {
14
        return 'package';
5✔
15
    }
16

17
    /**
18
     * Get the path to the source directory.
19
     */
20
    public function sourcePath(): string
21
    {
22
        return sprintf(
1✔
23
            '%s/%s',
1✔
24
            $this->basePath(),
1✔
25
            $this->config('paths.src', 'src')
1✔
26
        );
1✔
27
    }
28

29
    /**
30
     * Preset namespace.
31
     */
32
    public function rootNamespace(): string
33
    {
34
        $namespace = trim($this->config['namespace'] ?? '');
10✔
35

36
        if (empty($namespace)) {
10✔
37
            throw new InvalidArgumentException("Please configure namespace configuration under 'canvas.yaml'");
1✔
38
        }
39

40
        return $namespace;
9✔
41
    }
42

43
    /**
44
     * Command namespace.
45
     *
46
     * @return string
47
     */
48
    public function commandNamespace(): string
49
    {
50
        return $this->config('console.namespace', $this->rootNamespace().'\Console');
×
51
    }
52

53
    /**
54
     * Model namespace.
55
     */
56
    public function modelNamespace(): string
57
    {
58
        return $this->config('model.namespace', $this->rootNamespace());
3✔
59
    }
60

61
    /**
62
     * Provider namespace.
63
     */
64
    public function providerNamespace(): string
65
    {
66
        return $this->config('provider.namespace', $this->rootNamespace());
3✔
67
    }
68

69
    /**
70
     * Testing namespace.
71
     */
72
    public function testingNamespace(): string
73
    {
74
        return $this->config('testing.namespace', $this->rootNamespace().'\Tests');
7✔
75
    }
76

77
    /**
78
     * Get custom stub path.
79
     */
80
    public function getCustomStubPath(): ?string
81
    {
82
        return null;
7✔
83
    }
84
}
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

© 2026 Coveralls, Inc