@param tag alignment in php code sniffer

I use php code sniffer for function, I want to add @param tag, but it gives me alignment error of the first and second parameters.

/** * for generating thumbnail * * @param int $minSize an integer to size of thumbnail * @param string $sourceUrl the string to source url * * @return int the integer */ function imgThumbs($minSize, $sourceUrl) { } 

please suggest what the problem is, why it is not displayed, the first and second are not aligned.

+8
coding-style php codesniffer
source share
1 answer

Expected 1 space after the longest variable name

In your code, the longest variable name $sourceUrl followed by 2 spaces .

Edit: This is how it should work (at least this error should go away). I used dots for spaces in important places.

 /** * for generating thumbnail * * @param.int....$minSize...an integer to size of thumbnail * @param.string.$sourceUrl.the string to source url * * @return int the integer */ 
+17
source share

Source: https://habr.com/ru/post/651204/


All Articles