original_string: public function handle(UpdateMetricPointCommand $command)
      {
          $point = $command->point;
          $metric = $command->metric;
          $createdAt = $command->created_at;
  
          $data = [
              'metric_id' => $metric->id,
              'value'     => (float) $command->value,
          ];
  
          if ($createdAt) {
              $data['created_at'] = $this->dates->create('U', $createdAt)->format('Y-m-d H:i:s');
          }
  
          $point->update($data);
  
          event(new MetricPointWasUpdatedEvent($this->auth->user(), $point));
  
          return $point;
      }
code: public function handle(UpdateMetricPointCommand $command)
      {
          $point = $command->point;
          $metric = $command->metric;
          $createdAt = $command->created_at;
  
          $data = [
              'metric_id' => $metric->id,
              'value'     => (float) $command->value,
          ];
  
          if ($createdAt) {
              $data['created_at'] = $this->dates->create('U', $createdAt)->format('Y-m-d H:i:s');
          }
  
          $point->update($data);
  
          event(new MetricPointWasUpdatedEvent($this->auth->user(), $point));
  
          return $point;
      }
code_tokens: public function handle ( UpdateMetricPointCommand $ command ) { $ point = $ command -> point ; $ metric = $ command -> metric ; $ createdAt = $ command -> created_at ; $ data = [ 'metric_id' => $ metric -> id , 'value' => ( float ) $ command -> value , ] ; if ( $ createdAt ) { $ data [ 'created_at' ] = $ this -> dates -> create ( 'U' , $ createdAt ) -> format ( 'Y-m-d H:i:s' ) ; } $ point -> update ( $ data ) ; event ( new MetricPointWasUpdatedEvent ( $ this -> auth -> user ( ) , $ point ) ) ; return $ point ; }
docstring: Handle the update metric point command.
  
  @param \CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricPointCommand $command
  
  @return \CachetHQ\Cachet\Models\MetricPoint
docstring_tokens: Handle the update metric point command .