dsasd12314 2011-01-18 04:56
浏览 45
已采纳

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.

  • 写回答

1条回答 默认 最新

  • doulei6778 2011-01-18 06: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 
     */
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部