Skip to content

Commit 8892121

Browse files
committed
Add components documentation
1 parent 6768877 commit 8892121

File tree

4 files changed

+61
-26
lines changed

4 files changed

+61
-26
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## php-pp/readthedocs
2+
3+
Repository for the documentation oh PHP++ available at [phppp.readthedocs.io](https://phppp.readthedocs.io/).

README.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/source/components.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Components
2+
==========
3+
4+
PHP++ id a set of reusable components. You can use all of them of just the one you need.
5+
6+
``-contracts`` components
7+
-------------------------
8+
9+
When it's possible, a component has it's counterpart ``-contract`` with only interfaces.
10+
11+
If you don't need to use our implementation of this interfaces
12+
(you just need a typehint, you want to create your own implementation etc),
13+
add the ``-contract`` dependency and work with interfaces.
14+
15+
Example:
16+
.. code-block:: php
17+
:emphasize-lines: 3
18+
// You need a StringCollection to work with it,
19+
// don't use StringCollection but StringCollectionInterface
20+
function foo(StringCollectionInterface $strings): void
21+
{
22+
// Do some stuff here with $strings
23+
}
24+
25+
Components
26+
----------
27+
28+
+----------------------+--------------------------------------------+--------------------------------------------------------------+
29+
| Component | Description | Github |
30+
+======================+============================================+========+=====================================================+
31+
| collection | Replace array by a strict typed collection | `github.com<https://github.com/php-pp/collection>` |
32+
+----------------------+--------------------------------------------+--------------------------------------------------------------+
33+
| collection-contracts | Contracts for collection | `github.com<https://github.com/php-pp/collection-contracts>` |
34+
+----------------------+--------------------------------------------+--------------------------------------------------------------+
35+
| collection-generator | Helps you to generate a Collection | `github.com<https://github.com/php-pp/collection-generator>` |
36+
+----------------------+--------------------------------------------+--------------------------------------------------------------+
37+
38+
Development components
39+
----------------------
40+
41+
+----------------------+--------------------------------------------+--------------------------------------------------------------+
42+
| Component | Description | Github |
43+
+======================+============================================+========+=====================================================+
44+
| code-sniffer | Code sniffer for PHP++ code style | `github.com<https://github.com/php-pp/code-sniffer>` |
45+
+----------------------+--------------------------------------------+--------------------------------------------------------------+

docs/source/index.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
Welcome to PHP++ documentation!
22
===============================
33

4-
[PHP++](https://github.com/php-pp) is a PHP library with this behaviors:
5-
* Work with objects, do not use old functions (example: ``fileatime()`` -> ``FileUtils::getAccessedAt()``)
4+
`PHP++<https://github.com/php-pp>` is a PHP library with this features:
5+
* Install only what you need: PHP++ is a set of reusable components
6+
* Work with objects, do not use functions (example: ``fileatime()`` -> ``FileUtils::getAccessedAt()``)
67
* Do not care about ``E_NOTICE`` and it's friends, all PHP errors are catched and replaced by an exception
7-
* Replace ``array`` by ``Collection`` with only one type allowed (example: ``StringCollection``, ``DateTimeNullableCollection``)
8+
* Replace ``array`` by ``Collection`` with only one type allowed (example: ``StringCollection``)
89

9-
Compatibles PHP versions: from 7.4 to the latest.
10-
11-
**Lumache** (/lu'make/) is a Python library for cooks and food lovers
12-
that creates recipes mixing random ingredients.
13-
It pulls data from the `Open Food Facts database <https://world.openfoodfacts.org/>`_
14-
and offers a *simple* and *intuitive* API.
15-
16-
Check out the :doc:`usage` section for further information, including
17-
how to :ref:`installation` the project.
10+
Compatibles PHP versions: from ``7.4`` to the ``latest``.
1811

1912
.. note::
2013

2114
This project is under active development.
2215

23-
Contents
24-
--------
16+
Components
17+
----------
18+
19+
`See the list of components.</components>`
2520

26-
.. toctree::
21+
Issues
22+
------
2723

28-
usage
29-
api
24+
If you find an issue, go to `github.com/php-pp<https://github.com/php-pp>`, select the component that has a problem
25+
and create a ticket in the ``Issue`` tab.

0 commit comments

Comments
 (0)