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

orchestral / canvas-core / 7000226342

27 Nov 2023 03:24AM UTC coverage: 86.42% (-7.0%) from 93.443%
7000226342

Pull #9

github

web-flow
Merge 9e45f567e into d4c3325d2
Pull Request #9: Use Laravel Generator Preset

1 of 2 new or added lines in 2 files covered. (50.0%)

70 of 81 relevant lines covered (86.42%)

2.51 hits per line

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

44.44
/src/Commands/GeneratorCommand.php
1
<?php
2

3
namespace Orchestra\Canvas\Core\Commands;
4

5
use Orchestra\Canvas\Core\Concerns;
6
use Orchestra\Canvas\Core\Contracts\GeneratesCode;
7

8
/**
9
 * @property string|null  $name
10
 * @property string|null  $description
11
 */
12
abstract class GeneratorCommand extends \Illuminate\Console\GeneratorCommand implements GeneratesCode
13
{
14
    use Concerns\CodeGenerator;
15
    use Concerns\ResolvesPresetStubsOverrides;
16
    use Concerns\TestGenerator;
17
    use Concerns\UsesGeneratorOverrides;
18

19
    /**
20
     * Execute the console command.
21
     *
22
     * @return bool|null
23
     *
24
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
25
     */
26
    #[\Override]
27
    public function handle()
28
    {
29
        return $this->generateCode() ? self::SUCCESS : self::FAILURE;
6✔
30
    }
31

32
    /**
33
     * Get the destination class path.
34
     *
35
     * @param  string  $name
36
     * @return string
37
     */
38
    #[\Override]
39
    protected function getPath($name)
40
    {
41
        return $this->getPathUsingCanvas($name);
6✔
42
    }
43

44
    /**
45
     * Qualify the given model class base name.
46
     *
47
     * @return string
48
     */
49
    #[\Override]
50
    protected function qualifyModel(string $model)
51
    {
52
        return $this->qualifyModelUsingCanvas($model);
×
53
    }
54

55
    /**
56
     * Get the root namespace for the class.
57
     *
58
     * @return string
59
     */
60
    #[\Override]
61
    protected function rootNamespace()
62
    {
63
        return $this->rootNamespaceUsingCanvas();
6✔
64
    }
65

66
    /**
67
     * Get the model for the default guard's user provider.
68
     *
69
     * @return string|null
70
     */
71
    #[\Override]
72
    protected function userProviderModel()
73
    {
74
        return $this->userProviderModelUsingCanvas();
4✔
75
    }
76

77
    /**
78
     * Get the first view directory path from the application configuration.
79
     *
80
     * @return string
81
     */
82
    #[\Override]
83
    protected function viewPath($path = '')
84
    {
85
        return $this->viewPathUsingCanvas($path);
×
86
    }
87

88
    /**
89
     * Get a list of possible model names.
90
     *
91
     * @return array<int, string>
92
     */
93
    #[\Override]
94
    protected function possibleModels()
95
    {
96
        return $this->possibleModelsUsingCanvas();
×
97
    }
98

99
    /**
100
     * Get a list of possible event names.
101
     *
102
     * @return array<int, string>
103
     */
104
    #[\Override]
105
    protected function possibleEvents()
106
    {
107
        return $this->possibleEventsUsingCanvas();
×
108
    }
109

110
    /**
111
     * Resolve the fully-qualified path to the stub.
112
     *
113
     * @param  string  $stub
114
     * @return string
115
     */
116
    protected function resolveStubPath($stub)
117
    {
NEW
118
        return $this->resolveStubPathUsingCanvas($stub);
×
119
    }
120
}
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