/** * Handles a NotFoundException * * @param NotFoundException $exception * * @throws ConfigException * @throws NotFoundException */ private function notFound(NotFoundException $exception) { if ($this->config->get("playtime.debug") == false) { $this->dispatchNotFound(); } else { throw $exception; } }
public function set() { $this->config->set('playtime.test', 1); $this->assertTrue($this->config->has('playtime.test')); $this->assertEquals(1, $this->config->get('playtime.test')); $this->config->set('new.value', 'test'); $this->assertTrue($this->config->has('new.value')); $this->assertEquals('test', $this->config->get('new.value')); }
/** * SessionHandler constructor. * * @param Config $config */ public function __construct(Config $config) { $config->has('playtime.session_name') ? session_id($config->get('playtime.session_name')) : null; SessionHandler::startSession(); SessionHandler::setStart($config->has('playtime.session_values') ? $config->get('playtime.session_values') : []); }
/** * Gets the lexer parameter from either the config or the lexerParam array * * @param $paramName * * @return array|mixed * @throws \Playground\Framework\Config\ConfigException */ public function getLexerParam($paramName) { $configName = "twig." . $paramName; return $this->config->has($configName) ? $this->config->get($configName) : $this->lexerParams[$paramName]; }
/** * Use the register method to register items with the container via the * protected $container property or the `getContainer` method * from the ContainerAwareTrait. * * @return void */ public function register() { $this->getContainer()->add('logger', 'Playground\\Framework\\Log\\Logger', true)->withArguments([$this->config->get('log.path'), $this->fileHandler]); }