Search by

hipsterjazzbo / php-style

HipsterJazzbo

Shared PHP-CS-Fixer configuration for HipsterJazzbo projects.

Package info

github.com/hipsterjazzbo/php-style

pkg:composer/hipsterjazzbo/php-style

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2026-10-01 22:23 UTC

This package is auto-updated.

Last update: 2026-10-01 22:29:18 UTC


README

Shared PHP-CS-Fixer rules for my PHP projects.

The package owns the common rules. Each project still owns its own Finder, so repositories can decide which directories should be formatted.

Install

Once the package is available on Packagist:

composer require --dev hipsterjazzbo/php-style:^0.1

Before the first Packagist release is indexed, Composer can install directly from GitHub by adding this repository as a VCS source and requiring dev-main.

Use

Create .php-cs-fixer.dist.php in the consuming project:

<?php

declare(strict_types=1);

use HipsterJazzbo\PhpStyle\PhpStyle;
use PhpCsFixer\Finder;

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

return PhpStyle::config($finder);

Project-specific overrides

A project can replace individual shared rules without copying the whole configuration:

return PhpStyle::config($finder, [
    'blank_line_before_statement' => [
        'statements' => ['return', 'throw'],
    ],
]);

Or use PhpStyle::rules() directly when a repository needs to build a more unusual Config.

What this does not enforce

PHP-CS-Fixer can format declaration docblocks, but it does not prove that every declaration has a useful human-readable description.

Repositories that require descriptive PHPDoc should keep a separate parser/AST-based documentation check for that policy.