简体   繁体   English

php代码嗅探器中的@param标记对齐

[英]@param tag alignment in php code sniffer

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. 我使用PHP代码嗅探器的功能,我想添加@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 imgThumbs($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 在最长的变量名称后预计有1个空格

In your code the longest variable name $sourceUrl is followed by 2 spaces . 在您的代码中,最长的变量名$sourceUrl后跟2个空格

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 
 */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM