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 Standard Laravel Package

brandembassy/coding-standard

Opinionated PHP coding standard ruleset for enforcing consistent code style across projects. Built on common tooling (e.g., PHP_CodeSniffer) to simplify linting in CI and local development, helping teams keep formatting and conventions uniform.

View on GitHub
Deep Wiki
Context7

Brand Embassy Coding Standard

Standards

For full reference of enforcements, go through default-ecs.php where each sniff / fixer deviating from default set lists is briefly described.

@TODO list of important sniffs

Skippable sniffs / fixers

Skipping of sniffs / fixers in general or for particular files should be configured in the ecs.php of your project. This file should leverage the default-ecs.php as the default configuration, but it expected that you will make adjustments to fit your project needs.

Installation

You can install the Brand Embassy Coding Standard as a composer dependency to your project:

$ composer require --dev brandembassy/coding-standard

ECS

You can run ecs with this command (without performing automatic fixes):

$ ./vendor/bin/ecs check --ansi

Or with automatic fixes:

$ ./vendor/bin/ecs check --ansi --fix

You can use the --clear-cache option to clear the cache before applying the fixers and sniffers:

$ ./vendor/bin/ecs check --ansi --fix --clear-cache

PHPStan

To use default configuration include default-phpstan.neon in your project's PHPStan config:

includes:
    - vendor/brandembassy/coding-standard/integration-phpstan.neon

Rector

To use default configuration require default-rector.php in your project's Rector config:

$rectorConfigBuilder = RectorConfig::configure();
$defaultRectorConfigurationSetup = require __DIR__ . '/vendor/brandembassy/coding-standard/default-rector.php';

$defaultSkipList = $defaultRectorConfigurationSetup($rectorConfigBuilder);

// You can skip unwanted rules here
$skipList = array_merge(
    $defaultSkipList,
    [
        '*/__fixtures__/*',
        NewlineAfterStatementRector::class, // might conflict with ECS
    ],
);

// You can override/append to the default configuration here
$rectorConfigBuilder
    ->withPHPStanConfigs([__DIR__ . '/phpstan.neon'])
    ->withCache('./var/temp/rector', FileCacheStorage::class)
    ->withSkip($skipList);

return $rectorConfigBuilder;

PhpStorm

This project contains inspections and code style configurations for PhpStorm.

  • BrandEmbassyCodeStyle.xml
  • BrandEmbassyInspections.xml

Importing these configurations reduces number of errors in phpcs check before committing.

Versioning

This library follows semantic versioning, and additions to the code ruleset are only performed in major releases.

Testing

@TODO: inspiration - https://github.com/doctrine/coding-standard/tree/master/tests

If you are contributing to the Brand Embassy Coding Standard and want to test your contribution, you just need to execute PHPCS with the tests folder and ensure it matches the expected report:

$ ./vendor/bin/phpcs tests/input --report=summary --report-file=phpcs.log; diff tests/expected_report.txt phpcs.log
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.
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
spatie/mailcoach-vapor