Skip to content

Commit f3ffc83

Browse files
committed
minor #1019 Make implicit nullable types explicit (nicolas-grekas)
This PR was merged into the 1.x branch. Discussion ---------- Make implicit nullable types explicit Commits ------- 1854c96 Make implicit nullable types explicit
2 parents 06b58a5 + 1854c96 commit f3ffc83

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

src/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Cache extends BaseCache
3030
private $downloader;
3131
private $io;
3232

33-
public function setSymfonyRequire(string $symfonyRequire, RootPackageInterface $rootPackage, Downloader $downloader, IOInterface $io = null)
33+
public function setSymfonyRequire(string $symfonyRequire, RootPackageInterface $rootPackage, Downloader $downloader, ?IOInterface $io = null)
3434
{
3535
$this->versionParser = new VersionParser();
3636
$this->symfonyRequire = $symfonyRequire;

src/Command/UpdateRecipesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
262262
return 0;
263263
}
264264

265-
private function getRecipe(PackageInterface $package, string $recipeRef = null, string $recipeVersion = null): ?Recipe
265+
private function getRecipe(PackageInterface $package, ?string $recipeRef = null, ?string $recipeVersion = null): ?Recipe
266266
{
267267
$operation = new InformationOperation($package);
268268
if (null !== $recipeRef) {

src/Configurator/EnvConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private function unconfigurePhpUnit(Recipe $recipe, $vars)
177177
* If $originalValue is passed, and the value contains an expression.
178178
* the $originalValue is used.
179179
*/
180-
private function evaluateValue($value, string $originalValue = null)
180+
private function evaluateValue($value, ?string $originalValue = null)
181181
{
182182
if ('%generate(secret)%' === $value) {
183183
if (null !== $originalValue) {

src/Downloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function getSessionId(): string
101101
return $this->sess;
102102
}
103103

104-
public function setFlexId(string $id = null)
104+
public function setFlexId(?string $id = null)
105105
{
106106
// No-op to support downgrading to v1.12.x
107107
}

src/Flex.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ function ($value) {
584584
$this->finish($rootDir, $originalComposerJsonHash);
585585
}
586586

587-
public function finish(string $rootDir, string $originalComposerJsonHash = null): void
587+
public function finish(string $rootDir, ?string $originalComposerJsonHash = null): void
588588
{
589589
$this->synchronizePackageJson($rootDir);
590590
$this->lock->write();
@@ -934,7 +934,7 @@ private function formatOrigin(Recipe $recipe): string
934934
return sprintf('<info>%s</> (<comment>>=%s</>): From %s', $matches[1], $matches[2], 'auto-generated recipe' === $matches[3] ? '<comment>'.$matches[3].'</>' : $matches[3]);
935935
}
936936

937-
private function shouldRecordOperation(OperationInterface $operation, bool $isDevMode, Composer $composer = null): bool
937+
private function shouldRecordOperation(OperationInterface $operation, bool $isDevMode, ?Composer $composer = null): bool
938938
{
939939
if ($this->dryRun || $this->reinstall) {
940940
return false;

src/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Options
2323
private $writtenFiles = [];
2424
private $io;
2525

26-
public function __construct(array $options = [], IOInterface $io = null)
26+
public function __construct(array $options = [], ?IOInterface $io = null)
2727
{
2828
$this->options = $options;
2929
$this->io = $io;

src/ParallelDownloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function callbackGet($notificationCode, $severity, $message, $messageCode
216216
/**
217217
* {@inheritdoc}
218218
*/
219-
protected function getRemoteContents($originUrl, $fileUrl, $context, array &$responseHeaders = null, $maxFileSize = null)
219+
protected function getRemoteContents($originUrl, $fileUrl, $context, ?array &$responseHeaders = null, $maxFileSize = null)
220220
{
221221
if (isset(self::$cache[$fileUrl])) {
222222
self::$cacheNext = false;

src/ScriptExecutor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ScriptExecutor
3131
private $options;
3232
private $executor;
3333

34-
public function __construct(Composer $composer, IOInterface $io, Options $options, ProcessExecutor $executor = null)
34+
public function __construct(Composer $composer, IOInterface $io, Options $options, ?ProcessExecutor $executor = null)
3535
{
3636
$this->composer = $composer;
3737
$this->io = $io;

src/TruncatedComposerRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class TruncatedComposerRepository extends BaseComposerRepository
2525
{
26-
public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
26+
public function __construct(array $repoConfig, IOInterface $io, Config $config, ?EventDispatcher $eventDispatcher = null, ?RemoteFilesystem $rfs = null)
2727
{
2828
parent::__construct($repoConfig, $io, $config, $eventDispatcher, $rfs);
2929

src/Unpacker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(Composer $composer, PackageResolver $resolver, bool
4242
$this->versionParser = new VersionParser();
4343
}
4444

45-
public function unpack(Operation $op, Result $result = null, &$links = [], bool $devRequire = false): Result
45+
public function unpack(Operation $op, ?Result $result = null, &$links = [], bool $devRequire = false): Result
4646
{
4747
if (null === $result) {
4848
$result = new Result();

0 commit comments

Comments
 (0)