Skip to content

Commit 3c4ac4a

Browse files
phpstan-botclaude
authored andcommitted
Update README with missing feature descriptions
The README only had a one-line description. Added sections covering: - Version-aware stubs with #[\Since] and #[\Until] attributes - Coverage scope (core, 69 extensions, 6 SAPIs) - Php8StubsMap version-aware class/function mapping - Automated extraction and daily CI pipeline - Basic usage example - Dual license information Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1a458e6 commit 3c4ac4a

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
PHP 8 stubs
22
====================
33

4-
The stubs are automatically extracted from [php-src](https://github.com/php/php-src/) and are relevant for analyzing codebases that use PHP 8 or later.
4+
PHP stub files automatically extracted from [php-src](https://github.com/php/php-src/). Used by [PHPStan](https://phpstan.org/) to understand signatures of built-in PHP classes and functions for PHP 8.0+.
5+
6+
## Features
7+
8+
- **Version-aware stubs** covering PHP 8.0 through 8.5, with `#[\Since('x.y')]` and `#[\Until('x.y')]` attributes to track when symbols and signatures were added or removed.
9+
- **Comprehensive coverage**: core language stubs (`Zend/`), 69 extensions (`ext/`), and 6 SAPIs (`sapi/`).
10+
- **Version-aware class/function map** (`Php8StubsMap`) that accepts a `$phpVersionId` and returns only the symbols available in that PHP version.
11+
- **Fully automated extraction** via `extractor/extract.php` — stubs are never hand-written.
12+
- **Daily CI updates** that extract from all PHP 8.x branches, auto-tag releases, and open PRs in `phpstan/phpstan-src`.
13+
14+
## Usage
15+
16+
```php
17+
$map = new \PHPStan\Php8StubsMap($phpVersionId); // e.g. 80300 for PHP 8.3.0
18+
$map->classes; // array<string, string> — lowercase class name => stub path
19+
$map->functions; // array<string, string> — lowercase function name => stub path
20+
```
21+
22+
## License
23+
24+
Dual-licensed under [MIT](LICENSE) and [PHP-3.01](stubs/LICENSE).

0 commit comments

Comments
 (0)