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

symplify/coding-standard

Ready-to-use PHP CS Fixer and PHP_CodeSniffer rules bundled as a coding standard, with Symplify tooling integration. Helps keep projects consistent, modern, and clean with configurable rule sets suited for CI and team workflows.

View on GitHub
Deep Wiki
Context7

Coding Standard

Downloads

Coding standard rules for clean, consistent, and readable PHP code. No configuration needed—just install and let it handle the rest.

They run best with ECS.

Install

composer require symplify/coding-standard --dev
composer require phpecs/phpecs --dev
  1. Register in ECS config:
 # ecs.php
 use Symplify\EasyCodingStandard\Config\ECSConfig;
 use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

 return ECSConfig::configure()
     ->withSets([SetList::SYMPLIFY]);
  1. And run:
# dry-run without changes
vendor/bin/ecs


# apply changes
vendor/bin/ecs --fix

12 Rules to Keep Your Code Clean

ArrayListItemNewlineFixer

Indexed PHP array item has to have one line per item

-$value = ['simple' => 1, 'easy' => 2];
+$value = ['simple' => 1,
+'easy' => 2];

ArrayOpenerAndCloserNewlineFixer

Indexed PHP array opener [ and closer ] must be on own line

-$items = [1 => 'Hey'];
+$items = [
+1 => 'Hey'
+];

BlankLineAfterStrictTypesFixer

Strict type declaration has to be followed by empty line

 declare(strict_types=1);
+
 namespace App;

LineLengthFixer

Array items, method parameters, method call arguments, new arguments should be on same/standalone line to fit line length.

:wrench: configure it!

-function some($veryLong, $superLong, $oneMoreTime)
-{
+function some(
+    $veryLong,
+    $superLong,
+    $oneMoreTime
+) {
 }

-function another(
-    $short,
-    $now
-) {
+function another($short, $now) {
 }

MethodChainingNewlineFixer

Each chain method call must be on own line

-$someClass->firstCall()->secondCall();
+$someClass->firstCall()
+->secondCall();

ParamReturnAndVarTagMalformsFixer

Fixes @param, @return, @var and inline @var annotations broken formats

 /**
- * @param string
+ * @param string $name
  */
 function getPerson($name)
 {
 }

RemovePropertyVariableNameDescriptionFixer

Remove docblock descriptions which duplicate their property name

 /**
- * @var string $name
+ * @var string
  */
 private $name;

RemoveMethodNameDuplicateDescriptionFixer

Remove docblock descriptions which duplicate their method name

 /**
- * Get name
  *
  * @return string
  */
 function getName()
 {
 }

RemovePHPStormAnnotationFixer

Remove "Created by PhpStorm" annotations

-/**
- * Created by PhpStorm.
- * User: ...
- * Date: 17/10/17
- * Time: 8:50 AM
- */
 class SomeClass
 {
 }

RemoveUselessDefaultCommentFixer

Remove useless PHPStorm-generated @todo comments, redundant "Class XY" or "gets service" comments etc.

-/**
- * class SomeClass
- */
 class SomeClass
 {
-    /**
-     * SomeClass Constructor.
-     */
     public function __construct()
     {
-        // TODO: Change the autogenerated stub
-        // TODO: Implement whatever() method.
     }
 }

SpaceAfterCommaHereNowDocFixer

Add space after nowdoc and heredoc keyword, to prevent bugs on PHP 7.2 and lower, see https://laravel-news.com/flexible-heredoc-and-nowdoc-coming-to-php-7-3

 $values = [
     <<<RECTIFY
 Some content
-RECTIFY,
+RECTIFY
+,
     1000
 ];

StandaloneLineConstructorParamFixer

Constructor param should be on a standalone line to ease git diffs on new dependency

 final class PromotedProperties
 {
-    public function __construct(int $age, string $name)
-    {
+    public function __construct(
+        int $age,
+        string $name
+    ) {
     }
 }

StandaloneLineInMultilineArrayFixer

Indexed arrays must have 1 item per line

-$friends = [1 => 'Peter', 2 => 'Paul'];
+$friends = [
+    1 => 'Peter',
+    2 => 'Paul'
+];

StandaloneLinePromotedPropertyFixer

Promoted property should be on standalone line

 final class PromotedProperties
 {
-    public function __construct(public int $age, private string $name)
-    {
+    public function __construct(
+        public int $age,
+        private string $name
+    ) {
     }
 }
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4