diff --git a/README.md b/README.md index 1afa5d0..a8b729a 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ package. ## Installation -The package could be installed with composer: +The package could be installed with [Composer](https://getcomposer.org): ```shell -composer require yiisoft/rbac-php --prefer-dist +composer require yiisoft/rbac-php ``` See [yiisoft/rbac](https://github.com/yiisoft/rbac) for RBAC package installation instructions. @@ -80,8 +80,6 @@ In case you decide to manually edit the files, make sure to keep the following s Required and optional fields: ```php - 'posts.update', @@ -100,8 +98,6 @@ be used instead as a fallback. The structure for an item with children: ```php - 'posts.redactor', @@ -120,8 +116,6 @@ return [ The complete example for managing posts: ```php - 'posts.admin', @@ -359,36 +353,16 @@ When using database as a second storage, this can be done within a migration. De to either [RBAC Cycle example](https://github.com/yiisoft/rbac-cycle-db?tab=readme-ov-file#syncing-storages-manually) or [RBAC DB example](https://github.com/yiisoft/rbac-db?tab=readme-ov-file#syncing-storages-manually). -## 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: - -```shell -./vendor/bin/roave-infection-static-analysis-plugin -``` - -### Static analysis +## Documentation -The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: +- [Internals](docs/internals.md) -```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 -The Yii Dependency Injection is free software. It is released under the terms of the BSD License. +The Yii RBAC PHP File Storage is free software. It is released under the terms of the BSD License. Please see [`LICENSE`](./LICENSE.md) for more information. Maintained by [Yii Software](https://www.yiiframework.com/). diff --git a/composer.json b/composer.json index aee5035..6adeb54 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "issues": "https://github.com/yiisoft/rbac/issues", "forum": "https://www.yiiframework.com/forum/", "wiki": "https://www.yiiframework.com/wiki/", - "irc": "irc://irc.freenode.net/yii", + "irc": "ircs://irc.libera.chat:6697/yii", "chat": "https://t.me/yii3en", "source": "https://github.com/yiisoft/rbac" }, @@ -54,7 +54,9 @@ "Yiisoft\\Rbac\\Php\\Tests\\": "tests", "Yiisoft\\Rbac\\Tests\\": "vendor/yiisoft/rbac/tests" }, - "files": ["tests/bootstrap.php"] + "files": [ + "tests/bootstrap.php" + ] }, "config": { "sort-packages": true, diff --git a/docs/internals.md b/docs/internals.md new file mode 100644 index 0000000..0a0a1cd --- /dev/null +++ b/docs/internals.md @@ -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 +```