Skip to content

Commit

Permalink
Fix docs (#62)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
  • Loading branch information
luizcmarin and vjik committed May 18, 2024
1 parent 36bb673 commit f55ee6a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 29 deletions.
32 changes: 6 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ If too many requests are received from a user within the stated period of the ti

## Installation

The package could be installed with composer:
The package could be installed with [Composer](https://getcomposer.org):

```shell
composer install yiisoft/rate-limiter
composer require yiisoft/rate-limiter
```

## General usage
Expand Down Expand Up @@ -98,32 +98,12 @@ There are two ready to use counter storages available in the package:

To use your own storage implement `Yiisoft\Yii\RateLimiter\Storage\StorageInterface`.

## Testing
## Documentation

### Unit testing
- [Internals](docs/internals.md)

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
```
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).

## License

Expand Down
5 changes: 2 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Upgrading Instructions for Yii Rate Limiter
# Yii Rate Limiter Middleware Upgrading Instructions

This file contains the upgrade notes for the Yii Rate Limiter.
These notes highlight changes that could break your application when you upgrade it from one major version to another.
This file contains notes that highlight changes that could break your application when you upgrade it from one major version to another.

## 2.0.0

Expand Down
44 changes: 44 additions & 0 deletions docs/internals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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

This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if
all dependencies are correctly defined in `composer.json`. To run the checker, execute the following command:

```shell
./vendor/bin/composer-require-checker
```

0 comments on commit f55ee6a

Please sign in to comment.