PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 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 All 36 releases
← All changes | includes/sdk/s3/Aws/Command.php +16 -2 1.2.13 → 1.4.2 View file →
@@ -11,10 +11,12 @@
11 11 /** @var string */
12 12 private $name;
13 13 /** @var HandlerList */
14 14 private $handlerList;
15 - /** @var Array */
15 + /** @var array */
16 16 private $authSchemes;
17 + /** @var MetricsBuilder */
18 + private $metricsBuilder;
17 19 /**
18 20 * Accepts an associative array of command options, including:
19 21 *
20 22 * - @http: (array) Associative array of transfer options.
@@ -22,9 +24,9 @@
22 24 * @param string $name Name of the command
23 25 * @param array $args Arguments to pass to the command
24 26 * @param HandlerList $list Handler list
25 27 */
26 - public function __construct($name, array $args = [], HandlerList $list = null)
28 + public function __construct($name, array $args = [], ?HandlerList $list = null, ?MetricsBuilder $metricsBuilder = null)
27 29 {
28 30 $this->name = $name;
29 31 $this->data = $args;
30 32 $this->handlerList = $list ?: new HandlerList();
@@ -33,8 +35,9 @@
33 35 }
34 36 if (!isset($this->data['@context'])) {
35 37 $this->data['@context'] = [];
36 38 }
39 + $this->metricsBuilder = $metricsBuilder ?: new MetricsBuilder();
37 40 }
38 41 public function __clone()
39 42 {
40 43 $this->handlerList = clone $this->handlerList;
@@ -87,6 +90,17 @@
87 90 /** @deprecated */
88 91 public function get($name)
89 92 {
90 93 return $this[$name];
94 + }
95 + /**
96 + * Returns the metrics builder instance tied up to this command.
97 + *
98 + * @internal
99 + *
100 + * @return MetricsBuilder
101 + */
102 + public function getMetricsBuilder() : MetricsBuilder
103 + {
104 + return $this->metricsBuilder;
91 105 }
92 106 }