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

drupol/php-conventions

Opinionated PHP conventions toolkit with presets for code style, static analysis, and QA tooling. Helps standardize projects quickly by providing shared configuration and automation-friendly defaults for common PHP workflows.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Php Conventions
How does **drupol/php-conventions** improve Laravel project consistency?
It provides pre-configured GrumPHP rulesets for PSR-12 compliance, PHPStan static analysis, and PHPCS checks—ensuring Laravel projects adhere to modern PHP standards out of the box. This reduces manual configuration and enforces consistency across teams.
Can I use this package without GrumPHP in a Laravel project?
Yes, but you’ll need to manually reference its config in `composer.json` under `extra.grumphp`. It’s designed to work standalone or alongside existing GrumPHP setups, making it flexible for Laravel projects with or without prior GrumPHP integration.
Does **drupol/php-conventions** support Laravel-specific coding patterns like Facades or Blade templates?
No, it focuses on generic PHP conventions (PSR-12, PHPStan, etc.). For Laravel-specific patterns, you’ll need to extend its PHPCS or PHPStan rulesets manually or combine it with tools like `laravel-shift/blueprint` for tailored enforcement.
Will this package slow down my Laravel CI/CD pipeline?
PHPStan and PHPCS can add overhead, especially for large codebases. Benchmark execution times in your CI environment and cache results (e.g., using GitHub Actions caching) to mitigate delays. Start with a subset of rules if needed.
How do I customize the default rules for my Laravel project?
Override the YAML config file (`grumphp.yml`) or extend the imported `drupol/php-conventions` config. Use `skip_tasks` to disable defaults (e.g., `phpcsfixer`) and add Laravel-specific tasks via `extra_tasks` or custom scripts.
Does this package work with Laravel 8+ and PHP 8.x?
Yes, it supports PHP 7.3+ and aligns with Laravel 8+’s PSR-12 compliance. Choose the `php73`, `php80`, or `psr12` config preset during installation to match your Laravel project’s PHP version and requirements.
How do I integrate this with Laravel’s built-in tools like `pint` or `phpstan/extension-installer`?
Use `pint` for auto-formatting to reduce PHPCS noise, and `phpstan/extension-installer` for PHPStan extensions. Configure `drupol/php-conventions` to skip redundant tasks (e.g., `phpcsfixer` if using `pint`) and focus on static analysis.
Can I run specific checks (e.g., only PHPStan) in a Laravel project?
Yes, use GrumPHP’s `--testsuite` or `--tasks` flags. For example, run `vendor/bin/grumphp run --tasks=phpstan` to target only static analysis, or `--testsuite=cs` for code style checks.
What alternatives exist for Laravel projects needing code conventions?
Consider `laravel/pint` for formatting, `phpstan/extension-installer` for PHPStan, or `dealerdirect/phpcodesniffer-composer-installer` for PHPCS. For all-in-one solutions, `drupol/php-conventions` combines these but lacks Laravel-specific features.
How do I handle rule violations in a Laravel team workflow?
Configure GrumPHP to fail builds on violations (CI) or block commits (Git hooks). For Laravel, document exceptions for legacy code or use `skip_tasks` temporarily. Pair with `rector/rector` to automate fixes for recurring issues.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
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