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

Imbo Coding Standard Laravel Package

imbo/imbo-coding-standard

PHP-CS-Fixer ruleset for Imbo and related PHP projects. Install as a dev dependency, add a .php-cs-fixer.dist.php config, and run php-cs-fixer check/fix locally or in GitHub Actions/Composer scripts to enforce consistent code style.

View on GitHub
Deep Wiki
Context7

Imbo Coding Standard

This is the PHP coding standard for the Imbo project and other related tools. The ruleset is enforced using the PHP Coding Standards Fixer tool.

How to setup

First, add this package and php-cs-fixer as development dependencies:

composer require --dev imbo/imbo-coding-standard ^3.0 friendsofphp/php-cs-fixer

then, create a configuration file named .php-cs-fixer.dist.php local to your repository that includes the following:

<?php declare(strict_types=1);
require 'vendor/autoload.php';

$finder = new PhpCsFixer\Finder();
$config = new Imbo\CodingStandard\Config();

return $config
    ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
    ->setFinder($finder->in(__DIR__)->append([__FILE__]));

Now you can run the following command to check the coding standard in your project:

vendor/bin/php-cs-fixer check --diff

Add step in the GitHub workflow

All Imbo-related projects use GitHub workflows, and checking the coding standard should be a part of that workflow:

name: CI
on: push
jobs:
  php-cs-fixer:
    runs-on: ubuntu-latest
    name: Check coding standard
    steps:
      - uses: actions/checkout@v6
      - uses: shivammathur/setup-php@v2
      - run: composer install
      - run: vendor/bin/php-cs-fixer check --diff

Add scripts for Composer

All Imbo-related projects use Composer, and checking / fixing coding standard violations should be done using Composer scripts in composer.json:

{
  "scripts": {
    "cs": "vendor/bin/php-cs-fixer check --diff",
    "cs:fix": "vendor/bin/php-cs-fixer fix --diff"
  }
}

Managed repositories

The .github/repos.json file contains a list of repositories that use this coding standard. This list is used by the GitHub workflows to:

  • Preview diffs on pull requests to show what changes a coding standard update would cause.
  • Automatically create pull requests with fixes when a new version is tagged.

To add or remove a repository, edit the JSON file.

License

MIT, see 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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
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