\phpDocumentor\Plugin\Scrybe\ConverterFactory

This factory attempts to create a converter given an input and output format and return that.

use phpDocumentor\Plugin\Scrybe\Converter\ConverterFactory; use phpDocumentor\Plugin\Scrybe\Converter\Format\Format;

$converter_factory = new ConverterFactory();
$converter = $converter_factory->get(
    Format::MARKDOWN, Format::HTML
);

Summary

Methods
Properties
Constants
__construct()
get()
getSupportedInputFormats()
setConverters()
No public properties found
No constants found
getDefaultDefinitionFactory()
setDefinitionFactory()
$definition_factory
$converters
$logger
N/A
No private methods found
No private properties found
N/A

Properties

$logger

$logger : \Monolog\Logger

Type

\Monolog\Logger

Methods

__construct()

__construct(array<mixed,string>  $converters, \phpDocumentor\Plugin\Scrybe\Converter\Definition\Factory|null  $definition_factory, \Monolog\Logger  $logger) 

Constructs a new factory.

A Definition\Factory may optionally be passed to provide an alternate method of creating Definitions or to construct the Definition\Factory with a different Format\Collection to influence the possible options.

Parameters

array<mixed,string> $converters
\phpDocumentor\Plugin\Scrybe\Converter\Definition\Factory|null $definition_factory
\Monolog\Logger $logger

get()

get(string  $input_format, string  $output_format) : \phpDocumentor\Plugin\Scrybe\Converter\ConverterInterface

Retrieves a new instance of the converter necessary to convert the give input format to the given output format.

Parameters

string $input_format
string $output_format

Throws

\phpDocumentor\Plugin\Scrybe\Converter\Exception\ConverterNotFoundException

Returns

\phpDocumentor\Plugin\Scrybe\Converter\ConverterInterface

getSupportedInputFormats()

getSupportedInputFormats(string  $given_output_format) : array<mixed,string>

Returns a list of supported input formats for the given output format.

Parameters

string $given_output_format

A format definition per the constants in the Format class.

Returns

array<mixed,string> —

An array of format definitions per the constantst in the Format class.

getDefaultDefinitionFactory()

getDefaultDefinitionFactory() : \phpDocumentor\Plugin\Scrybe\Converter\Definition\Factory

Method used to retrieve the default Definition Factory.

This is used when the user has not provided their own definition factory in the constructor.

Returns

\phpDocumentor\Plugin\Scrybe\Converter\Definition\Factory