typo3/coding-standards
TYPO3 Coding Standards provides shared PHP_CodeSniffer rules and tooling to enforce consistent, TYPO3-specific PHP coding conventions. Integrate with CI and local development to automatically detect style issues, improve code quality, and keep contributions uniform.
composer require --dev typo3/coding-standards
TYPO3):
vendor/bin/phpcs --standard=vendor/typo3/coding-standards/ruleset.xml path/to/Classes
phpcs to your local dev workflow — e.g., linting Classes/, Configuration/, and Resources/ PHP files before commit.phpcs with pre-commit or husky (for frontend-adjacent teams) to auto-check staged PHP files.- name: Run coding standards check
run: |
vendor/bin/phpcs --standard=vendor/typo3/coding-standards/ruleset.xml --report-full=phpcs-report.txt --error-severity=5 --warning-severity=5 Classes/ Configuration/
typo3/coding-standards ruleset.phpcs.xml.dist that extends the upstream ruleset, overriding or adding sniffs:
<?xml version="1.0"?>
<ruleset name="MyProject">
<rule ref="vendor/typo3/coding-standards/ruleset.xml"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"/>
</ruleset>
vendor/bin/phpcs -v.Tests/Fixture, Build/) can be done via phpcs.xml <exclude-pattern> or CLI flags (--ignore), but use phpcs.xml for CI consistency.typo3/coding-standards rule to avoid precedence conflicts.~/.composer/cache and vendor/ to speed up phpcs runs — especially useful for large monorepos.phpcbf for simple fixes (--standard=... --auto-fix), but always audit changes manually — TYPO3-specific rules (like ExtensionName) may require manual intervention.ExtensionNamingUtility, ObjectManager deprecation). Review Ruleset.php in the source to understand what’s enforced.How can I help you explore Laravel packages today?