/** * @expectedException \LTDBeget\sphinx\informer\exceptions\InformerRuntimeException * @expectedExceptionMessage Sphinx of version 2.1.9 does't have section common */ public function testUnknownSection() { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $informer = Informer::get(eVersion::V_2_1_9()); /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $informer->getOptionInfo(eSection::COMMON(), eCommonOption::JSON_AUTOCONV_KEYNAMES()); }
/** * @param eSection $section * @param eVersion $version * * @return array * @throws \Symfony\Component\Yaml\Exception\ParseException * @throws \LTDBeget\sphinx\informer\exceptions\DocumentationSourceException * @throws \LogicException * @throws \LTDBeget\sphinx\informer\exceptions\InformerRuntimeException * @throws \InvalidArgumentException */ private function getVersionOptions(eSection $section, eVersion $version) : array { $informer = Informer::get($version); $options = []; if ($informer->isSectionExist($section)) { foreach ($informer->iterateOptionInfo($section) as $optionInfo) { $options[] = (string) $optionInfo->getName(); } } return $options; }
/** * Configuration constructor. * * @param eVersion $version * * @throws \LTDBeget\sphinx\informer\exceptions\DocumentationSourceException * @throws \Symfony\Component\Yaml\Exception\ParseException */ public function __construct(eVersion $version) { $this->version = $version; $this->informer = Informer::get($this->version); }