original_string: public function handle($data = null)
      {
  
          // Handle data with adaptor
          $adaptor = $this->getAdaptor();
          if ( $adaptor ) {
              $data = $adaptor->transform( $data, $this );
          }
  
          // Overwrite default data with data
          $data = array_merge( [
              'name'=>null,
              'width'=>null,
              'height'=>null,
              'focus_point_x'=>0,
              'focus_point_y'=>0,
              'resize'=>false,
          ], $data );
  
          // Create variables from array keys
          extract( $data );
  
          // Throw error if filename is not set
          if ( ! $name ) throw new \Exception( 'You need to set a name in adaptor' );
  
          // Throw error if both width and height is null
          if ( ! $width && ! $height ) throw new \Exception( 'The width or the height need to be set' );
  
          // Create handler
          $this->handler = ImageHandler::create( $name, $this->getBaseFolder(), $this->getCropsFolder() );
  
          // Check if we should resize or crop
          // If one of the width or height is _ This is still a resize
          if ( $resize || ( !$width || !$height ) ) {
              $this->handler->resize( $width, $height );
          }
          else {
              $this->handler->cropToFit( $width, $height, $focus_point_x, $focus_point_y );
          }
  
          // Return this for binding
          return $this;
      }
code: public function handle($data = null)
      {
  
          // Handle data with adaptor
          $adaptor = $this->getAdaptor();
          if ( $adaptor ) {
              $data = $adaptor->transform( $data, $this );
          }
  
          // Overwrite default data with data
          $data = array_merge( [
              'name'=>null,
              'width'=>null,
              'height'=>null,
              'focus_point_x'=>0,
              'focus_point_y'=>0,
              'resize'=>false,
          ], $data );
  
          // Create variables from array keys
          extract( $data );
  
          // Throw error if filename is not set
          if ( ! $name ) throw new \Exception( 'You need to set a name in adaptor' );
  
          // Throw error if both width and height is null
          if ( ! $width && ! $height ) throw new \Exception( 'The width or the height need to be set' );
  
          // Create handler
          $this->handler = ImageHandler::create( $name, $this->getBaseFolder(), $this->getCropsFolder() );
  
          // Check if we should resize or crop
          // If one of the width or height is _ This is still a resize
          if ( $resize || ( !$width || !$height ) ) {
              $this->handler->resize( $width, $height );
          }
          else {
              $this->handler->cropToFit( $width, $height, $focus_point_x, $focus_point_y );
          }
  
          // Return this for binding
          return $this;
      }
code_tokens: public function handle ( $ data = null ) { // Handle data with adaptor $ adaptor = $ this -> getAdaptor ( ) ; if ( $ adaptor ) { $ data = $ adaptor -> transform ( $ data , $ this ) ; } // Overwrite default data with data $ data = array_merge ( [ 'name' => null , 'width' => null , 'height' => null , 'focus_point_x' => 0 , 'focus_point_y' => 0 , 'resize' => false , ] , $ data ) ; // Create variables from array keys extract ( $ data ) ; // Throw error if filename is not set if ( ! $ name ) throw new \ Exception ( 'You need to set a name in adaptor' ) ; // Throw error if both width and height is null if ( ! $ width && ! $ height ) throw new \ Exception ( 'The width or the height need to be set' ) ; // Create handler $ this -> handler = ImageHandler :: create ( $ name , $ this -> getBaseFolder ( ) , $ this -> getCropsFolder ( ) ) ; // Check if we should resize or crop // If one of the width or height is _ This is still a resize if ( $ resize || ( ! $ width || ! $ height ) ) { $ this -> handler -> resize ( $ width , $ height ) ; } else { $ this -> handler -> cropToFit ( $ width , $ height , $ focus_point_x , $ focus_point_y ) ; } // Return this for binding return $ this ; }
docstring: Handle image based on array
  
  @return void
docstring_tokens: Handle image based on array