@@ -9,45 +9,29 @@ class BackgroundCommand
99{
1010 /**
1111 * The artisan command.
12- *
13- * @var string
1412 */
15- private $ command ;
13+ private string $ command ;
1614
1715 /**
1816 * The command which should be executed before.
19- *
20- * @var string
2117 */
22- private $ before ;
18+ private string $ before ;
2319
2420 /**
2521 * The command which should be executed after.
26- *
27- * @var string
2822 */
29- private $ after ;
23+ private string $ after ;
3024
3125 /**
3226 * Create background command by the given parameters.
33- *
34- * @param string $command
35- * @param string $before
36- * @param string $after
37- * @return \Illuminated\Helpers\Artisan\BackgroundCommand
3827 */
39- public static function factory (string $ command , string $ before = '' , string $ after = '' )
28+ public static function factory (string $ command , string $ before = '' , string $ after = '' ): self
4029 {
4130 return new self ($ command , $ before , $ after );
4231 }
4332
4433 /**
4534 * Create a new instance of the background command.
46- *
47- * @param string $command
48- * @param string $before
49- * @param string $after
50- * @return void
5135 */
5236 public function __construct (string $ command , string $ before = '' , string $ after = '' )
5337 {
@@ -58,10 +42,8 @@ public function __construct(string $command, string $before = '', string $after
5842
5943 /**
6044 * Run the command in background.
61- *
62- * @return void
6345 */
64- public function run ()
46+ public function run (): void
6547 {
6648 $ command = $ this ->composeCommand ();
6749
@@ -74,10 +56,8 @@ public function run()
7456
7557 /**
7658 * Compose the command.
77- *
78- * @return string
7959 */
80- protected function composeCommand ()
60+ protected function composeCommand (): string
8161 {
8262 return collect ()
8363 ->when ($ this ->before , function (Collection $ collection ) {
@@ -92,20 +72,16 @@ protected function composeCommand()
9272
9373 /**
9474 * Get the path to PHP executable.
95- *
96- * @return string
9775 */
98- protected function getPhpExecutable ()
76+ protected function getPhpExecutable (): string
9977 {
10078 return (new PhpExecutableFinder )->find ();
10179 }
10280
10381 /**
10482 * Get the path to artisan.
105- *
106- * @return string
10783 */
108- protected function getArtisan ()
84+ protected function getArtisan (): string
10985 {
11086 return defined ('ARTISAN_BINARY ' ) ? ARTISAN_BINARY : 'artisan ' ;
11187 }
0 commit comments