11

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.

hakre
  • 193,403
  • 52
  • 435
  • 836
XMen
  • 29,384
  • 41
  • 99
  • 151

1 Answers1

18

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 
 */
rik
  • 8,592
  • 1
  • 26
  • 21
  • its not working ,Please, can you give me format of two variable with written space and tab where to give , and one variable is longer than other ,Please write space don't give actual spaces , Please confirm your understanding – XMen Jan 19 '11 at 06:49