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

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

This package is not auto-updated.

Last update: 2024-11-04 16:01:44 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,
    ])
    // ...
    ;