Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4: Explicit nullable type #140

Merged
merged 3 commits into from
Jan 15, 2025
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/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
Loading