Skip to content

Commit

Permalink
Merge branch 'master' into serve
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz authored Jun 22, 2024
2 parents 3f35c59 + a7d8e33 commit 4654d62
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ Since `\Yiisoft\Yii\Console\CommandLoader` uses lazy loading of commands, it's n
to specify the name and description in static properties when creating a command:

```php
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Yiisoft\Yii\Console\ExitCode;


#[AsCommand(
name: 'my:custom',
description: 'Description of my custom command.'
)]
final class MyCustomCommand extends Command
{
protected static $defaultName = 'my:custom';
protected static $defaultDescription = 'Description of my custom command.';

{
protected function configure(): void
{
// ...
Expand Down Expand Up @@ -148,8 +151,11 @@ To configure default settings, set the options in `\Yiisoft\Yii\Console\CommandL
],
```

Alternatively, you can pass the settings through the console options. To see the available options, run
`./yii serve --help`
Alternatively, you can pass the settings through the console options.

> Tip: To run a web server with XDebug enabled, pass `--xdebug 1` to the command.
To see the available options, run `./yii serve --help`.

## Documentation

Expand Down
8 changes: 5 additions & 3 deletions tests/Stub/StubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yiisoft\Yii\Console\Tests\Stub;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -12,11 +13,12 @@
use Yiisoft\Yii\Console\Application;
use Yiisoft\Yii\Console\ExitCode;

#[AsCommand(
name: 'stub',
description: 'Stub command tests'
)]
final class StubCommand extends Command
{
protected static $defaultName = 'stub';
protected static $defaultDescription = 'Stub command tests';

public function configure(): void
{
$this->addOption('styled', 's', InputOption::VALUE_OPTIONAL);
Expand Down

0 comments on commit 4654d62

Please sign in to comment.