public function __construct() { $arguments = func_get_args(); $argument_count = count($arguments); if (($argument_count == 2 || $argument_count == 3) && $arguments[0] instanceof Client) { $this->_client = $arguments[0]; $this->_service_name = $arguments[1]; $this->_service_version = $argument_count == 2 ? 1 : (int) $arguments[2]; } else { $client_reflection = new ReflectionClass('UserApp\\Client'); $this->_client = $client_reflection->newInstanceArgs($arguments); } parent::__construct($this->_client); }
public function __construct() { parent::__construct($this); $arguments = func_get_args(); $options = $this->getOptions(); for ($i = 0; $i < count($arguments); ++$i) { $argument = $arguments[$i]; if ($i == count($arguments) - 1 && is_array($argument)) { $options->set($argument); } else { if ($i == 0) { if ($argument != null && is_string($argument)) { $options->app_id = $argument; } } else { if ($i == 1) { if ($argument != null && is_string($argument)) { $options->token = $argument; } } } } } }