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

Installs: 816

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/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: 2025-10-06 20:45:25 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,
    ])
    // ...
    ;