XMe*_*Men 10 php coding-style codesniffer
我使用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)
{
}
Run Code Online (Sandbox Code Playgroud)
请建议,为什么它没有显示,第一个和第二个不对齐的问题是什么.
rik*_*rik 18
在最长的变量名称后预计有1个空格
在您的代码中,最长的变量名称$sourceUrl后跟2个空格.
编辑:这是它应该如何工作(至少这个错误应该消失).我在重要的地方用空格点.
/**
* for generating thumbnail
*
* @param.int....$minSize...an integer to size of thumbnail
* @param.string.$sourceUrl.the string to source url
*
* @return int the integer
*/
Run Code Online (Sandbox Code Playgroud)