Skip to content

Commit

Permalink
Improved README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Feb 19, 2024
1 parent 24198e3 commit 2bb4b49
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
This library is an alternative to [native PHP Reflection](https://www.php.net/manual/en/book.reflection.php). It is:
- static,
- lazy,
- cacheable,
- [PSR-16](https://www.php-fig.org/psr/psr-16/) cacheable,
- compatible with native reflection,
- supports most of the Psalm/PHPStan types,
- can resolve templates,
- does not create circular object references, can be safely used with `zend.enable_gc=0`.
- does not create circular object references (can be safely used with [zend.enable_gc=0](https://www.php.net/manual/en/info.configuration.php#ini.zend.enable-gc)).

## Installation

Expand Down Expand Up @@ -59,7 +59,8 @@ This library is 99% compatible with native reflection API. See [compatibility](d

## Caching

The recommended way to cache reflection is using [Typhoon OPcache](https://github.com/typhoon-php/opcache).
You can use any [PSR-16](https://www.php-fig.org/psr/psr-16/) implementation for caching, but we highly recommend [Typhoon OPcache](https://github.com/typhoon-php/opcache).
Typhoon OPcache stores values as php files that could be opcached. It is much faster than an average file cache implementation that uses `serialize`.

```php
use Typhoon\Reflection\TyphoonReflector;
Expand All @@ -70,7 +71,7 @@ $reflector = TyphoonReflector::build(
);
```

To detect file changes during development, decorate cache with [ChangeDetectingCache](src/Cache/ChangeDetectingCache.php).
To detect file changes during development, decorate your cache with [ChangeDetectingCache](src/Cache/ChangeDetectingCache.php).

```php
use Typhoon\Reflection\TyphoonReflector;
Expand Down

0 comments on commit 2bb4b49

Please sign in to comment.