File tree Expand file tree Collapse file tree 4 files changed +40
-70
lines changed Expand file tree Collapse file tree 4 files changed +40
-70
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Jaspaul \LaravelRollout \Console ;
4
4
5
- use Opensoft \Rollout \Rollout ;
6
- use Illuminate \Console \Command ;
7
5
use Jaspaul \LaravelRollout \Helpers \User ;
8
6
9
- class AddUserCommand extends Command
7
+ class AddUserCommand extends RolloutCommand
10
8
{
11
9
/**
12
10
* The name and signature of the console command.
@@ -22,26 +20,6 @@ class AddUserCommand extends Command
22
20
*/
23
21
protected $ description = 'Adds the provided user id to the feature. ' ;
24
22
25
- /**
26
- * The rollout service.
27
- *
28
- * @var \Opensoft\Rollout\Rollout
29
- */
30
- protected $ rollout ;
31
-
32
- /**
33
- * Initialize our create feature command with an instance of the rollout
34
- * service.
35
- *
36
- * @param \Opensoft\Rollout\Rollout $rollout
37
- * The rollout service.
38
- */
39
- public function __construct (Rollout $ rollout )
40
- {
41
- parent ::__construct ();
42
- $ this ->rollout = $ rollout ;
43
- }
44
-
45
23
/**
46
24
* Creates the provided feature.
47
25
*
Original file line number Diff line number Diff line change 2
2
3
3
namespace Jaspaul \LaravelRollout \Console ;
4
4
5
- use Opensoft \Rollout \Rollout ;
6
- use Illuminate \Console \Command ;
7
-
8
- class CreateCommand extends Command
5
+ class CreateCommand extends RolloutCommand
9
6
{
10
7
/**
11
8
* The name and signature of the console command.
@@ -21,26 +18,6 @@ class CreateCommand extends Command
21
18
*/
22
19
protected $ description = 'Creates a feature with the provided name. ' ;
23
20
24
- /**
25
- * The rollout service.
26
- *
27
- * @var \Opensoft\Rollout\Rollout
28
- */
29
- protected $ rollout ;
30
-
31
- /**
32
- * Initialize our create feature command with an instance of the rollout
33
- * service.
34
- *
35
- * @param \Opensoft\Rollout\Rollout $rollout
36
- * The rollout service.
37
- */
38
- public function __construct (Rollout $ rollout )
39
- {
40
- parent ::__construct ();
41
- $ this ->rollout = $ rollout ;
42
- }
43
-
44
21
/**
45
22
* Creates the provided feature.
46
23
*
Original file line number Diff line number Diff line change 2
2
3
3
namespace Jaspaul \LaravelRollout \Console ;
4
4
5
- use Opensoft \Rollout \Rollout ;
6
- use Illuminate \Console \Command ;
7
5
use Jaspaul \LaravelRollout \FeaturePresenter ;
8
6
9
- class ListCommand extends Command
7
+ class ListCommand extends RolloutCommand
10
8
{
11
9
/**
12
10
* The name and signature of the console command.
@@ -22,32 +20,13 @@ class ListCommand extends Command
22
20
*/
23
21
protected $ description = 'Returns a list of all the features that have been created. ' ;
24
22
25
- /**
26
- * The rollout service.
27
- *
28
- * @var \Opensoft\Rollout\Rollout
29
- */
30
- protected $ rollout ;
31
-
32
- /**
33
- * Initialize our list features command with an instance of the rollout service.
34
- *
35
- * @param \Opensoft\Rollout\Rollout $rollout
36
- * The rollout service.
37
- */
38
- public function __construct (Rollout $ rollout )
39
- {
40
- parent ::__construct ();
41
- $ this ->rollout = $ rollout ;
42
- }
43
-
44
23
/**
45
24
* Returns the feature rows.
46
25
*
47
26
* @return array
48
27
* A list of features.
49
28
*/
50
- public function getRows () : array
29
+ protected function getRows () : array
51
30
{
52
31
$ rows = [];
53
32
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Jaspaul \LaravelRollout \Console ;
4
+
5
+ use Opensoft \Rollout \Rollout ;
6
+ use Illuminate \Console \Command ;
7
+
8
+ abstract class RolloutCommand extends Command
9
+ {
10
+ /**
11
+ * The rollout service.
12
+ *
13
+ * @var \Opensoft\Rollout\Rollout
14
+ */
15
+ protected $ rollout ;
16
+
17
+ /**
18
+ * Initialize our create feature command with an instance of the rollout
19
+ * service.
20
+ *
21
+ * @param \Opensoft\Rollout\Rollout $rollout
22
+ * The rollout service.
23
+ */
24
+ public function __construct (Rollout $ rollout )
25
+ {
26
+ parent ::__construct ();
27
+ $ this ->rollout = $ rollout ;
28
+ }
29
+
30
+ /**
31
+ * Performs the logic for the command.
32
+ *
33
+ * @return void
34
+ */
35
+ abstract public function handle ();
36
+ }
You can’t perform that action at this time.
0 commit comments