Skip to content

Commit d749912

Browse files
Merge branch '6.4' into 7.0
* 6.4: fix typo Add types to private and internal properties [Workflow] Cleaning code [Scheduler] Fix NPE in debug:scheduler command
2 parents cdf762e + 58f074a commit d749912

File tree

7 files changed

+29
-51
lines changed

7 files changed

+29
-51
lines changed

Internal/ComposerPlugin.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,10 @@
2727
*/
2828
class ComposerPlugin implements PluginInterface, EventSubscriberInterface
2929
{
30-
/**
31-
* @var Composer
32-
*/
33-
private $composer;
30+
private Composer $composer;
31+
private IOInterface $io;
3432

35-
/**
36-
* @var IOInterface
37-
*/
38-
private $io;
39-
40-
private static $activated = false;
33+
private static bool $activated = false;
4134

4235
public function activate(Composer $composer, IOInterface $io): void
4336
{

Resolver/ClosureResolver.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818
*/
1919
class ClosureResolver implements ResolverInterface
2020
{
21-
private $closure;
22-
private $arguments;
23-
24-
public function __construct(\Closure $closure, \Closure $arguments)
25-
{
26-
$this->closure = $closure;
27-
$this->arguments = $arguments;
21+
public function __construct(
22+
private readonly \Closure $closure,
23+
private readonly \Closure $arguments,
24+
) {
2825
}
2926

3027
public function resolve(): array

Runner/ClosureRunner.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
*/
1919
class ClosureRunner implements RunnerInterface
2020
{
21-
private $closure;
22-
23-
public function __construct(\Closure $closure)
24-
{
25-
$this->closure = $closure;
21+
public function __construct(
22+
private readonly \Closure $closure,
23+
) {
2624
}
2725

2826
public function run(): int

Runner/Symfony/ConsoleApplicationRunner.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,12 @@
2222
*/
2323
class ConsoleApplicationRunner implements RunnerInterface
2424
{
25-
private $application;
26-
private $defaultEnv;
27-
private $input;
28-
private $output;
29-
30-
public function __construct(Application $application, ?string $defaultEnv, InputInterface $input, OutputInterface $output = null)
31-
{
32-
$this->application = $application;
33-
$this->defaultEnv = $defaultEnv;
34-
$this->input = $input;
35-
$this->output = $output;
25+
public function __construct(
26+
private readonly Application $application,
27+
private readonly ?string $defaultEnv,
28+
private readonly InputInterface $input,
29+
private readonly ?OutputInterface $output = null,
30+
) {
3631
}
3732

3833
public function run(): int

Runner/Symfony/HttpKernelRunner.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@
2121
*/
2222
class HttpKernelRunner implements RunnerInterface
2323
{
24-
private $kernel;
25-
private $request;
26-
27-
public function __construct(HttpKernelInterface $kernel, Request $request)
28-
{
29-
$this->kernel = $kernel;
30-
$this->request = $request;
24+
public function __construct(
25+
private readonly HttpKernelInterface $kernel,
26+
private readonly Request $request,
27+
) {
3128
}
3229

3330
public function run(): int

Runner/Symfony/ResponseRunner.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
*/
2020
class ResponseRunner implements RunnerInterface
2121
{
22-
private $response;
23-
24-
public function __construct(Response $response)
25-
{
26-
$this->response = $response;
22+
public function __construct(
23+
private readonly Response $response,
24+
) {
2725
}
2826

2927
public function run(): int

SymfonyRuntime.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ class_exists(MissingDotenv::class, false) || class_exists(Dotenv::class) || clas
6666
*/
6767
class SymfonyRuntime extends GenericRuntime
6868
{
69-
private $input;
70-
private $output;
71-
private $console;
72-
private $command;
69+
private readonly ArgvInput $input;
70+
private readonly ConsoleOutput $output;
71+
private readonly Application $console;
72+
private readonly Command $command;
7373

7474
/**
7575
* @param array {
@@ -165,7 +165,7 @@ public function getRunner(?object $application): RunnerInterface
165165
return new ConsoleApplicationRunner($application, $defaultEnv, $this->getInput(), $output);
166166
}
167167

168-
if ($this->command) {
168+
if (isset($this->command)) {
169169
$this->getInput()->bind($this->command->getDefinition());
170170
}
171171

@@ -203,7 +203,7 @@ protected static function register(GenericRuntime $runtime): GenericRuntime
203203

204204
private function getInput(): ArgvInput
205205
{
206-
if (null !== $this->input) {
206+
if (isset($this->input)) {
207207
return $this->input;
208208
}
209209

0 commit comments

Comments
 (0)