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

Php Coding Standard Laravel Package

unleashedtech/php-coding-standard

Opinionated PHP coding standard by Unleashed Tech, built on PHP-CS-Fixer rules and presets to keep code style consistent across projects. Easy to install via Composer and integrate into CI for automated linting and formatting.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install the package via Composer:
    composer require --dev unleashedtech/php-coding-standard
    
  2. Install PHP_CodeSniffer (PHPCS) if not already present:
    composer require --dev squizlabs/php_codesniffer
    
  3. Configure PHPCS to use the provided ruleset:
    Create or update phpcs.xml in your project root with:
    <?xml version="1.0"?>
    <ruleset name="UnleashedTechStandard">
        <arg value="p"/>
        <file>src/</file>
        <file>tests/</file>
        <rule ref="vendor/unleashedtech/php-coding-standard/ruleset.xml"/>
    </ruleset>
    
  4. Run initial linting:
    ./vendor/bin/phpcs
    
  5. First use case: Catch style violations before merge by adding the command to your local pre-commit hook or CI lint job.

Implementation Patterns

  • Global reuse: Include in a monorepo root or shared dev dependencies config; individual projects simply reference the ruleset via <rule ref="..."/>.
  • CI integration: Add ./vendor/bin/phpcs . as a step in your GitHub Actions, GitLab CI, or similar—fail fast on non-compliant code.
  • IDE integration: Configure PHPStorm or VS Code PHPCS extensions to use the same ruleset.xml; developers get real-time feedback.
  • Gradual adoption: Temporarily relax rules per directory or file using inline @codingStandardsIgnoreStart/End or <exclude-pattern> in phpcs.xml.
  • Override selectively: Extend the standard in your own phpcs.xml to tweak rules (e.g., add customSniff paths or relax specific sniffs) while keeping the baseline intact.

Gotchas and Tips

  • Version lock: Since it’s a small package (1 star), verify version compatibility with your PHP_CodeSniffer version (^3.7 recommended). Check composer.json for required PHP version.
  • Empty or minimal sniff set: The repo’s low score (21.38) and minimal star count may indicate incomplete coverage—validate which PSR rules it actually enforces by inspecting ruleset.xml in the vendor directory.
  • Default path assumptions: PHPCS looks for the ruleset in phpcs.xml or phpcs.xml.dist; ensure phpcs.xml is committed, or add a .phpcs.xml alias.
  • Performance: The ruleset includes only essential sniffs—great for speed, but not a replacement for static analyzers (e.g., PHPStan) or linters (e.g., PHP-CS-Fixer). Use alongside, not instead of.
  • Debugging issues: Run with -s flag (phpcs -s path/to/file.php) to see which sniff triggered a violation. Use --standard=VendorName when testing custom configs.
  • Extension point: While not configurable via phpcs.ini, you can create your own sniffs and add them to your project’s phpcs.xml after referencing this standard.
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
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
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