Skip to content

Commit

Permalink
Improve description in readme and extract internals (#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
  • Loading branch information
vjik and samdark authored Jan 28, 2024
1 parent 5a66792 commit a686693
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 30 deletions.
45 changes: 16 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://github.com/yiisoft" target="_blank">
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px">
</a>
<h1 align="center">Yii Framework Console</h1>
<h1 align="center">Yii Console</h1>
<br>
</p>

Expand All @@ -15,7 +15,17 @@
[![static analysis](https://github.com/yiisoft/yii-console/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii-console/actions?query=workflow%3A%22static+analysis%22)
[![type-coverage](https://shepherd.dev/github/yiisoft/yii-console/coverage.svg)](https://shepherd.dev/github/yiisoft/yii-console)

This Yii Framework package provides a console that could be added to an application.
Yii Console package provides a console that could be added to an application. This console is based on
[Symfony Console](https://github.com/symfony/console). The following extra features are added:

- lazy command loader;
- `SymfonyEventDispatcher` class that allows to use any [PSR-14](http://www.php-fig.org/psr/psr-14/) compatible event
dispatcher with Symfony console;
- `ErrorListener` for logging console errors to any [PSR-3](https://www.php-fig.org/psr/psr-3/) compatible logger;
- console command `serve` that runs PHP built-in web server;
- raises events `ApplicationStartup` and `ApplicationShutdown` in console application;
- class `ExitCode` that contains constants for defining console command exit codes;
- `ConsoleBufferedOutput` that wraps `ConsoleOutput` and buffers console output.

## Requirements

Expand All @@ -26,7 +36,7 @@ This Yii Framework package provides a console that could be added to an applicat
The package could be installed with composer:

```shell
composer require yiisoft/yii-console --prefer-dist
composer require yiisoft/yii-console
```

## General usage
Expand Down Expand Up @@ -141,36 +151,13 @@ 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`

## Testing

### Unit testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```shell
./vendor/bin/phpunit
```

### Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
## Documentation

```shell
./vendor/bin/roave-infection-static-analysis-plugin
```

### Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```shell
./vendor/bin/psalm
```
- [Internals](docs/internals.md)

## License

The Yii Framework Console is free software. It's released under the terms of the BSD License.
The Yii Console is free software. It's released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yiisoft/yii-console",
"type": "library",
"description": "Yii Framework Console",
"description": "Symfony console wrapper with additional features",
"keywords": [
"yii",
"console"
Expand Down
40 changes: 40 additions & 0 deletions docs/internals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Internals

## Unit testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```shell
./vendor/bin/phpunit
```

## Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:

```shell
./vendor/bin/roave-infection-static-analysis-plugin
```

## Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```shell
./vendor/bin/psalm
```

## Code style

Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
use either newest or any specific version of PHP:

```shell
./vendor/bin/rector
```

## Dependencies

Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
[Composer](https://getcomposer.org/) dependencies.

0 comments on commit a686693

Please sign in to comment.