123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- namespace Aws;
- class Command implements CommandInterface
- {
- use HasDataTrait;
-
- private $name;
-
- private $handlerList;
-
- private $authSchemes;
-
- public function __construct($name, array $args = [], HandlerList $list = null)
- {
- $this->name = $name;
- $this->data = $args;
- $this->handlerList = $list ?: new HandlerList();
- if (!isset($this->data['@http'])) {
- $this->data['@http'] = [];
- }
- if (!isset($this->data['@context'])) {
- $this->data['@context'] = [];
- }
- }
- public function __clone()
- {
- $this->handlerList = clone $this->handlerList;
- }
- public function getName()
- {
- return $this->name;
- }
- public function hasParam($name)
- {
- return array_key_exists($name, $this->data);
- }
- public function getHandlerList()
- {
- return $this->handlerList;
- }
-
- public function setAuthSchemes(array $authSchemes)
- {
- trigger_error(__METHOD__ . ' is deprecated. Auth schemes '
- . 'resolved using the service `auth` trait or via endpoint resolution '
- . 'are now set in the command `@context` property.`'
- , E_USER_WARNING
- );
- $this->authSchemes = $authSchemes;
- }
-
- public function getAuthSchemes()
- {
- trigger_error(__METHOD__ . ' is deprecated. Auth schemes '
- . 'resolved using the service `auth` trait or via endpoint resolution '
- . 'can now be found in the command `@context` property.`'
- , E_USER_WARNING
- );
- return $this->authSchemes ?: [];
- }
-
- public function get($name)
- {
- return $this[$name];
- }
- }
|