@@ -25,24 +25,24 @@ abstract class AbstractSchedulerCommands implements SchedulerCommandsInterface
25
25
*
26
26
* @var string|null
27
27
*/
28
- protected $ kernelEnvironment ;
28
+ protected ? string $ kernelEnvironment ;
29
29
30
30
/**
31
31
* Directory to store FFMpeg logs
32
32
*
33
33
* @var string
34
34
*/
35
- protected $ logDirectoryFFMpeg = '' ;
35
+ protected string $ logDirectoryFFMpeg = '' ;
36
36
37
37
/**
38
38
* @var bool Can the input be looped
39
39
*/
40
- protected $ looping = false ;
40
+ protected bool $ looping = false ;
41
41
42
42
/**
43
43
* @var string
44
44
*/
45
- protected $ rootDir ;
45
+ protected string $ rootDir ;
46
46
47
47
/**
48
48
* SchedulerCommands constructor.
@@ -60,7 +60,7 @@ public function __construct(Kernel $kernel)
60
60
*
61
61
* @throws \Exception
62
62
*/
63
- public function startProcess ($ input , $ output , $ metadata ): string
63
+ public function startProcess (string $ input , string $ output , array $ metadata ): string
64
64
{
65
65
$ meta = '' ;
66
66
$ metadata ['env ' ] = $ this ->getKernelEnvironment ();
@@ -76,7 +76,7 @@ public function startProcess($input, $output, $metadata): string
76
76
* {@inheritdoc}
77
77
* @throws LiveBroadcastException
78
78
*/
79
- public function stopProcess ($ pid ): string
79
+ public function stopProcess (int $ pid ): string
80
80
{
81
81
throw new LiveBroadcastException ('stopProcess Cannot be called on the abstract class ' );
82
82
}
@@ -93,7 +93,7 @@ public function getRunningProcesses(): array
93
93
/**
94
94
* {@inheritdoc}
95
95
*/
96
- public function getProcessId ($ processString ): ?int
96
+ public function getProcessId (string $ processString ): ?int
97
97
{
98
98
$ pid = [];
99
99
preg_match ('/^\s*([\d]+)/ ' , $ processString , $ pid );
@@ -107,7 +107,7 @@ public function getProcessId($processString): ?int
107
107
/**
108
108
* {@inheritdoc}
109
109
*/
110
- public function getBroadcastId ($ processString ): ?int
110
+ public function getBroadcastId (string $ processString ): ?int
111
111
{
112
112
$ value = $ this ->getMetadataValue ($ processString , self ::METADATA_BROADCAST );
113
113
@@ -117,7 +117,7 @@ public function getBroadcastId($processString): ?int
117
117
/**
118
118
* {@inheritdoc}
119
119
*/
120
- public function getChannelId ($ processString ): ?int
120
+ public function getChannelId (string $ processString ): ?int
121
121
{
122
122
$ value = $ this ->getMetadataValue ($ processString , self ::METADATA_CHANNEL );
123
123
@@ -127,7 +127,7 @@ public function getChannelId($processString): ?int
127
127
/**
128
128
* {@inheritdoc}
129
129
*/
130
- public function getEnvironment ($ processString ): ?string
130
+ public function getEnvironment (string $ processString ): ?string
131
131
{
132
132
return $ this ->getMetadataValue ($ processString , self ::METADATA_ENVIRONMENT );
133
133
}
@@ -143,9 +143,9 @@ public function getKernelEnvironment(): ?string
143
143
/**
144
144
* @param string $directory
145
145
*/
146
- public function setFFMpegLogDirectory ($ directory ): void
146
+ public function setFFMpegLogDirectory (string $ directory ): void
147
147
{
148
- if (null === $ directory || !is_writable ($ directory )) {
148
+ if (!is_writable ($ directory )) {
149
149
return ;
150
150
}
151
151
@@ -155,9 +155,9 @@ public function setFFMpegLogDirectory($directory): void
155
155
/**
156
156
* @param bool $looping
157
157
*/
158
- public function setLooping ($ looping ): void
158
+ public function setLooping (bool $ looping ): void
159
159
{
160
- $ this ->looping = ( bool ) $ looping ;
160
+ $ this ->looping = $ looping ;
161
161
}
162
162
163
163
/**
@@ -179,7 +179,7 @@ public function isLooping(): bool
179
179
*
180
180
* @throws \Exception
181
181
*/
182
- protected function execStreamCommand ($ input , $ output , $ meta ): string
182
+ protected function execStreamCommand (string $ input , string $ output , string $ meta ): string
183
183
{
184
184
$ logFile = '/dev/null ' ;
185
185
$ loop = '' ;
@@ -205,7 +205,7 @@ protected function execStreamCommand($input, $output, $meta): string
205
205
*
206
206
* @return array
207
207
*/
208
- protected function readMetadata ($ processString ): array
208
+ protected function readMetadata (string $ processString ): array
209
209
{
210
210
$ metadata = [];
211
211
$ processMetadata = [];
@@ -227,7 +227,7 @@ protected function readMetadata($processString): array
227
227
*
228
228
* @return mixed
229
229
*/
230
- private function getMetadataValue ($ processString , $ metadataKey )
230
+ private function getMetadataValue (string $ processString , string $ metadataKey )
231
231
{
232
232
$ metadata = $ this ->readMetadata ($ processString );
233
233
0 commit comments