File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 5
5
use Exception ;
6
6
use Symfony \Component \Process \Process as SymfonyProcess ;
7
7
8
- class File
8
+ readonly class File
9
9
{
10
10
/**
11
11
* @throws Exception
12
12
*/
13
- public function __construct (private readonly string $ file , private readonly array $ args = [])
13
+ public function __construct (private string $ file , private array $ args = [])
14
14
{
15
15
if (!is_readable ($ this ->file )) {
16
16
throw new Exception ('File ' . $ this ->file . ' does not exists or is not readable! ' );
17
17
}
18
18
}
19
19
20
- public function run (): int
20
+ public function run (): void
21
21
{
22
22
$ template = [PHP_BINARY , $ this ->file , ...$ this ->args , '& ' ];
23
23
@@ -26,6 +26,6 @@ public function run(): int
26
26
}
27
27
28
28
$ process = new SymfonyProcess ($ template );
29
- return $ process ->start ();
29
+ $ process ->start ();
30
30
}
31
31
}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public function __construct()
29
29
/**
30
30
* @throws Exception
31
31
*/
32
- public function send (Closure $ asyncFunction ): int
32
+ public function send (Closure $ asyncFunction ): void
33
33
{
34
34
$ serialized = serialize (new SerializableClosure ($ asyncFunction ));
35
35
$ serializedLength = strlen ($ serialized );
@@ -49,6 +49,6 @@ public function send(Closure $asyncFunction): int
49
49
$ key = array_search ('{length} ' , $ this ->processTemplate );
50
50
$ this ->processTemplate [$ key ] = $ serializedLength ;
51
51
$ process = new SymfonyProcess ($ this ->processTemplate );
52
- return $ process ->run ();
52
+ $ process ->start ();
53
53
}
54
54
}
You can’t perform that action at this time.
0 commit comments