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 Conventions

Php Conventions Laravel Package

ecphp/php-conventions

Predefined GrumPHP configuration for PHP projects at the European Commission. Adds quality checks via git hooks (or manual runs): license file, composer validation/normalization, linters (YAML/JSON/PHP), Twig CS, PHP-CS-Fixer, PHPCS, PHPStan, Psalm.

View on GitHub
Deep Wiki
Context7

ECPHP PHP conventions.

Frequently asked questions about Php Conventions
Does this package add Laravel-specific linting (e.g., Blade, Eloquent, or route validation)?
No, this package enforces generic PHP conventions (PSR-12, naming rules) and has no Laravel-specific checks. For Laravel codebases, tools like Laravel Pint or PHPStan’s Laravel extension are better suited.
How do I integrate this into a Laravel project’s CI pipeline?
Add it as a pre-commit hook or CI step using `vendor/bin/grumphp run`. However, since it lacks Laravel-specific rules, prioritize Laravel Pint or PHPStan for Laravel code validation to avoid false positives.
Will this package break Laravel’s dynamic properties (e.g., `$fillable`, `__get()`)?
Yes, it may flag Laravel-specific patterns as violations. You’ll need to manually exclude them in your `grumphp.yml` or `phpcs.xml.dist` to prevent false positives.
Is this package compatible with Laravel 10 and PHP 8.2+?
No, the package relies on outdated dependencies (e.g., PHP-CS-Fixer v3.x) and hasn’t been updated since 2022. Use it at your own risk, or consider forking and maintaining it.
Can I customize the PHPStan or PHP-CS-Fixer rules for Laravel?
The package provides default configurations, but Laravel-specific overrides (e.g., allowing `protected $guarded`) require manual edits. No built-in Laravel rule sets are included.
What’s the performance impact of running this in CI compared to Laravel Pint?
This package runs multiple tools (PHPStan, Psalm, PHP-CS-Fixer) sequentially, which may slow down CI. Laravel Pint is optimized for Laravel and runs faster for most Laravel-specific checks.
Does this package support Blade template linting?
Yes, it includes Twig CS (for Blade files), but no Laravel-specific Blade validation. For deeper Blade checks, consider integrating Laravel Pint or custom PHPStan rules.
How do I exclude Laravel’s magic methods (e.g., `__get()`, `__set()`) from linting?
Edit your `phpcs.xml.dist` to exclude Laravel-specific patterns. Example: `<exclude-pattern>.*__get.*</exclude-pattern>`. No built-in Laravel exclusions exist.
Is there a maintained alternative for Laravel-specific conventions?
Yes, use Laravel Pint (official) or PHPStan’s Laravel extension for Laravel-specific linting. This package is generic and hasn’t been updated for Laravel’s evolving patterns.
Can I run this package manually without Git hooks?
Yes, execute `vendor/bin/grumphp run` in your terminal. However, for Laravel projects, manual runs of Laravel Pint or PHPStan are more efficient.
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.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views