src/Pipe/ConverterPipe.php
public static function createConverter($element)
    {
        if (is_callable($element)) {
            $converter = new CallbackConverter($element);
        } elseif (self::hasElementCallbackConverter($element)) {
            $converter = new CallbackConverter($element['converter']);
        } elseif ($element instanceof ConverterInterface) {
            $converter = $element;
        } elseif (self::hasElementConverter($element)) {
            $converter = $element['converter'];
        } else {
            throw new InvalidArgumentException('Workflow::addConverter() must be called with either an instance of '.
                                               '"Plum\Plum\Converter\ConverterInterface" or with an array that '.
                                               'contains "converter".');
        }

        $pipe            = new self($element);
        $pipe->converter = $converter;

        return $pipe;
    }
public static function createConverter($element)
    {
        if (is_callable($element)) {
            $converter = new CallbackConverter($element);
        } elseif (self::hasElementCallbackConverter($element)) {
            $converter = new CallbackConverter($element['converter']);
        } elseif ($element instanceof ConverterInterface) {
            $converter = $element;
        } elseif (self::hasElementConverter($element)) {
            $converter = $element['converter'];
        } else {
            throw new InvalidArgumentException('Workflow::addConverter() must be called with either an instance of '.
                                               '"Plum\Plum\Converter\ConverterInterface" or with an array that '.
                                               'contains "converter".');
        }

        $pipe            = new self($element);
        $pipe->converter = $converter;

        return $pipe;
    }
@param ConverterInterface|callable|array $element

@return ConverterPipe