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

orchestral / canvas / 30921614659

04 Aug 2026 02:57PM UTC coverage: 91.944% (-2.5%) from 94.459%
30921614659

Pull #53

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Pull Request #53: Supports `laravel/doctor`

2 of 17 new or added lines in 2 files covered. (11.76%)

31 existing lines in 11 files now uncovered.

662 of 720 relevant lines covered (91.94%)

35.57 hits per line

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

88.89
/src/Console/PolicyMakeCommand.php
1
<?php
2

3
namespace Orchestra\Canvas\Console;
4

5
use Orchestra\Canvas\Core\Concerns\CodeGenerator;
6
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides;
7
use Symfony\Component\Console\Attribute\AsCommand;
8

9
/**
10
 * @see https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Console/PolicyMakeCommand.php
11
 */
12
#[AsCommand(name: 'make:policy', description: 'Create a new policy class')]
13
class PolicyMakeCommand extends \Illuminate\Foundation\Console\PolicyMakeCommand
14
{
15
    use CodeGenerator;
16
    use UsesGeneratorOverrides;
17

18
    /**
19
     * Configures the current command.
20
     *
21
     * @return void
22
     */
23
    #[\Override]
24
    protected function configure()
25
    {
26
        parent::configure();
3✔
27

28
        $this->addGeneratorPresetOptions();
3✔
29
    }
30

31
    /**
32
     * Execute the console command.
33
     *
34
     * @return bool|null
35
     *
36
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
37
     */
38
    #[\Override]
39
    public function handle()
40
    {
41
        /** @phpstan-ignore return.type */
42
        return $this->generateCode() ? self::SUCCESS : self::FAILURE;
3✔
43
    }
44

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

56
    /**
57
     * Get the destination class path.
58
     *
59
     * @param  string  $name
60
     * @return string
61
     */
62
    #[\Override]
63
    protected function getPath($name)
64
    {
65
        return $this->getPathUsingCanvas($name);
3✔
66
    }
67

68
    /**
69
     * Get the root namespace for the class.
70
     *
71
     * @return string
72
     */
73
    #[\Override]
74
    protected function rootNamespace()
75
    {
76
        return $this->rootNamespaceUsingCanvas();
3✔
77
    }
78

79
    /**
80
     * Get the model for the default guard's user provider.
81
     *
82
     * @return string|null
83
     */
84
    #[\Override]
85
    protected function userProviderModel()
86
    {
87
        /** @var string|null $guard */
88
        $guard = $this->option('guard');
3✔
89

90
        return $this->userProviderModelUsingCanvas($guard);
3✔
91
    }
92

93
    /**
94
     * Get a list of possible model names.
95
     *
96
     * @return array<int, string>
97
     */
98
    #[\Override]
99
    protected function findAvailableModels()
100
    {
UNCOV
101
        return $this->findAvailableModelsUsingCanvas();
×
102
    }
103
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc