This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
php-diff is a PHP library for generating diffs between strings in multiple output formats (unified, side-by-side HTML, context, JSON, etc.). Minimum PHP 8.3.
composer run-script test # phpunit --verbose
composer run-script analyze # phan --color && phpcs --colors -n
composer run-script fix # php-cs-fixer fix --verbose (auto-format)
composer run-script server # dev server at localhost:12388- PSR-12, 4-space indentation, LF line endings
- PHP-CS-Fixer 3 with
.php-cs-fixer.dist.phpconfig (risky mode enabled) - Short array syntax (
[]), trailing commas in multiline arrays/args - Run
composer run-script fixto auto-format before committing
- PHPUnit 13; all test methods require
@coversannotations tests/data/is excluded from linting — do not apply phpcs or php-cs-fixer there- Trailing whitespace in test data is intentional (tests whitespace handling) — never strip it
no_trailing_whitespace_in_stringrule is disabled in php-cs-fixer for this reason
- Active branch:
v7— branch from it usingfeat/*orfix/*naming - Run
composer run-script analyze && composer run-script testbefore marking work done
- Think before acting. Read existing files before writing code.
- Be concise in output but thorough in reasoning.
- Prefer editing over rewriting whole files.
- Do not re-read files you have already read unless the file may have changed.
- Test your code before declaring done.
- No sycophantic openers or closing fluff.
- Keep solutions simple and direct.
- User instructions always override this file.