Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit e8e3c81

Browse files
committed
Use command methods rather than signature for arguments and options
1 parent 623d14e commit e8e3c81

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

src/Commands/Import.php

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Adldap\Models\User;
66
use Adldap\Laravel\Traits\ImportsUsers;
77
use Illuminate\Console\Command;
8+
use Symfony\Component\Console\Input\InputArgument;
9+
use Symfony\Component\Console\Input\InputOption;
810

911
class Import extends Command
1012
{
@@ -15,17 +17,14 @@ class Import extends Command
1517
*
1618
* @var string
1719
*/
18-
protected $signature = 'adldap:import
19-
{user?}
20-
{--filter= : A raw filter for limiting users imported.}
21-
{--log=true : Log successful and unsuccessful imported users.}';
20+
protected $name = 'adldap:import';
2221

2322
/**
2423
* The console command description.
2524
*
2625
* @var string
2726
*/
28-
protected $description = 'Imports users into the local database with a random 16 character hashed password.';
27+
protected $description = 'Imports LDAP users into the local database with a random 16 character hashed password.';
2928

3029
/**
3130
* Execute the console command.
@@ -115,6 +114,32 @@ public function isLogging()
115114
return $this->option('log') == 'true';
116115
}
117116

117+
/**
118+
* Get the console command arguments.
119+
*
120+
* @return array
121+
*/
122+
public function getArguments()
123+
{
124+
return [
125+
['user', InputArgument::OPTIONAL, 'The specific user to import using ANR.'],
126+
];
127+
}
128+
129+
/**
130+
* Get the console command options.
131+
*
132+
* @return array
133+
*/
134+
public function getOptions()
135+
{
136+
return [
137+
['filter', null, InputOption::VALUE_OPTIONAL, 'The raw filter for limiting users imported.'],
138+
139+
['log', true, InputOption::VALUE_OPTIONAL, 'Log successful and unsuccessful imported users.']
140+
];
141+
}
142+
118143
/**
119144
* {@inheritdoc}
120145
*/

0 commit comments

Comments
 (0)