Skip to content

Commit

Permalink
Merge pull request #140 from Soean/php84
Browse files Browse the repository at this point in the history
PHP 8.4: Explicit nullable type
  • Loading branch information
gmazzap authored Jan 15, 2025
2 parents 63ef1e9 + 4f9e70f commit 6ff8cab
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Config/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function promise(callable $provider): Result
* @param mixed $value
* @param \Throwable|null $error
*/
private function __construct($value = null, \Throwable $error = null)
private function __construct($value = null, ?\Throwable $error = null)
{
if ($value instanceof Result) {
$this->value = $value->value;
Expand Down
2 changes: 1 addition & 1 deletion src/Env/WordPressEnvBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public static function loadedVars(): array
/**
* @param Dotenv|null $dotenv
*/
public function __construct(Dotenv $dotenv = null)
public function __construct(?Dotenv $dotenv = null)
{
$this->dotenv = $dotenv;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Util/WpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function normalize(string $version): string
public function __construct(
PackageFinder $packageFinder,
Io $io,
string $fallbackVersion = null
?string $fallbackVersion = null
) {

$this->packageFinder = $packageFinder;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Cli/PhpToolProcessFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private function assertProcessWorks(PhpToolProcess $process): void
* @return PhpToolProcessFactory
*/
private function factoryPhpToolProcessFactory(
UrlDownloader $urlDownloader = null
?UrlDownloader $urlDownloader = null
): PhpToolProcessFactory {

$composer = $this->factoryComposer();
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Cli/WpCliToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function testCheckPharError(): void
* @param string|null $cwd
* @return WpCliTool
*/
private function factoryTool(string $cwd = null): WpCliTool
private function factoryTool(?string $cwd = null): WpCliTool
{
return new WpCliTool(
new Config(
Expand Down
8 changes: 4 additions & 4 deletions tests/src/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected function factoryComposerIo(
* @return Paths
*/
protected function factoryPaths(
string $cwd = null,
?string $cwd = null,
int $verbosity = OutputInterface::VERBOSITY_NORMAL,
string $input = '',
array $extra = []
Expand Down Expand Up @@ -171,7 +171,7 @@ protected function factoryPaths(
protected function factoryComposerConfig(
string $input = '',
int $verbosity = OutputInterface::VERBOSITY_NORMAL,
string $cwd = null
?string $cwd = null
): Composer\Config {

return Composer\Factory::createConfig(
Expand All @@ -194,7 +194,7 @@ protected function factoryComposer(): Composer\Composer
* @param string $cwd
* @return SystemProcess
*/
protected function factorySystemProcess(string $cwd = null): SystemProcess
protected function factorySystemProcess(?string $cwd = null): SystemProcess
{
return new SystemProcess(
$this->factoryPaths($cwd),
Expand All @@ -206,7 +206,7 @@ protected function factorySystemProcess(string $cwd = null): SystemProcess
* @param string $cwd
* @return PhpProcess
*/
protected function factoryPhpProcess(string $cwd = null): PhpProcess
protected function factoryPhpProcess(?string $cwd = null): PhpProcess
{
$php = (new PhpExecutableFinder())->find() ?: 'php';

Expand Down
2 changes: 1 addition & 1 deletion tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function factoryLocator(...$objects): Util\Locator
* @param array|null $extra
* @return Util\Paths
*/
protected function factoryPaths(array $extra = null): Util\Paths
protected function factoryPaths(?array $extra = null): Util\Paths
{
$root = $this->fixturesPath() . '/paths-root';

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Util/RequirementsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function testConfigsLoadedFromDefaultFileAreMerged()
* @param string $customRoot
* @return mixed
*/
private function executeExtractConfig(array $extra, string $customRoot = null): array
private function executeExtractConfig(array $extra, ?string $customRoot = null): array
{
$tester = \Closure::bind(
function (string $rootPath) use ($extra): array {
Expand Down

0 comments on commit 6ff8cab

Please sign in to comment.