Metadata-Version: 2.4
Name: php-cs-fixer-py
Version: 0.1.8
Summary: Python wrapper for PHP-CS-Fixer with a bundled static PHP binary
Author-email: anonymous <anonymous@anonymous.com>
License-Expression: GPL-2.0-only
License-File: LICENSE
License-File: PHP-CS-Fixer-LICENSE
License-File: PHP-LICENSE
License-File: Zend-Engine-LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: static-php-py==0.2.0
Description-Content-Type: text/markdown

# php-cs-fixer-py

> PHP-CS-Fixer in Python — check and fix PHP code style through a typed API.

Python wrapper for [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) — no local PHP or Composer required.

## Install

```bash
uv add php-cs-fixer-py
# or
pip install php-cs-fixer-py
```

Requires Python >= 3.10. See the [distribution contents](docs/releasing.md#distribution) and [PHP resolution policy](docs/design.md#phpcsfixerrunner-class).

## Usage

```python
from php_cs_fixer_py import Source, check, fix

source = Source.code("<?php $a = array(1,2);")
clean = fix(source, rules={"array_syntax": {"syntax": "short"}}).code
report = check(Source.code(clean), rules={"array_syntax": {"syntax": "short"}})
print(clean, report.compliant)
```

## API

- [Functions and `Fixer`](docs/design.md#function-specifications): callable specifications.
- [`Source`](docs/design-types.md#source): input construction and coercion.
- [`FixerConfig`](docs/design-types.md#fixerconfig-dataclassfrozentrue): configuration fields and defaults.
- [`FixResult` and `FileResult`](docs/design-types.md#fixresult-dataclassfrozentrue): result fields and projections.
- [Exceptions](docs/design-types.md#exception--error-types): error conditions and context.

## Documentation

- [Concepts](docs/concept.md): scope, relationships, and rationale.
- [Design](docs/design.md): class specifications and module structure.
- [Implementation](docs/impl.md): library APIs and PHAR protocol.

## For Agents

Agent-consumable documentation index at [docs/llms.txt](docs/llms.txt) (llmstxt.org format).

## License

GPL-2.0-only — see [LICENSE](LICENSE).
