Weave 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

Psr12Ext Laravel Package

roslov/psr12ext

roslov/psr12ext provides an extended PSR-12 coding standard for PHP_CodeSniffer. It layers additional style and consistency sniffs on top of PSR-12, helping teams enforce stricter PHP formatting and catch more maintainability issues via PHPCS in local and CI workflows.

Deep Wiki
Context7

roslov/psr12ext

roslov/psr12ext is an extended PSR-12 coding standard for PHP_CodeSniffer. It builds on the official PSR-12 ruleset with additional checks for consistent, modern PHP code, helping teams catch style issues early and keep codebases uniform.

  • Drop-in PHP_CodeSniffer ruleset based on PSR-12
  • Adds stricter checks beyond the base standard
  • Easy Composer installation and configuration
  • Works with CI pipelines and editor integrations
  • Helps enforce consistent formatting across projects
Frequently asked questions about Psr12Ext
What is roslov/psr12ext and what does it do?
roslov/psr12ext is a Composer package that provides an extended PSR-12 coding standard for PHP_CodeSniffer. It builds on the base PSR-12 rules with stricter formatting and code-quality checks, making it useful for Laravel and general PHP projects. You install it as a development dependency and run PHP_CodeSniffer against your codebase using its ruleset.
How do I install roslov/psr12ext in a Laravel project?
Install it with Composer as a dev dependency, for example composer require --dev roslov/psr12ext. Because it is a coding-standard tool, it should not be required in production. After installation, point PHP_CodeSniffer at the standard provided by the package in your project ruleset.
How do I configure PHP_CodeSniffer to use the PSR-12 Extended standard?
Add the package's standard to your phpcs.xml or phpcs.xml.dist ruleset, typically with a rule reference such as PSR12Extended. Keep your own exclusions and file paths in the same ruleset so Laravel-specific directories are checked consistently. Run vendor/bin/phpcs to verify the configuration, and check the package README for the exact standard name if your version differs.
Does roslov/psr12ext work with Laravel Pint or PHP-CS-Fixer?
roslov/psr12ext is built for PHP_CodeSniffer, so it is not a drop-in replacement for Laravel Pint or PHP-CS-Fixer. Pint and PHP-CS-Fixer use their own fixer engines and configuration formats, although you can run them alongside PHP_CodeSniffer in a Laravel project. If you want automatic fixing, use the appropriate tool for that job and keep PHP_CodeSniffer for enforcement.
Which PHP and PHP_CodeSniffer versions does roslov/psr12ext require?
The package is a PHP_CodeSniffer standard, so your project needs PHP_CodeSniffer installed and a compatible PHP version. Exact PHP and PHP_CodeSniffer constraints are defined in the package composer.json and may change between releases. Check those constraints before adding it to an older Laravel application, and prefer a supported PHP version for your Laravel release.
How is roslov/psr12ext different from the built-in PSR-12 standard?
The built-in PSR-12 standard enforces the base PSR-12 specification, while roslov/psr12ext adds stricter rules for consistent formatting and code quality. That can catch more style issues out of the box, but it may also require more cleanup in existing codebases. Review the additional sniffs and adjust exclusions if your team needs a narrower ruleset.
Can I run roslov/psr12ext in CI for a Laravel application?
Yes, you can run PHP_CodeSniffer with the roslov/psr12ext standard in CI just like any other coding-standard check. Install dependencies with Composer and run vendor/bin/phpcs against your configured paths, failing the build on violations. This helps keep Laravel pull requests consistent without relying on manual review for formatting.
How do I exclude files or directories from the PSR-12 Extended ruleset?
Use the exclude-pattern or exclude elements in your phpcs.xml ruleset to skip generated, vendor, storage, or legacy directories. You can also pass --ignore patterns on the command line for one-off runs. Keep exclusions narrow so the extended PSR-12 checks still cover your application code.
What are alternatives to roslov/psr12ext for stricter PHP coding standards?
Alternatives include the built-in PSR-12 standard in PHP_CodeSniffer, slevomat/coding-standard for additional sniffs, Laravel Pint for opinionated automatic fixing, and PHP-CS-Fixer for configurable style rules. Each tool has different configuration and fixing behavior, so choose based on whether you need enforcement, auto-formatting, or both. roslov/psr12ext is a good fit when you specifically want an extended PSR-12 PHP_CodeSniffer ruleset.
Is roslov/psr12ext safe to use in production and how is it maintained?
Because roslov/psr12ext is a development-only coding-standard package, it does not ship runtime code to production. Its safety and maintenance depend on the package release history and its PHP_CodeSniffer compatibility, so check the repository and version constraints before adopting it. Pin a known-good version in composer.lock and update it deliberately as part of your tooling maintenance.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib