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

orchestral / canvas / 6457019917

09 Oct 2023 01:03PM UTC coverage: 90.985% (+0.001%) from 90.984%
6457019917

push

github

crynobone
Merge branch '8.x'

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

136 of 136 new or added lines in 15 files covered. (100.0%)

656 of 721 relevant lines covered (90.98%)

27.57 hits per line

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

83.33
/src/Console/ListenerMakeCommand.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\TestGenerator;
8
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides;
9
use Symfony\Component\Console\Attribute\AsCommand;
10

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

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

30
        $this->addGeneratorPresetOptions();
7✔
31
    }
32

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

45
    /**
46
     * Get the destination class path.
47
     *
48
     * @param  string  $name
49
     * @return string
50
     */
51
    protected function getPath($name)
52
    {
53
        return $this->getPathUsingCanvas($name);
7✔
54
    }
55

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

66
    /**
67
     * Get a list of possible event names.
68
     *
69
     * @return array<int, string>
70
     */
71
    protected function possibleEvents()
72
    {
73
        return $this->possibleEventsUsingCanvas();
×
74
    }
75
}
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