PluginProbe
Media Cloud Sync / 1.2.13
Media Cloud Sync v1.2.13
1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 All 35 releases
media-cloud-sync / includes / sdk / s3 / Aws / Command.php

Command.php in Media Cloud Sync 1.2.13, at includes/sdk/s3/Aws/Command.php

93 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Dudlewebs\WPMCS\s3\Aws;
4
5 /**
6 * AWS command object.
7 */
8 class Command implements CommandInterface
9 {
10 use HasDataTrait;
11 /** @var string */
12 private $name;
13 /** @var HandlerList */
14 private $handlerList;
15 /** @var Array */
16 private $authSchemes;
17 /**
18 * Accepts an associative array of command options, including:
19 *
20 * - @http: (array) Associative array of transfer options.
21 *
22 * @param string $name Name of the command
23 * @param array $args Arguments to pass to the command
24 * @param HandlerList $list Handler list
25 */
26 public function __construct($name, array $args = [], HandlerList $list = null)
27 {
28 $this->name = $name;
29 $this->data = $args;
30 $this->handlerList = $list ?: new HandlerList();
31 if (!isset($this->data['@http'])) {
32 $this->data['@http'] = [];
33 }
34 if (!isset($this->data['@context'])) {
35 $this->data['@context'] = [];
36 }
37 }
38 public function __clone()
39 {
40 $this->handlerList = clone $this->handlerList;
41 }
42 public function getName()
43 {
44 return $this->name;
45 }
46 public function hasParam($name)
47 {
48 return \array_key_exists($name, $this->data);
49 }
50 public function getHandlerList()
51 {
52 return $this->handlerList;
53 }
54 /**
55 * For overriding auth schemes on a per endpoint basis when using
56 * EndpointV2 provider. Intended for internal use only.
57 *
58 * @param array $authSchemes
59 *
60 * @deprecated In favor of using the @context property bag.
61 * Auth Schemes are now accessible via the `signature_version` key
62 * in a Command's context, if applicable. Auth Schemes set using
63 * This method are no longer consumed.
64 *
65 * @internal
66 */
67 public function setAuthSchemes(array $authSchemes)
68 {
69 \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);
70 $this->authSchemes = $authSchemes;
71 }
72 /**
73 * Get auth schemes added to command as required
74 * for endpoint resolution
75 *
76 * @returns array
77 *
78 * @deprecated In favor of using the @context property bag.
79 * Auth schemes are now accessible via the `signature_version` key
80 * in a Command's context, if applicable.
81 */
82 public function getAuthSchemes()
83 {
84 \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);
85 return $this->authSchemes ?: [];
86 }
87 /** @deprecated */
88 public function get($name)
89 {
90 return $this[$name];
91 }
92 }
93