private function initializeWriter(WriterAbstract $writer, ProjectDescriptor $project)
    {
        $event = WriterInitializationEvent::createInstance($this)->setWriter($writer);
        Dispatcher::getInstance()->dispatch(self::EVENT_PRE_INITIALIZATION, $event);

        if ($writer instanceof Initializable) {
            $writer->initialize($project);
        }

        Dispatcher::getInstance()->dispatch(self::EVENT_POST_INITIALIZATION, $event);
    }
private function initializeWriter(WriterAbstract $writer, ProjectDescriptor $project)
    {
        $event = WriterInitializationEvent::createInstance($this)->setWriter($writer);
        Dispatcher::getInstance()->dispatch(self::EVENT_PRE_INITIALIZATION, $event);

        if ($writer instanceof Initializable) {
            $writer->initialize($project);
        }

        Dispatcher::getInstance()->dispatch(self::EVENT_POST_INITIALIZATION, $event);
    }
private function initializeWriter ( WriterAbstract $ writer , ProjectDescriptor $ project ) { $ event = WriterInitializationEvent :: createInstance ( $ this ) -> setWriter ( $ writer ) ; Dispatcher :: getInstance ( ) -> dispatch ( self :: EVENT_PRE_INITIALIZATION , $ event ) ; if ( $ writer instanceof Initializable ) { $ writer -> initialize ( $ project ) ; } Dispatcher :: getInstance ( ) -> dispatch ( self :: EVENT_POST_INITIALIZATION , $ event ) ; }
Initializes the given writer using the provided project meta-data.

This method wil call for the initialization of each writer that supports an initialization routine (as defined by
the `Initializable` interface).

In addition to this, the following events emitted for each writer that is present in the collected list of
transformations, even those that do not implement the `Initializable` interface.

Emitted events:

- transformer.writer.initialization.pre, before the initialization of a single writer.
- transformer.writer.initialization.post, after the initialization of a single writer.

@param WriterAbstract    $writer
@param ProjectDescriptor $project

@uses Dispatcher to emit the events surrounding an initialization.

@return void
Initializes the given writer using the provided project meta - data .