public function __construct($shell, $params = []) { parent::__construct($params); if ($shell instanceof Shell) { $this->shell = $shell; } else { $this->shell = new Shell(); } }
public function __construct($docker, $params) { if ($docker instanceof DockerControllerAbstract) { $this->docker = $docker; } else { throw new DockerException('Invalid parent.', 'Invalid parent class.'); } foreach ($params as $key => $value) { if (!isset(static::parseShellLineFields()[$key])) { unset($params[$key]); } } parent::__construct($params); }