![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/syn.corals.io/vendor/box/spout/src/Spout/Common/Manager/ |
<?php namespace Box\Spout\Common\Manager; /** * Class OptionsManager */ abstract class OptionsManagerAbstract implements OptionsManagerInterface { const PREFIX_OPTION = 'OPTION_'; /** @var string[] List of all supported option names */ private $supportedOptions = []; /** @var array Associative array [OPTION_NAME => OPTION_VALUE] */ private $options = []; /** * OptionsManagerAbstract constructor. */ public function __construct() { $this->supportedOptions = $this->getSupportedOptions(); $this->setDefaultOptions(); } /** * @return array List of supported options */ abstract protected function getSupportedOptions(); /** * Sets the default options. * To be overriden by child classes * * @return void */ abstract protected function setDefaultOptions(); /** * Sets the given option, if this option is supported. * * @param string $optionName * @param mixed $optionValue * @return void */ public function setOption($optionName, $optionValue) { if (\in_array($optionName, $this->supportedOptions)) { $this->options[$optionName] = $optionValue; } } /** * @param string $optionName * @return mixed|null The set option or NULL if no option with given name found */ public function getOption($optionName) { $optionValue = null; if (isset($this->options[$optionName])) { $optionValue = $this->options[$optionName]; } return $optionValue; } }