/** * Make Configuration object from plain content of sphinx configuration file * * @param string $stringConfiguration * @param Configuration $objectConfiguration * * @return Configuration * @throws \Hoa\Ustring\Exception * @throws \LTDBeget\sphinx\configurator\exceptions\SectionException * @throws \LogicException * @throws \InvalidArgumentException * @throws \LTDBeget\sphinx\configurator\exceptions\ConfigurationException * @throws \LTDBeget\sphinx\configurator\exceptions\DeserializeException * @throws \BadMethodCallException * @throws \LTDBeget\sphinx\SyntaxErrorException */ public static function deserialize(string $stringConfiguration, Configuration $objectConfiguration) : Configuration { return ArrayDeserializer::deserialize(Tokenizer::tokenize($stringConfiguration), $objectConfiguration); }
/** * @param array $plainData * @param eVersion $version * * @return Configuration * @throws \LTDBeget\sphinx\configurator\exceptions\SectionException * @throws \LogicException * @throws \InvalidArgumentException * @throws \BadMethodCallException * @throws \LTDBeget\sphinx\configurator\exceptions\ConfigurationException * @throws \LTDBeget\sphinx\configurator\exceptions\DeserializeException * @throws \Symfony\Component\Yaml\Exception\ParseException * @throws \LTDBeget\sphinx\informer\exceptions\DocumentationSourceException */ public static function fromArray(array $plainData, eVersion $version) : Configuration { return ArrayDeserializer::deserialize($plainData, new self($version)); }
/** * Make Configuration object from json encoded content of sphinx configuration file * * @param string $jsonConfiguration * @param Configuration $objectConfiguration * * @return Configuration * @throws \LTDBeget\sphinx\configurator\exceptions\SectionException * @throws \LogicException * @throws \InvalidArgumentException * @throws \BadMethodCallException * @throws \LTDBeget\sphinx\configurator\exceptions\ConfigurationException * @throws \LTDBeget\sphinx\configurator\exceptions\DeserializeException */ public static function deserialize(string $jsonConfiguration, Configuration $objectConfiguration) : Configuration { return ArrayDeserializer::deserialize(json_decode($jsonConfiguration, true), $objectConfiguration); }