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

phlak/coding-standards

Predefined PHP-CS-Fixer coding standards by PHLAK. Install as a dev dependency, initialize via composer exec cs init or create a config using ConfigFactory with a Finder, then run php-cs-fixer. Supports adding or overriding rules via ConfigFactory::make().

View on GitHub
Deep Wiki
Context7

PHLAK's Coding Standards


Requirements

  • PHP

Installation

composer require --dev phlak/coding-standards

Usage

After installation you may initialze the coding standards configuration with the provided cs executable.

composer exec cs init

Alternatively you may manually create a .php-cs-fxer.dist.php file in the root folder with the following contents.

<?php

require __DIR__ . '/vendor/autoload.php';

$finder = PhpCsFixer\Finder::create()->in([
    // List of paths you wish to include
]);

return PHLAK\CodingStandards\ConfigFactory::make($finder);

Add the paths you wish to be coverd to the array.

Now you may run php-cs-fixer as normal.

Add / Override Rules

You can add additional rules or override pre-defined ones by passing them as the second parameter to the ConfigFactory::make() method. These rules will be merged with the pre-defined rules.

return PHLAK\CodingStandards\ConfigFactory::make($finder, [
    // Your additional rules here...
]);

Additional Configuration

Additional configuration can be achieved by chaining methods onto the ConfigFactory::make() method.

return PHLAK\CodingStandards\ConfigFactory::make($finder)
    ->setIndent("\t")
    ->setLineEnding("\r\n")
    ->setRiskyAllowed();

Changelog

A list of changes can be found on the GitHub Releases page.

Troubleshooting

For general help and support join our GitHub Discussions or reach out on Bluesky.

Please report bugs to the GitHub Issue Tracker.

Copyright

This project is licensed under the MIT License.

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
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
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation