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

orchestral / canvas / 9563332959

18 Jun 2024 10:23AM UTC coverage: 94.815%. Remained the same
9563332959

push

github

crynobone
wip

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

640 of 675 relevant lines covered (94.81%)

24.78 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/10.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
    #[\Override]
41
    public function handle()
42
    {
43
        /** @phpstan-ignore return.type */
44
        return $this->generateCode() ? self::SUCCESS : self::FAILURE;
7✔
45
    }
46

47
    /**
48
     * Get the destination class path.
49
     *
50
     * @param  string  $name
51
     * @return string
52
     */
53
    #[\Override]
54
    protected function getPath($name)
55
    {
56
        return $this->getPathUsingCanvas($name);
7✔
57
    }
58

59
    /**
60
     * Get the root namespace for the class.
61
     *
62
     * @return string
63
     */
64
    #[\Override]
65
    protected function rootNamespace()
66
    {
67
        return $this->rootNamespaceUsingCanvas();
7✔
68
    }
69

70
    /**
71
     * Get a list of possible event names.
72
     *
73
     * @return array<int, string>
74
     */
75
    #[\Override]
76
    protected function possibleEvents()
77
    {
78
        return $this->possibleEventsUsingCanvas();
×
79
    }
80
}
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