src/ConfigurationFactory.php
public function factoryFromString($data, $format = 'json', $params = null, $paramsFile = null)
    {

        // initialize the JMS serializer, load and return the configuration
        $data = $this->toArray($data, Configuration::class, $format);

        // merge the params, if specified with the --params option
        if ($params) {
            $this->mergeParams(
                $data,
                $this->toArray(
                    $params,
                    Params::class,
                    $format
                )
            );
        }

        // merge the param loaded from the file, if specified with the --params-file option
        if ($paramsFile && is_file($paramsFile)) {
            $this->mergeParams(
                $data,
                $this->toArray(
                    file_get_contents($paramsFile),
                    Params::class,
                    pathinfo($paramsFile, PATHINFO_EXTENSION)
                )
            );
        }

        // finally, create and return the configuration from the merge data
        return SerializerBuilder::create()->build()->fromArray($data, Configuration::class);
    }
public function factoryFromString($data, $format = 'json', $params = null, $paramsFile = null)
    {

        // initialize the JMS serializer, load and return the configuration
        $data = $this->toArray($data, Configuration::class, $format);

        // merge the params, if specified with the --params option
        if ($params) {
            $this->mergeParams(
                $data,
                $this->toArray(
                    $params,
                    Params::class,
                    $format
                )
            );
        }

        // merge the param loaded from the file, if specified with the --params-file option
        if ($paramsFile && is_file($paramsFile)) {
            $this->mergeParams(
                $data,
                $this->toArray(
                    file_get_contents($paramsFile),
                    Params::class,
                    pathinfo($paramsFile, PATHINFO_EXTENSION)
                )
            );
        }

        // finally, create and return the configuration from the merge data
        return SerializerBuilder::create()->build()->fromArray($data, Configuration::class);
    }
public function factoryFromString ( $ data , $ format = 'json' , $ params = null , $ paramsFile = null ) { // initialize the JMS serializer, load and return the configuration $ data = $ this -> toArray ( $ data , Configuration :: class , $ format ) ; // merge the params, if specified with the --params option if ( $ params ) { $ this -> mergeParams ( $ data , $ this -> toArray ( $ params , Params :: class , $ format ) ) ; } // merge the param loaded from the file, if specified with the --params-file option if ( $ paramsFile && is_file ( $ paramsFile ) ) { $ this -> mergeParams ( $ data , $ this -> toArray ( file_get_contents ( $ paramsFile ) , Params :: class , pathinfo ( $ paramsFile , PATHINFO_EXTENSION ) ) ) ; } // finally, create and return the configuration from the merge data return SerializerBuilder :: create ( ) -> build ( ) -> fromArray ( $ data , Configuration :: class ) ; }
Factory implementation to create a new initialized configuration instance.

@param string $data       The configuration data
@param string $format     The format of the configuration data, either one of json, yaml or xml
@param string $params     A serialized string with additional params that'll be passed to the configuration
@param string $paramsFile A filename that contains serialized data with additional params that'll be passed to the configuration

@return \TechDivision\Import\Configuration\Jms\Configuration The configuration instance
Factory implementation to create a new initialized configuration instance .