Aller au contenu

Reference

phil/dev-tools

Pas encore traduite

Cette page n’est pas encore traduite en français ; elle est montrée en anglais.
TypeRole
Console\Applicationphil-dev and its commands.
Command\*CommandOne class per command; WorkspaceCommand gives them the root and the process runner.
Workspace\Workspace, Package, PackageRole, ManifestThe root, the members and the installed packages, with their composer.json and phil-dev.php.
Workspace\MemberAutoloaderAdds the members' PSR-4 prefixes, from their own composer.json, to Composer's ClassLoader.
Config\ToolingWhat the shared configurations of PHP-CS-Fixer, Rector, PHPStan and Arkitect read.
Config\DeptracConfig, Layer, LayerKindThe generated Deptrac configuration.
Config\InfectionConfigThe generated Infection configuration.
Config\PsalmConfigThe generated Psalm configuration of the taint analysis.
Config\TwigStanConfigThe generated TwigStan configuration and its PHPStan configuration.
Config\BiomeConfigThe generated Biome configuration and the Biome version.
Config\ChurnConfigThe generated churn-php configuration.
Config\DocsLintConfigThe generated configurations of cspell, markdownlint and Vale, and the files they read.
Config\CaptainHookConfigThe captainhook.json init writes.
Config\YamlWriterThe YAML of the generated configurations.
Matrix\Matrix, Version, VersionStatusThe versions of PHP and Symfony of config/matrix.json.
Init\Initializer, ComposerJson, InitResult, InitStatusWhat init writes.
Skeleton\PackageName, SkeletonWriterWhat new writes.
Docs\DocsChecker, FindingThe documentation checks.
Docs\TranslationCheckerThe checks of the French mirror, and whether a package's failures block.
Docs\MirrorsWhere the French mirror of a document lives, and which documents have one.
Docs\SourceStampThe SHA-256 of the English source on the first line of a mirror.
Docs\MarkdownStructureThe headings by level and the fenced code blocks of a Markdown text.
Witness\WitnessCheckerThe witnesses of the PHPStan rules.
PhpStan\Rules\ClassNameMustEndWithComponentRuleThe PHPStan rule on the names of Twig and Live Components; see below.
Process\ProcessRunner, LocalProcessRunner, ProcessResultThe processes the commands run, with a timeout when one is given.
Process\ExecutablesThe programs of the PATH: splitsh-lite, cspell, markdownlint-cli2, Vale, npx.
Bench\WorkerBench, WorkerBenchResultThe requests of the worker-mode benchmark and their percentiles.
Services\TestServicesThe real servers and their variables.
Testing\ServiceUrl, HttpRecordingThe helpers of integration tests.
DevTools, FilesWhere this package is, reading its files and removing the directories it generates.
Exception\DevToolsExceptionImplemented by every exception of the package.
FileRole
config/php-cs-fixer.php, rector.php, arkitect.phpThe shared configurations the thin files call.
config/phpstan.neon, phpstan-disallowed.neon and .php, phpstan-symplify.php, phpstan-symfony-ux.php, phpstan-workspace.phpThe shared PHPStan configuration.
config/twig-loader.phpThe Twig environment TwigStan compiles with, when no package names its own.
config/phpstan-witnesses.neon and .phpThe analysis of the witnesses.
config/phpbench.jsonThe shared PHPBench configuration.
config/matrix.jsonThe version matrix.
resources/init/, resources/skeleton/The templates of init and new, the French mirror of the documentation included.
doc/fr-glossary.mdThe words and the tone of the French documentation.
resources/compose.yamlThe real servers, and FrankenPHP for the worker-mode benchmark.
resources/biome/download.phpDownloads Biome through kocal/biome-js-bundle, without a Symfony kernel.
resources/docs/words.txt, resources/docs/vale/Phil/The shared words of cspell, and the Vale style.
resources/php/DockerfileThe image of a PHP of the matrix.
resources/autoload-members.phpThe member autoloader, for a monorepo's autoload-dev.

PHPStan rules

The rules of this package run inside PHPStan, which loads them from config/phpstan-symfony-ux.php, part of the shared config/phpstan.neon every project includes. They depend on nothing else at run time.

RuleIdentifierRequires
ClassNameMustEndWithComponentRulephil.componentClassNameA class carrying #[AsTwigComponent] or #[AsLiveComponent] has a name ending with Component, with that exact case.

A suffix tells the role of a class at a glance, as Interface, Trait and Abstract… do, and keeps a name clear of the words PHP reserves: ListComponent is a valid class name, List is not. The rule replaces ClassNameMustNotEndWithComponentRule of kocal/phpstan-symfony-ux, which asks the opposite and is no longer loaded. It compares the resolved name of the attribute without loading its class, so a project without Symfony UX runs it safely.

// Refused: Class Alert carries #[AsTwigComponent]: its name must end with "Component", such as AlertComponent.
#[AsTwigComponent('Alert')]
final class Alert
{
}

// Accepted.
#[AsTwigComponent('Alert')]
final class AlertComponent
{
}

See Quality gates for the details.