ongr-archive / ongr-strict-standard

[NOT MAINTAINED] Strict PHPCS standard for PSR-2 code based on Squiz standards
MIT License
13 stars 14 forks source link

One comment per params not align 1.0~ #105

Closed audriusrudalevicius closed 9 years ago

audriusrudalevicius commented 9 years ago

In this situation when I have only one comment on parameters I got warning: The comments for parameters $input_data (1) and $period (2) do not align

    /**
     * Calculate moving average.
     *
     * @param int[] $input_data
     * @param int   $period Smoothing window.
     * @param int   $xEnd

same for

    /**
     * Calculate moving average.
     *
     * @param int[] $input_data
     * @param int   $period Smoothing window.
     * @param int   $xEnd   Stop count.
tautrimas commented 9 years ago

I believe, this issue should be attributed upstream to https://github.com/squizlabs/PHP_CodeSniffer itself.

mansimas commented 9 years ago
    /**
     * Calculate moving average.
     *
     * @param int[] $input_data
     * @param int   $period Smoothing window.
     * @param int   $xEnd   Stop count.

It is fixed in 2.0. Should be aligned to $input_data (longest parameter name of all parameters in list). Parameter comments not required, but if exist, it must be aligned as after longest parameter name in list.

    /**
     * Calculate moving average.
     *
     * @param int[] $input_data
     * @param int   $period      Smoothing window.
     * @param int   $xEnd        Stop count.