8000 [Refactor] Continue to support command fire method · Naxon/laravel-json-api@c343560 · GitHub
[go: up one dir, main page]

Skip to content

Commit c343560

Browse files
committed
[Refactor] Continue to support command fire method
1 parent fb13eac commit c343560

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Console/Commands/AbstractGeneratorCommand.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ public function __construct(Filesystem $files, Repository $apiRepository)
8888
$this->stubsDirectory = __DIR__ . '/../../../stubs';
8989
}
9090

91+
/**
92+
* @return bool|null
93+
* @todo this maintains support for Laravel 5.4 - remove when no longer supporting 5.4
94+
*/
95+
public function fire()
96+
{
97+
if (!$this->apiRepository->exists($api = $this->argument('api'))) {
98+
$this->error("JSON API '$api' does not exist.");
99+
return 1;
100+
}
101+
102+
return (parent::fire() !== false) ? 0 : 1;
103+
}
104+
91105
/**
92106
* @return bool|null
93107
*/

0 commit comments

Comments
 (0)
0