You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update CLAUDE.md with accurate repo structure and setup instructions
- Fix PHPStan level (8, not max) to match phpstan.neon
- Fix code style description to reference phpstan/build-cs instead of PSR-12
- Add make cs-install prerequisite for code style checks
- Add missing AST source files (AbstractNodeVisitor, Attribute, Comment, NodeAttributes)
- Add Doctrine annotation AST namespace documentation
- Add missing test files (TokenIteratorTest, DifferTest, IntegrationPrinterWithPhpParserTest)
- Add Initial Setup section with composer install and make cs-install
- Add format-preserving printer code example from README
- Add API reference and documentation links from README
- Add note about PHP 7.4+ support vs phpstan-src PHP 8.1+
- Remove emoji from section headers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+71-40Lines changed: 71 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,24 @@ This file contains important instructions for working on the phpdoc-parser proje
4
4
5
5
## Project Overview
6
6
7
-
**phpstan/phpdoc-parser** is a library that represents PHPDocs with an Abstract Syntax Tree (AST). It supports parsing and modifying PHPDocs, and is primarily used by PHPStan for static analysis.
7
+
**phpstan/phpdoc-parser** is a library that represents PHPDocs with an AST (Abstract Syntax Tree). It supports parsing and modifying PHPDocs, and is primarily used by PHPStan for static analysis.
8
+
9
+
*[PHPDoc Basics](https://phpstan.org/writing-php-code/phpdocs-basics) (list of PHPDoc tags)
10
+
*[PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) (list of PHPDoc types)
11
+
*[phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/2.3.x/namespace-PHPStan.PhpDocParser.html) with all the AST node types
8
12
9
13
### Key Features
10
14
- Parses PHPDoc comments into an AST representation
11
-
- Supports all PHPDoc tags and types (see [PHPStan documentation](https://phpstan.org/writing-php-code/phpdocs-basics))
12
-
- Format-preserving printer for modifying and printing AST nodes
15
+
- Supports all PHPDoc tags and types
16
+
- Format-preserving printer for modifying and printing AST nodes (inspired by [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser))
13
17
- Support for Doctrine Annotations parsing
14
18
- Nullable, intersection, generic, and conditional types support
15
19
16
20
### Requirements
17
21
- PHP ^7.4 || ^8.0
18
-
- Platform target: PHP 7.4.6
22
+
- Platform target: PHP 7.4.6 (set in composer.json config)
23
+
24
+
Note: While phpstan-src is on PHP 8.1+ thanks to PHAR build downgrade, this repository still supports PHP 7.4+.
19
25
20
26
## Project Structure
21
27
@@ -24,32 +30,37 @@ This file contains important instructions for working on the phpdoc-parser proje
24
30
The source code is organized into the following main components:
25
31
26
32
1.**Lexer** (`src/Lexer/`)
27
-
-`Lexer.php` - Tokenizes PHPDoc strings
33
+
-`Lexer.php` - Tokenizes PHPDoc strings into tokens
28
34
29
35
2.**Parser** (`src/Parser/`)
30
36
-`PhpDocParser.php` - Main PHPDoc parser (parses tags and structure)
31
37
-`TypeParser.php` - Parses PHPDoc type expressions
The `make cs-install` step clones the [phpstan/build-cs](https://github.com/phpstan/build-cs) repository and installs its dependencies. This is required before running code style checks (`make cs` or `make cs-fix`).
0 commit comments