Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 47a2b5a

Browse files
committed
adjust delete commands to the new order of params
1 parent f9a8b16 commit 47a2b5a

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

src/Commands/FeatureDeleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class FeatureDeleteCommand extends SymfonyCommand
5656
public function fire()
5757
{
5858
try {
59-
$service = studly_case($this->argument('service'));
59+
$service = Str::service($this->argument('service'));
6060
$title = $this->parseName($this->argument('feature'));
6161

6262
if (!$this->exists($feature = $this->findFeaturePath($service, $title))) {
@@ -79,8 +79,8 @@ public function fire()
7979
protected function getArguments()
8080
{
8181
return [
82-
['service', InputArgument::REQUIRED, 'The service in which the feature should be deleted from.'],
8382
['feature', InputArgument::REQUIRED, 'The feature\'s name.'],
83+
['service', InputArgument::OPTIONAL, 'The service from which the feature should be deleted.'],
8484
];
8585
}
8686

src/Commands/JobDeleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function fire()
7878
public function getArguments()
7979
{
8080
return [
81-
['domain', InputArgument::REQUIRED, 'The domain from which the job will be deleted.'],
8281
['job', InputArgument::REQUIRED, 'The job\'s name.'],
82+
['domain', InputArgument::REQUIRED, 'The domain from which the job will be deleted.'],
8383
];
8484
}
8585

src/Commands/ServiceDeleteCommand.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Lucid\Console\Commands;
1313

14+
use Lucid\Console\Str;
1415
use Lucid\Console\Finder;
1516
use Lucid\Console\Command;
1617
use Lucid\Console\Filesystem;
@@ -71,18 +72,22 @@ protected function getStub()
7172
*/
7273
public function fire()
7374
{
75+
if ($this->isMicroservice()) {
76+
return $this->error('This functionality is disabled in a Microservice');
77+
}
78+
7479
try {
75-
$name = ucfirst($this->argument('name'));
80+
$name = Str::service($this->argument('name'));
7681

7782
if (!$this->exists($service = $this->findServicePath($name))) {
78-
$this->error('Service '.$name.' cannot be found.');
79-
} else {
80-
$this->delete($service);
83+
return $this->error('Service '.$name.' cannot be found.');
84+
}
8185

82-
$this->info('Service <comment>'.$name.'</comment> deleted successfully.'."\n");
86+
$this->delete($service);
8387

84-
$this->info('Please remove your registered service providers, if any.');
85-
}
88+
$this->info('Service <comment>'.$name.'</comment> deleted successfully.'."\n");
89+
90+
$this->info('Please remove your registered service providers, if any.');
8691
} catch (\Exception $e) {
8792
dd($e->getMessage(), $e->getFile(), $e->getLine());
8893
}

0 commit comments

Comments
 (0)