From e68c325e83b73ff32e9e5923860cda00db2fe42e Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 29 Jun 2020 19:24:01 +0200 Subject: [PATCH] Update README and documentation. --- README.md | 25 +++++++++++++++++++++---- docs/index.rst | 19 +++++++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e126db16f..85456b6bf 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/loophp/collection/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/loophp/collection/?branch=master) [![License](https://img.shields.io/packagist/l/loophp/collection.svg?style=flat-square)](https://packagist.org/packages/loophp/collection) [![Donate!](https://img.shields.io/badge/Sponsor-Github-brightgreen.svg?style=flat-square)](https://github.com/sponsors/drupol) + [![Donate!](https://img.shields.io/badge/Sponsor-Paypal-brightgreen.svg?style=flat-square)](https://www.paypal.me/drupol) # PHP Collection @@ -57,7 +58,14 @@ Similar libraries: On top of a complete documented code, the package include a full documentation that gets automatically compiled and published upon each commit at [https://loophp-collection.rtfd.io](https://loophp-collection.rtfd.io). -The documentation is missing some parts, it's being continuously improved with time. +[The API](https://loophp-collection.readthedocs.io/en/latest/pages/api.html) will give you a pretty good idea of the +existing methods and what you can do with it. + +Do not forget to check out the [usage](https://loophp-collection.readthedocs.io/en/latest/pages/usage.html) and +[examples](https://loophp-collection.readthedocs.io/en/latest/pages/examples.html) pages. + +I'm doing my best to keep the documentation up to date, if you found something odd, please let me know in the [issue +queue](https://github.com/loophp/collection/issues). ## Code quality, tests and benchmarks @@ -67,14 +75,23 @@ tests. The library has tests written with [PHPSpec](http://www.phpspec.net/). Feel free to check them out in the `spec` directory. Run `composer phpspec` to trigger the tests. -Before each commit some inspections are executed with [GrumPHP](https://github.com/phpro/grumphp), +Before each commit some inspections (_currently 14_) are executed with [GrumPHP](https://github.com/phpro/grumphp), run `./vendor/bin/grumphp run` to check manually. -[PHPInfection](https://github.com/infection/infection) is used to ensure that your code is properly tested, run `composer infection` to test your code. +The quality of the tests is tested with a PHP Mutation testing framework, run `composer infection` to try it. + +Static analysers are also controlling the code. [PHPStan](https://github.com/phpstan/phpstan) and +[PSalm](https://github.com/vimeo/psalm) are enabled to their maximum level. + +[PHP Insights](https://packagist.org/packages/nunomaduro/phpinsights) is also launched in Github actions just for +information. (_[example of PHP Insights report](https://github.com/loophp/collection/runs/818917887?check_suite_focus=true#step:11:221), you must be logged on Github to see it_) ## Contributing -Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-) +Feel free to contribute by sending Github pull requests. I'm quite reactive :-) + +If you can't contribute to the code, you can also sponsor me on [Github](https://github.com/sponsors/drupol) or +[Paypal](https://www.paypal.me/drupol). ## On the internet * [Reddit announcement thread](https://www.reddit.com/r/PHP/comments/csxw23/a_stateless_and_modular_collection_class/) diff --git a/docs/index.rst b/docs/index.rst index bf709e189..062bde425 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,17 +24,28 @@ On top of this, this library: * fully tested, * framework agnostic. -Except a few methods, most of methods are `pure`_ and return a new Collection object. +Except a few methods, most methods are `pure`_ and return a `new Collection object`_. -This library has been inspired by the `Laravel Support Package`_, `Lazy.js`_ and `Ruby arrays`_. +This library has been inspired by: +* `Laravel Support Package`_ +* `Lazy.js`_ +* `Ruby Array`_ +* `mtdowling/transducers`_ + +Similar libraries: +* `DusanKasan/Knapsack`_ +* `nikic/iter`_ It uses the following `PHP Standards Recommendations`_ : - `PSR-4`_ for classes auto loading, - `PSR-12`_ for coding standards. -This library is framework agnostic and can be integrated in any PHP project, in any framework. - +.. _nikic/iter: https://github.com/nikic/iter +.. _DusanKasan/Knapsack: https://github.com/DusanKasan/Knapsack +.. _mtdowling/transducers: https://github.com/mtdowling/transducers.php +.. _Ruby Array: https://ruby-doc.org/core-2.7.0/Array.html +.. _new Collection object: https://github.com/loophp/collection/blob/master/src/Collection.php .. _Lazy.js: http://danieltao.com/lazy.js/ .. _Laravel Support Package: https://github.com/illuminate/support .. _pure: https://en.wikipedia.org/wiki/Pure_function