adamwojs/php-cs-fixer-one-line-var-phpdoc

Maintainers

Package info

github.com/adamwojs/php-cs-fixer-phpdoc-force-single-line-var

pkg:composer/adamwojs/php-cs-fixer-one-line-var-phpdoc

Statistics

Installs: 816

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master / 1.0.x-dev 2019-06-29 12:50 UTC

This package is not auto-updated.

Last update: 2026-03-09 23:06:55 UTC


README

php-cs-fixer rule to force using Single line @var phpdoc if no additional description provided.

Usage

In your .php_cs file:

<?php

// PHP-CS-Fixer 2.x syntax
return PhpCsFixer\Config::create()
    // (1) Register \AdamWojs\PhpCsFixerSingleLineVarPhpdoc\Fixer\Phpdoc\SingleLineVarPhpDocFixer fixer
    ->registerCustomFixers([
        new \AdamWojs\PhpCsFixerSingleLineVarPhpdoc\Fixer\Phpdoc\SingleLineVarPhpDocFixer(),
    ])
    ->setRules([
        // ... 
        // (2) Enable AdamWojs/phpdoc_force_single_line_var rule
        'AdamWojs/phpdoc_force_single_line_var' => true,
    ])
    // ...
    ;