original_string: public function create() {
          switch($this->info[2]) {
              case IMAGETYPE_JPEG:
                  $this->resource = imagecreatefromjpeg($this->file);
                  break;
              case IMAGETYPE_GIF:
                  $this->resource = imagecreatefromgif($this->file);
                  break;
              case IMAGETYPE_PNG:
                  $this->resource = imagecreatefrompng($this->file);
                  break;
              default:
                  throw new Exception('Image type is not supported');
                  break;
          }
      }
code: public function create() {
          switch($this->info[2]) {
              case IMAGETYPE_JPEG:
                  $this->resource = imagecreatefromjpeg($this->file);
                  break;
              case IMAGETYPE_GIF:
                  $this->resource = imagecreatefromgif($this->file);
                  break;
              case IMAGETYPE_PNG:
                  $this->resource = imagecreatefrompng($this->file);
                  break;
              default:
                  throw new Exception('Image type is not supported');
                  break;
          }
      }
code_tokens: public function create ( ) { switch ( $ this -> info [ 2 ] ) { case IMAGETYPE_JPEG : $ this -> resource = imagecreatefromjpeg ( $ this -> file ) ; break ; case IMAGETYPE_GIF : $ this -> resource = imagecreatefromgif ( $ this -> file ) ; break ; case IMAGETYPE_PNG : $ this -> resource = imagecreatefrompng ( $ this -> file ) ; break ; default : throw new Exception ( 'Image type is not supported' ) ; break ; } }
docstring: Create an image resource
docstring_tokens: Create an image resource