dsasd12314
dsasd12314
2011-01-18 12:56
浏览 35
已采纳

php代码嗅探器中的@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 imgThumbs($minSize, $sourceUrl)
{   
}

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

图片转代码服务由CSDN问答提供 功能建议

我正在使用php代码嗅探器来实现一个函数,我想添加@param标签,但是它给了我对齐错误 第一个和第二个参数。

  / ** 
 *用于生成缩略图
 * 
 * @param int $ minSize一个整数到缩略图的大小
 * @  param string $ sourceUrl字符串来源url 
 * 
 * @return整数
 * / 
 
函数imgThumbs($ minSize,$ sourceUrl)
 {
} 
   
 
 

请建议,为什么它没有显示的问题是什么,第一个和第二个没有对齐。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doulei6778
    doulei6778 2011-01-18 14:53
    已采纳

    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 
     */
    
    点赞 评论

相关推荐