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

Easy Coding Standard Laravel Package

contao/easy-coding-standard

Adds Easy Coding Standard support for Contao projects, providing a ready-to-use ECS configuration and rules to enforce consistent PHP coding style and quality checks across your codebase, helping keep formatting and standards aligned in CI and local workflows.

View on GitHub
Deep Wiki
Context7

EasyCodingStandard configurations for Contao

This package includes the EasyCodingStandard configuration for Contao.

Installation

Add the package to your Contao installation via Composer:

composer require contao/easy-coding-standard --dev

Usage

Create a file named ecs.php in the root directory of your project.

<?php

declare(strict_types=1);

use Contao\EasyCodingStandard\Set\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
    ->withSets([SetList::CONTAO])
    // Adjust the configuration according to your needs.
;

Then run the script like this:

vendor/bin/ecs check

What's inside?

The package contains the following custom fixers:

Class Description
AssertEqualsFixer Replaces asserEquals() with assertSame() in unit tests unless the method is used to compare two objects.
CaseCommentIndentationFixer Fixes the comment indentation before a case statement.
ChainedMethodBlockFixer Adds an empty line after a block of chained method calls.
CommentLengthFixer Adjusts the length of comments regardless of their indentation so that each line is about 80 characters long.
ExpectsWithCallbackFixer Adjusts the indentation of $this->callback() calls inside the with() method of a unit test.
FindByPkFixer Replaces findByPk() calls with findById().
FunctionCallWithMultilineArrayFixer Fixes the indentation of function calls with multi-line array arguments.
InlinePhpdocCommentFixer Ensures that inline phpDoc comments are not converted to regular comments.
IsArrayNotEmptyFixer Fixes the order of isset() and empty() calls in conjunction with is_array() checks.
MockMethodChainingIndentationFixer Fixes the indentation of chained mock methods.
MultiLineIfIndentationFixer Fixes the indentation of multi-line if statements.
MultiLineLambdaFunctionArgumentsFixer Fixes the indentation of multi-line lambda function arguments.
NoExpectsThisAnyFixer Removes the explicit any() assertion in unit tests.
NoLineBreakBetweenMethodArgumentsFixer Fixes the indentation of method declarations.
NoSemicolonAfterShortEchoTagFixer Removes the semicolon after short echo tag instructions.
SingleLineConfigureCommandFixer Fixes the indentation of Symfony command arguments and options.
TypeHintOrderFixer Fixes the type hint order in method declarations.

The package contains the following custom sniffs:

Class Description
ContaoFrameworkClassAliasSniff Prevents using aliased Contao classes instead of their originals.
SetDefinitionCommandSniff Prevents using the setDefinition() method in Symfony commands.
UseSprintfInExceptionsSniff Prevents using string interpolation in exception messages.

License

Contao is licensed under the terms of the LGPLv3.

Getting support

Visit the support page to learn about the available support options.

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