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

Code Style Laravel Package

yiisoft/code-style

Coding style and quality tools for PHP projects from Yii. Provides configuration and presets to keep code formatting consistent and enforce standards across your repository, helping teams maintain clean, readable code with automated checks.

View on GitHub
Deep Wiki
Context7

Latest Stable Version Total Downloads Build status Code Coverage Static analysis type-coverage psalm-level

A package that provides PHP CS Fixer rule sets for enforcing code style in Yii packages.

Requirements

  • PHP 7.4 or higher.

Installation

The package could be installed with Composer:

composer require --dev yiisoft/code-style

General usage

The package contains the following sets of rules:

  1. @Yiisoft/Core
  2. @Yiisoft/Core:risky

An example configuration using these rule sets:

<?php

declare(strict_types=1);

use PhpCsFixer\Finder;
use Yiisoft\CodeStyle\ConfigBuilder;

$finder = (new Finder())->in([
    __DIR__ . '/src',
    __DIR__ . '/tests',
]);

return ConfigBuilder::build()
    ->setRiskyAllowed(true)
    ->setRules([
        '@Yiisoft/Core' => true,
        '@Yiisoft/Core:risky' => true,
    ])
    ->setFinder($finder);

Documentation

If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.

License

The Yii Code Style is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

Credits

The package is inspired by spiral/code-style repository.

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
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
uri-template/tests