From 19afb96b38059e58df849b5d4b22d71b8076ae9b Mon Sep 17 00:00:00 2001 From: Luiz Marin <67489841+luizcmarin@users.noreply.github.com> Date: Sun, 12 May 2024 07:26:02 -0300 Subject: [PATCH] Fix docs (#70) --- README.md | 51 +++++++++++++++++------------------------------ composer.json | 2 +- docs/internals.md | 45 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 34 deletions(-) create mode 100644 docs/internals.md diff --git a/README.md b/README.md index 3f19893..0eaba7b 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,6 @@

-The package is able to build generic proxy for a class i.e. it allows intercepting all class method calls. It's used in -[yii-debug](https://github.com/yiisoft/yii-debug) package to collect service's method calls information. - -For license information check the [LICENSE](LICENSE.md)-file. - [![Latest Stable Version](https://poser.pugx.org/yiisoft/proxy/v/stable.png)](https://packagist.org/packages/yiisoft/proxy) [![Total Downloads](https://poser.pugx.org/yiisoft/proxy/downloads.png)](https://packagist.org/packages/yiisoft/proxy) [![Build status](https://github.com/yiisoft/proxy/workflows/build/badge.svg)](https://github.com/yiisoft/proxy/actions?query=workflow%3Abuild) @@ -20,15 +15,22 @@ For license information check the [LICENSE](LICENSE.md)-file. [![static analysis](https://github.com/yiisoft/proxy/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/proxy/actions?query=workflow%3A%22static+analysis%22) [![type-coverage](https://shepherd.dev/github/yiisoft/proxy/coverage.svg)](https://shepherd.dev/github/yiisoft/proxy) +The package is able to build generic proxy for a class i.e. it allows intercepting all class method calls. It's used in +[yii-debug](https://github.com/yiisoft/yii-debug) package to collect service's method calls information. + +## Requirements + +- PHP 8.0 or higher. + ## Installation -The preferred way to install this extension is through [Сomposer](http://getcomposer.org/download/). +The package could be installed with [Composer](https://getcomposer.org): ``` -composer require --prefer-dist yiisoft/proxy +composer require yiisoft/proxy ``` -## Usage +## General usage ### Custom base proxy class @@ -129,29 +131,19 @@ class CarProxy extends MyProxy implements CarInterface } ``` -## Unit testing - -The package is tested with [PHPUnit](https://phpunit.de/). To run tests: - -```shell -./vendor/bin/phpunit -``` - -## Mutation testing +## Documentation -The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it: +- [Internals](docs/internals.md) -```shell -./vendor/bin/infection -``` +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). -## Static analysis +## License -The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: +The Yiisoft Proxy is free software. It is released under the terms of the BSD License. +Please see [`LICENSE`](./LICENSE.md) for more information. -```shell -./vendor/bin/psalm -``` +Maintained by [Yii Software](https://www.yiiframework.com/). ## Support the project @@ -164,10 +156,3 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static [![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en) [![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk) [![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack) - -## License - -The Yiisoft Proxy 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 480d056..77c0c5b 100644 --- a/composer.json +++ b/composer.json @@ -47,4 +47,4 @@ "composer/package-versions-deprecated": true } } -} +} \ No newline at end of file diff --git a/docs/internals.md b/docs/internals.md new file mode 100644 index 0000000..8dc4049 --- /dev/null +++ b/docs/internals.md @@ -0,0 +1,45 @@ +# 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 +``` + +## Rector + +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 +``` + +## Composer require checker + +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 +```