开发者

@param tag alignment in php code sniffer

开发者 https://www.devze.com 2023-02-05 02:29 出处:网络
I am using php code sniffer for a function, i want to add @param tag but it is giving me alignment error of first and second param.

I am using php code sniffer for a function, i want to add @param tag but it is giving me alignment error of first and second param.

/**
 * 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 imgThu开发者_运维百科mbs($minSize, $sourceUrl)
{   
}

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


Expected 1 space after the longest variable name

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

Edit: Here is how it should work (at least this error should disappear). I used dots for spaces at the 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 
 */
0

精彩评论

暂无评论...
验证码 换一张
取 消