Puli\Manager\Module\RootModuleFileConverter::fromJson PHP Method

fromJson() public method

public fromJson ( $jsonData, array $options = [] )
$options array
    public function fromJson($jsonData, array $options = array())
    {
        $path = isset($options['path']) ? $options['path'] : null;
        $baseConfig = isset($options['baseConfig']) ? $options['baseConfig'] : null;
        Assert::isInstanceOf($jsonData, 'stdClass');
        Assert::nullOrString($path, 'The "path" option should be null or a string. Got: %s');
        Assert::nullOrIsInstanceOf($baseConfig, 'Puli\\Manager\\Api\\Config\\Config', 'The "baseConfig" option should be null or an instance of %2$s. Got: %s');
        $moduleFile = new RootModuleFile(null, $path, $baseConfig);
        $moduleFile->setVersion($this->versioner->parseVersion($jsonData));
        $this->addJsonToModuleFile($jsonData, $moduleFile);
        $this->addJsonToRootModuleFile($jsonData, $moduleFile);
        return $moduleFile;
    }