PluginProbe
Media Cloud Sync / 1.3.11
Media Cloud Sync v1.3.11
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 1.3.0 All 34 releases
media-cloud-sync / includes / sdk / s3 / Aws / ClientSideMonitoring / Configuration.php

Configuration.php in Media Cloud Sync 1.3.11, at includes/sdk/s3/Aws/ClientSideMonitoring/Configuration.php

66 lines 1.6 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\ClientSideMonitoring;
4
5 class Configuration implements ConfigurationInterface
6 {
7 private $clientId;
8 private $enabled;
9 private $host;
10 private $port;
11 /**
12 * Constructs a new Configuration object with the specified CSM options set.
13 *
14 * @param mixed $enabled
15 * @param string $host
16 * @param string|int $port
17 * @param string $clientId
18 */
19 public function __construct($enabled, $host, $port, $clientId = '')
20 {
21 $this->host = $host;
22 $this->port = \filter_var($port, \FILTER_VALIDATE_INT);
23 if ($this->port === \false) {
24 throw new \InvalidArgumentException("CSM 'port' value must be an integer!");
25 }
26 // Unparsable $enabled flag errors on the side of disabling CSM
27 $this->enabled = \filter_var($enabled, \FILTER_VALIDATE_BOOLEAN);
28 $this->clientId = \trim($clientId);
29 }
30 /**
31 * {@inheritdoc}
32 */
33 public function isEnabled()
34 {
35 return $this->enabled;
36 }
37 /**
38 * {@inheritdoc}
39 */
40 public function getClientId()
41 {
42 return $this->clientId;
43 }
44 /**
45 * /{@inheritdoc}
46 */
47 public function getHost()
48 {
49 return $this->host;
50 }
51 /**
52 * {@inheritdoc}
53 */
54 public function getPort()
55 {
56 return $this->port;
57 }
58 /**
59 * {@inheritdoc}
60 */
61 public function toArray()
62 {
63 return ['client_id' => $this->getClientId(), 'enabled' => $this->isEnabled(), 'host' => $this->getHost(), 'port' => $this->getPort()];
64 }
65 }
66