@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | public function testGetClassConstants() |
177 | 177 | { |
178 | 178 | $this->assertArrayHasKey('TEST_CONSTANT', get_class_constants(static::class)); |
179 | - $this->assertEquals(self::TEST_CONSTANT, get_class_constants(static::class)['TEST_CONSTANT']); |
|
179 | + $this->assertEquals(self::TEST_CONSTANT, get_class_constants(static::class)[ 'TEST_CONSTANT' ]); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | public function testInstanceWithoutConstructor() |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $this->assertInstanceOf(Larapi::class, instance_without_constructor(Larapi::class)); |
185 | 185 | } |
186 | 186 | |
187 | - public function testSplitCapitalStringToUnderscores(){ |
|
187 | + public function testSplitCapitalStringToUnderscores() { |
|
188 | 188 | $this->assertEquals("proxy_uptime_collection", split_caps_to_underscore("ProxyUptimeCollection")); |
189 | 189 | } |
190 | 190 | } |
@@ -69,8 +69,9 @@ |
||
69 | 69 | { |
70 | 70 | $type = $this->getType(); |
71 | 71 | |
72 | - if (in_array($type, $this->types)) |
|
73 | - return "$type-test.stub"; |
|
72 | + if (in_array($type, $this->types)) { |
|
73 | + return "$type-test.stub"; |
|
74 | + } |
|
74 | 75 | |
75 | 76 | throw new Exception("Test type not supported"); |
76 | 77 | } |
@@ -85,7 +85,7 @@ |
||
85 | 85 | protected function setOptions(): array |
86 | 86 | { |
87 | 87 | return [ |
88 | - ['type', $this->types, InputOption::VALUE_OPTIONAL, 'Indicates the type of the test.', $this->types[0]] |
|
88 | + [ 'type', $this->types, InputOption::VALUE_OPTIONAL, 'Indicates the type of the test.', $this->types[ 0 ] ] |
|
89 | 89 | ]; |
90 | 90 | } |
91 | 91 |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | */ |
22 | 22 | protected function getDispatchedEvents(?string $class): array |
23 | 23 | { |
24 | - $events = []; |
|
25 | - Event::assertDispatched($class, function ($event) use (&$events) { |
|
26 | - $events[] = $event; |
|
24 | + $events = [ ]; |
|
25 | + Event::assertDispatched($class, function($event) use (&$events) { |
|
26 | + $events[ ] = $event; |
|
27 | 27 | return true; |
28 | 28 | }); |
29 | 29 | return $events; |
@@ -38,6 +38,6 @@ discard block |
||
38 | 38 | $events = $this->getDispatchedEvents($class); |
39 | 39 | if (empty($events)) |
40 | 40 | return null; |
41 | - return $events[0]; |
|
41 | + return $events[ 0 ]; |
|
42 | 42 | } |
43 | 43 | } |
@@ -36,8 +36,9 @@ |
||
36 | 36 | protected function getFirstDispatchedEvent(?string $class): ResourceGenerationContract |
37 | 37 | { |
38 | 38 | $events = $this->getDispatchedEvents($class); |
39 | - if (empty($events)) |
|
40 | - return null; |
|
39 | + if (empty($events)) { |
|
40 | + return null; |
|
41 | + } |
|
41 | 42 | return $events[0]; |
42 | 43 | } |
43 | 44 | } |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | return [ |
51 | 51 | 'NAMESPACE' => $this->getClassNamespace(), |
52 | 52 | 'CLASS' => $this->getClassName(), |
53 | - 'EVENTNAME' => $this->getModule()->getNamespace() . '\\' . 'Events' . '\\' . $this->getEventName(), |
|
53 | + 'EVENTNAME' => $this->getModule()->getNamespace().'\\'.'Events'.'\\'.$this->getEventName(), |
|
54 | 54 | 'SHORTEVENTNAME' => $this->getEventName() |
55 | 55 | ]; |
56 | 56 | } |
57 | 57 | |
58 | 58 | protected function afterGeneration(): void |
59 | 59 | { |
60 | - $this->info("don't forget to add the listener to " . $this->getEventName()); |
|
60 | + $this->info("don't forget to add the listener to ".$this->getEventName()); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | protected function setOptions(): array |
91 | 91 | { |
92 | 92 | return [ |
93 | - ['event', null, InputOption::VALUE_OPTIONAL, 'What is the name of the event that should be listened on?', null], |
|
94 | - ['queued', null, InputOption::VALUE_OPTIONAL, 'Should the listener be queued?', false], |
|
93 | + [ 'event', null, InputOption::VALUE_OPTIONAL, 'What is the name of the event that should be listened on?', null ], |
|
94 | + [ 'queued', null, InputOption::VALUE_OPTIONAL, 'Should the listener be queued?', false ], |
|
95 | 95 | ]; |
96 | 96 | } |
97 | 97 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | protected function setOptions(): array |
69 | 69 | { |
70 | 70 | return [ |
71 | - ['command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned.', null], |
|
71 | + [ 'command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned.', null ], |
|
72 | 72 | ]; |
73 | 73 | } |
74 | 74 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return $this->getOption('command'); |
81 | 81 | } |
82 | 82 | |
83 | - protected function handleCommandOption($shortcut, $type, $question, $default){ |
|
84 | - return $this->ask('What is the name of the terminal command?',str_replace('command', '', strtolower($this->getModuleName()) . ':' . strtolower($this->getClassName()))); |
|
83 | + protected function handleCommandOption($shortcut, $type, $question, $default) { |
|
84 | + return $this->ask('What is the name of the terminal command?', str_replace('command', '', strtolower($this->getModuleName()).':'.strtolower($this->getClassName()))); |
|
85 | 85 | } |
86 | 86 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function getPath() |
19 | 19 | { |
20 | - return get_foundation_path() . '/Generator/Stubs/' . $this->path; |
|
20 | + return get_foundation_path().'/Generator/Stubs/'.$this->path; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function getName() |
@@ -19,6 +19,6 @@ |
||
19 | 19 | { |
20 | 20 | public function getConsoleCommand() |
21 | 21 | { |
22 | - return $this->getStub()->getOptions()["COMMAND_NAME"]; |
|
22 | + return $this->getStub()->getOptions()[ "COMMAND_NAME" ]; |
|
23 | 23 | } |
24 | 24 | } |
@@ -19,6 +19,6 @@ |
||
19 | 19 | { |
20 | 20 | public function isSynchronous(): bool |
21 | 21 | { |
22 | - return $this->getStub()->getOptions()['sync']; |
|
22 | + return $this->getStub()->getOptions()[ 'sync' ]; |
|
23 | 23 | } |
24 | 24 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | class TestGeneratedEvent extends ResourceGeneratedEvent |
20 | 20 | { |
21 | - public function getType(){ |
|
22 | - return $this->getStub()->getOptions()['TYPE']; |
|
21 | + public function getType() { |
|
22 | + return $this->getStub()->getOptions()[ 'TYPE' ]; |
|
23 | 23 | } |
24 | 24 | } |