app = $app; $this->options = $options; $mandatory = $this->getMandatoryOptions(); if ($mandatory !== array_intersect($mandatory, array_keys($options))) { throw new MissingParameters( sprintf( 'Missing parameters %s' , implode(', ', array_diff($mandatory, array_keys($options))) ) ); } $this->init(); } protected function init() { return; } /** * * @return Array */ public function getOptions() { return $this->options; } /** * * @return Array */ public function getMandatoryOptions() { return array(); } }