Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Coding Standards Laravel Package

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.

Deep Wiki
Context7

Getting Started

  1. Install via Composer in your TYPO3 extension or project:
    composer require --dev typo3/coding-standards
    
  2. Run a quick check using the bundled ruleset (e.g., TYPO3):
    vendor/bin/phpcs --standard=vendor/typo3/coding-standards/ruleset.xml path/to/Classes
    
  3. First real use case: Enforce coding standards across a new or existing TYPO3 extension by adding phpcs to your local dev workflow — e.g., linting Classes/, Configuration/, and Resources/ PHP files before commit.

Implementation Patterns

  • Local pre-commit hook: Integrate phpcs with pre-commit or husky (for frontend-adjacent teams) to auto-check staged PHP files.
  • CI pipeline (GitHub Actions, GitLab CI, etc.): Add a job like:
    - 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/
    
  • IDE integration: Configure PHP_CodeSniffer in PhpStorm or VS Code (PHP Sniffer extension) to show inline violations using the typo3/coding-standards ruleset.
  • Extend and customize: Create your own 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>
    

Gotchas and Tips

  • PHPCS version mismatch: Ensure your project uses PHPCS ≥3.7 (the package’s documented minimum). Older versions (e.g., PHPCS 2.x) won’t support the ruleset — check with vendor/bin/phpcs -v.
  • Excluding directories (e.g., Tests/Fixture, Build/) can be done via phpcs.xml <exclude-pattern> or CLI flags (--ignore), but use phpcs.xml for CI consistency.
  • Custom sniffs override: If you add your own custom sniffs in a local ruleset, group them after the typo3/coding-standards rule to avoid precedence conflicts.
  • CI cache hits: For GitHub Actions, cache ~/.composer/cache and vendor/ to speed up phpcs runs — especially useful for large monorepos.
  • Autofix safely: Use phpcbf for simple fixes (--standard=... --auto-fix), but always audit changes manually — TYPO3-specific rules (like ExtensionName) may require manual intervention.
  • Read the included sniffs: The repo includes TYPO3-specific sniffs (e.g., for ExtensionNamingUtility, ObjectManager deprecation). Review Ruleset.php in the source to understand what’s enforced.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation