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

Update Serve.php #210

Closed
wants to merge 2 commits into from
Closed
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
29 changes: 15 additions & 14 deletions src/Command/Serve.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@

namespace Yiisoft\Yii\Console\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use function fclose;
use function is_dir;
use function explode;
use function passthru;
use function fsockopen;
use function file_exists;
use Composer\InstalledVersions;
use Yiisoft\Yii\Console\ExitCode;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Input\InputOption;

use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Yiisoft\Yii\Console\ExitCode;

use function explode;
use function fclose;
use function file_exists;
use function fsockopen;
use function is_dir;
use function passthru;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;

#[AsCommand('serve', 'Runs PHP built-in web server')]
final class Serve extends Command
Expand Down Expand Up @@ -95,7 +96,7 @@
{
$io = new SymfonyStyle($input, $output);
$io->title('Yii3 Development Server');
$io->writeln('https://yiiframework.com' . "\n");
$io->writeln('Welcome to Yii v' . substr(InstalledVersions::getVersion('yiisoft/yii-console'), 0, -2) . ' Console' . "\n");

Check failure on line 99 in src/Command/Serve.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

PossiblyNullArgument

src/Command/Serve.php:99:50: PossiblyNullArgument: Argument 1 of substr cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 99 in src/Command/Serve.php

View workflow job for this annotation

GitHub Actions / psalm80 / PHP 8.0-ubuntu-latest

PossiblyNullArgument

src/Command/Serve.php:99:50: PossiblyNullArgument: Argument 1 of substr cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 99 in src/Command/Serve.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

PossiblyNullArgument

src/Command/Serve.php:99:50: PossiblyNullArgument: Argument 1 of substr cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 99 in src/Command/Serve.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.3-ubuntu-latest

PossiblyNullArgument

src/Command/Serve.php:99:50: PossiblyNullArgument: Argument 1 of substr cannot be null, possibly null value provided (see https://psalm.dev/078)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this not need. Version of yii-console is not version of Yii


/** @var string $address */
$address = $input->getArgument('address');
Expand Down
Loading