code: public static function getContent($image)
      {
          switch (true) {
              case self::isUrl($image):
                  return self::getOnlineImageContent($image);
              case self::isImage($image):
                  return file_get_contents($image);
              case self::isResource($image):
                  return stream_get_contents($image);
              case self::isSplFileInfo($image):
                  return file_get_contents($image->getRealPath());
              case self::isString($image):
                  // When the image was String type, We just think it's a local image
                  // And he does not exist
                  throw new RuntimeException("file {$image} has not exist.");
              default:
                  throw new RuntimeException('not support image type.');
          }
      }
docs: Get image Content, support url/file/SplFileInfo
  
  @param  string|\SplFileInfo|Resource $image
  
  @return string