From 8d8adf531cbda64a6d1fde6279a8fbd8f4cba6fe Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 17 Feb 2024 11:33:34 +0300 Subject: [PATCH] add info --- README.md | 28 +++-------------------- docs/internals.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 25 deletions(-) create mode 100644 docs/internals.md diff --git a/README.md b/README.md index 40ad1b5..910c1f4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ a distributed applications (e.g. with several servers, load balancers, etc.). The package could be installed with composer: ``` -composer require yiisoft/cache-memcached --prefer-dist +composer require yiisoft/cache-memcached ``` ## Configuration @@ -124,31 +124,9 @@ To work with values in a more efficient manner, batch operations should be used: This package can be used as a cache handler for the [Yii Caching Library](https://github.com/yiisoft/cache). -## Testing +## Documentation -### 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. To run it: - -```shell -./vendor/bin/infection -``` - -### Static analysis - -The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: - -```shell -./vendor/bin/psalm -``` +- [Internals](docs/internals.md) ### Support the project diff --git a/docs/internals.md b/docs/internals.md new file mode 100644 index 0000000..40fe5c5 --- /dev/null +++ b/docs/internals.md @@ -0,0 +1,57 @@ +# Internals + +## Development environment + +For greater ease it is recommended to use docker containers. + +Run container with memcached directly via command: + +```shell +docker run --rm --name yiisoft-cache-memcached-cache --detach --publish 11211:11211 memcached:1.6.23 +``` + +Memcached must be accessible by address `127.0.0.1`. If you use PHP via docker container, run PHP container in network +of memcached container. Use `docker run` command argument for it: + +``` +--network container:yiisoft-cache-memcached-cache +``` + +## 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.