/** * @param Filesystem $files * @param ServiceInterpreterInterface $interpreter */ public function __construct(Filesystem $files = null, ServiceInterpreterInterface $interpreter = null) { if (is_null($files)) { $files = app(Filesystem::class); } $this->files = $files; parent::__construct(null, $interpreter); }
/** * Checks the request to be used in the next/upcoming call */ protected function checkRequest() { parent::checkRequest(); if (!is_a($this->request, ServiceSshRequest::class)) { throw new InvalidArgumentException("Request class is not a ServiceSshRequest"); } }
/** * Runs directly after construction * Extend this to customize your service * * Defaults to 'exceptions' option enabled */ protected function initialize() { parent::initialize(); // unless already configured, set default options to include exceptions $options = $this->defaults->getOptions() ?: []; foreach ($this->soapOptionDefaults as $option => $value) { if (!array_key_exists($option, $options)) { $options[$option] = $value; } } $this->defaults->setOptions($options); }
/** * Supplements request with soap options, in addition to the standard supplements */ protected function supplementRequestWithDefaults() { parent::supplementRequestWithDefaults(); // set the HTTP Method if it is set in the defaults if (empty($this->request->getHttpMethod()) && !empty($this->defaults['http_method'])) { $this->request->setHttpMethod($this->defaults['http_method']); } }