code: protected function processSize($size)
      {
          if ($size === null) {
              return $size;
          }
  
          $size = (int)$size;
          if ($size <= 0) {
              throw new InvalidArgumentException('Size has to be larger than 0');
          }
  
          return (int)$size;
      }
docs: Verify and cast the required size of the images.
  
  @param integer $size Size (width and height in pixels) of the image.
  NULL for the default width.
  
  @return integer Size
  
  @throws InvalidArgumentException When a size <= 0 is given