Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ parameters:
- src
- test
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
9 changes: 8 additions & 1 deletion src/Swoole/Delegators/TCPServerDelegator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use function array_shift;
use function explode;
use function ltrim;
use function method_exists;
use function str_starts_with;
use function trim;

Expand Down Expand Up @@ -63,7 +64,13 @@
$commandClass = $commandMap[$commandName];
$application = new Application();
$commandInstance = $container->get($commandClass);
$application->add($commandInstance);
/** @phpstan-ignore function.alreadyNarrowedType */
if (method_exists($application, 'addCommand')) {
$application->addCommand($commandInstance);
} else {
/** @phpstan-ignore method.notFound */
$application->add($commandInstance); // @codeCoverageIgnore

Check warning on line 72 in src/Swoole/Delegators/TCPServerDelegator.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined method

Method 'add' is undefined
}
Comment thread
alexmerlin marked this conversation as resolved.

$parsedOptions = [];
foreach ($args as $arg) {
Expand Down
Loading