Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Environment/Native.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
final class Native implements EnvironmentInterface
{
public function __construct(
private array $values = []
private array $values = [],
) {
$this->values = $values + $_ENV + $_SERVER;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/UnsupportedVersionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class UnsupportedVersionException extends VersionCheckerException
public function __construct(
string $message,
private string $installed,
private string $requested
private string $requested,
) {
parent::__construct($message);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Version/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class Comparator implements ComparatorInterface
{
private VersionParser $parser;

public function __construct(VersionParser $parser = null)
public function __construct(?VersionParser $parser = null)
{
$this->parser = $parser ?? new VersionParser();
}
Expand All @@ -24,7 +24,7 @@ public function greaterThan(string $requested, string $installed): bool
{
return SemverComparator::greaterThanOrEqualTo(
$this->parser->normalize($installed),
$this->parser->normalize($requested)
$this->parser->normalize($requested),
);
}

Expand All @@ -36,7 +36,7 @@ public function lessThan(string $requested, string $installed): bool
{
return SemverComparator::lessThanOrEqualTo(
$this->parser->normalize($installed),
$this->parser->normalize($requested)
$this->parser->normalize($requested),
);
}

Expand All @@ -48,7 +48,7 @@ public function equal(string $requested, string $installed): bool
{
return SemverComparator::equalTo(
$this->parser->normalize($installed),
$this->parser->normalize($requested)
$this->parser->normalize($requested),
);
}
}
8 changes: 4 additions & 4 deletions src/Version/Installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ final class Installed implements InstalledInterface
* @param non-empty-string $executablePath
*/
public function __construct(
ProcessInterface $process = null,
EnvironmentInterface $environment = null,
private string $executablePath = './rr'
?ProcessInterface $process = null,
?EnvironmentInterface $environment = null,
private string $executablePath = './rr',
) {
$this->process = $process ?? new Process();
$this->environment = $environment ?? new Native();
Expand Down Expand Up @@ -86,7 +86,7 @@ private function getVersionFromConsoleCommand(): ?string
' If RoadRunner is installed in a different path, pass the correct `executablePath` parameter to the' .
' `%s` class constructor.',
$this->executablePath,
self::class
self::class,
));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Version/Required.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class Required implements RequiredInterface

private PackageInterface $package;

public function __construct(PackageInterface $package = null)
public function __construct(?PackageInterface $package = null)
{
$this->package = $package ?? new Package();
}
Expand Down
14 changes: 7 additions & 7 deletions src/VersionChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ final class VersionChecker
private ComparatorInterface $comparator;

public function __construct(
InstalledInterface $installedVersion = null,
RequiredInterface $requiredVersion = null,
ComparatorInterface $comparator = null
?InstalledInterface $installedVersion = null,
?RequiredInterface $requiredVersion = null,
?ComparatorInterface $comparator = null,
) {
$this->installedVersion = $installedVersion ?? new Installed();
$this->requiredVersion = $requiredVersion ?? new Required();
Expand All @@ -46,7 +46,7 @@ public function greaterThan(?string $version = null): void
if (empty($version)) {
throw new RequiredVersionException(
'Unable to determine required RoadRunner version.' .
' Please specify the required version in the `$version` parameter.'
' Please specify the required version in the `$version` parameter.',
);
}

Expand All @@ -56,7 +56,7 @@ public function greaterThan(?string $version = null): void
throw new UnsupportedVersionException($this->getFormattedMessage(
'Installed RoadRunner version `%s` not supported. Requires version `%s` or higher.',
$installedVersion,
$version
$version,
), $installedVersion, $version);
}
}
Expand All @@ -75,7 +75,7 @@ public function lessThan(string $version): void
throw new UnsupportedVersionException($this->getFormattedMessage(
'Installed RoadRunner version `%s` not supported. Requires version `%s` or lower.',
$installedVersion,
$version
$version,
), $installedVersion, $version);
}
}
Expand All @@ -94,7 +94,7 @@ public function equal(string $version): void
throw new UnsupportedVersionException($this->getFormattedMessage(
'Installed RoadRunner version `%s` not supported. Requires version `%s`.',
$installedVersion,
$version
$version,
), $installedVersion, $version);
}
}
Expand Down
Loading