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

orchestral / canvas / 6224137920

18 Sep 2023 02:42PM UTC coverage: 90.984% (+1.0%) from 89.945%
6224137920

push

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

603 of 603 new or added lines in 34 files covered. (100.0%)

555 of 610 relevant lines covered (90.98%)

24.54 hits per line

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

83.33
/src/Console/ScopeMakeCommand.php
1
<?php
2

3
namespace Orchestra\Canvas\Console;
4

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

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

19
    /**
20
     * Create a new controller creator command instance.
21
     *
22
     * @return void
23
     */
24
    public function __construct(Filesystem $files)
25
    {
26
        parent::__construct($files);
1✔
27

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

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

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

54
    /**
55
     * Get the destination class path.
56
     *
57
     * @param  string  $name
58
     * @return string
59
     */
60
    protected function getPath($name)
61
    {
62
        return $this->getPathUsingCanvas($name);
1✔
63
    }
64

65
    /**
66
     * Get the root namespace for the class.
67
     *
68
     * @return string
69
     */
70
    protected function rootNamespace()
71
    {
72
        return $this->rootNamespaceUsingCanvas();
1✔
73
    }
74
}
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