public function convertSource(SourceInterface $source): void
    {
        $converters = $source->data()->get('converters');
        if (!$converters || !is_array($converters)) {
            $converters = ['null'];
        }

        foreach ($converters as $converter) {
            $this->eventDispatcher->dispatch(
                Sculpin::EVENT_BEFORE_CONVERT,
                new ConvertEvent($source, $converter, $this->formatterManager->defaultFormatter())
            );
            $this->converter($converter)->convert(new SourceConverterContext($source));
            $this->eventDispatcher->dispatch(
                Sculpin::EVENT_AFTER_CONVERT,
                new ConvertEvent($source, $converter, $this->formatterManager->defaultFormatter())
            );
        }
    }
public function convertSource(SourceInterface $source): void
    {
        $converters = $source->data()->get('converters');
        if (!$converters || !is_array($converters)) {
            $converters = ['null'];
        }

        foreach ($converters as $converter) {
            $this->eventDispatcher->dispatch(
                Sculpin::EVENT_BEFORE_CONVERT,
                new ConvertEvent($source, $converter, $this->formatterManager->defaultFormatter())
            );
            $this->converter($converter)->convert(new SourceConverterContext($source));
            $this->eventDispatcher->dispatch(
                Sculpin::EVENT_AFTER_CONVERT,
                new ConvertEvent($source, $converter, $this->formatterManager->defaultFormatter())
            );
        }
    }
public function convertSource ( SourceInterface $ source ) : void { $ converters = $ source -> data ( ) -> get ( 'converters' ) ; if ( ! $ converters || ! is_array ( $ converters ) ) { $ converters = [ 'null' ] ; } foreach ( $ converters as $ converter ) { $ this -> eventDispatcher -> dispatch ( Sculpin :: EVENT_BEFORE_CONVERT , new ConvertEvent ( $ source , $ converter , $ this -> formatterManager -> defaultFormatter ( ) ) ) ; $ this -> converter ( $ converter ) -> convert ( new SourceConverterContext ( $ source ) ) ; $ this -> eventDispatcher -> dispatch ( Sculpin :: EVENT_AFTER_CONVERT , new ConvertEvent ( $ source , $ converter , $ this -> formatterManager -> defaultFormatter ( ) ) ) ; } }
Convert a source to the output.

The converter does not save anything but trigger an event
Convert a source to the output .