|
| 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 | ++----------------------+--------------------------------------------+--------------------------------------------------------------+ |
0 commit comments