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
6 changes: 3 additions & 3 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class App
* @param Container|null $container
* @return App
*/
public static function new(Container $container = null): App
public static function new(?Container $container = null): App
{
$app = new App($container);
self::$app or self::$app = $app;
Expand Down Expand Up @@ -98,7 +98,7 @@ public static function handleThrowable(\Throwable $throwable): void
{
do_action(self::ACTION_ERROR, $throwable);

/** @psalm-suppress TypeDoesNotContainType */
/** @psalm-suppress RedundantCondition */
if (defined('WP_DEBUG') && WP_DEBUG) {
throw $throwable;
}
Expand All @@ -107,7 +107,7 @@ public static function handleThrowable(\Throwable $throwable): void
/**
* @param Container|null $container
*/
private function __construct(Container $container = null)
private function __construct(?Container $container = null)
{
$this->status = AppStatus::new();
$this->logger = AppLogger::new();
Expand Down
2 changes: 1 addition & 1 deletion src/AppLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function new(): AppLogger

private function __construct()
{
/** @psalm-suppress TypeDoesNotContainType */
/** @psalm-suppress RedundantCondition */
$this->debugEnabled = defined('WP_DEBUG') && WP_DEBUG;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ final class Container implements ContainerInterface
* @param ContainerInterface ...$containers
*/
public function __construct(
SiteConfig $config = null,
WpContext $context = null,
?SiteConfig $config = null,
?WpContext $context = null,
ContainerInterface ...$containers
) {

Expand Down
2 changes: 1 addition & 1 deletion src/EnvConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function env(): string
return $this->env;
}

/** @psalm-suppress TypeDoesNotContainType */
/** @psalm-suppress RedundantCondition */
$env = (defined('WP_DEBUG') && WP_DEBUG) ? self::DEVELOPMENT : self::PRODUCTION;
$this->env = $this->normalizeEnv($env, true);

Expand Down
4 changes: 2 additions & 2 deletions src/Provider/ConfigurableProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class ConfigurableProvider implements ServiceProvider
*/
public function __construct(
string $id,
callable $register = null,
callable $boot = null,
?callable $register = null,
?callable $boot = null,
int $flags = 0
) {

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static function (): bool {
* @param callable|null $register
* @return ServiceProvider
*/
private static function factoryProvider(string $id, callable $register = null): ServiceProvider
private static function factoryProvider(string $id, ?callable $register = null): ServiceProvider
{
return new ConfigurableProvider($id, $register ?? '__return_true', '__return_true');
}
Expand Down
Loading