original_string: public static function imageSize($file, $options)
      {
          if (!isset($options['height']) && !isset($options['width'])) {
              throw new InvalidArgumentException('Invalid image size validation parameters! Missing `width` and / or `height`.');
          }
  
          $filename = static::getFilename($file);
  
          list($width, $height) = getimagesize($filename);
  
          $validHeight = $validWidth = null;
  
          if (isset($options['height'])) {
              $validHeight = self::comparison($height, $options['height'][0], $options['height'][1]);
          }
          if (isset($options['width'])) {
              $validWidth = self::comparison($width, $options['width'][0], $options['width'][1]);
          }
          if ($validHeight !== null && $validWidth !== null) {
              return ($validHeight && $validWidth);
          }
          if ($validHeight !== null) {
              return $validHeight;
          }
          if ($validWidth !== null) {
              return $validWidth;
          }
  
          throw new InvalidArgumentException('The 2nd argument is missing the `width` and / or `height` options.');
      }
code: public static function imageSize($file, $options)
      {
          if (!isset($options['height']) && !isset($options['width'])) {
              throw new InvalidArgumentException('Invalid image size validation parameters! Missing `width` and / or `height`.');
          }
  
          $filename = static::getFilename($file);
  
          list($width, $height) = getimagesize($filename);
  
          $validHeight = $validWidth = null;
  
          if (isset($options['height'])) {
              $validHeight = self::comparison($height, $options['height'][0], $options['height'][1]);
          }
          if (isset($options['width'])) {
              $validWidth = self::comparison($width, $options['width'][0], $options['width'][1]);
          }
          if ($validHeight !== null && $validWidth !== null) {
              return ($validHeight && $validWidth);
          }
          if ($validHeight !== null) {
              return $validHeight;
          }
          if ($validWidth !== null) {
              return $validWidth;
          }
  
          throw new InvalidArgumentException('The 2nd argument is missing the `width` and / or `height` options.');
      }
code_tokens: public static function imageSize ( $ file , $ options ) { if ( ! isset ( $ options [ 'height' ] ) && ! isset ( $ options [ 'width' ] ) ) { throw new InvalidArgumentException ( 'Invalid image size validation parameters! Missing `width` and / or `height`.' ) ; } $ filename = static :: getFilename ( $ file ) ; list ( $ width , $ height ) = getimagesize ( $ filename ) ; $ validHeight = $ validWidth = null ; if ( isset ( $ options [ 'height' ] ) ) { $ validHeight = self :: comparison ( $ height , $ options [ 'height' ] [ 0 ] , $ options [ 'height' ] [ 1 ] ) ; } if ( isset ( $ options [ 'width' ] ) ) { $ validWidth = self :: comparison ( $ width , $ options [ 'width' ] [ 0 ] , $ options [ 'width' ] [ 1 ] ) ; } if ( $ validHeight !== null && $ validWidth !== null ) { return ( $ validHeight && $ validWidth ) ; } if ( $ validHeight !== null ) { return $ validHeight ; } if ( $ validWidth !== null ) { return $ validWidth ; } throw new InvalidArgumentException ( 'The 2nd argument is missing the `width` and / or `height` options.' ) ; }
docstring: Validates the size of an uploaded image.
  
  @param array|\Psr\Http\Message\UploadedFileInterface $file The uploaded file data from PHP.
  @param array $options Options to validate width and height.
  @return bool
  @throws \InvalidArgumentException
docstring_tokens: Validates the size of an uploaded image .