|
@@ 104-116 (lines=13) @@
|
| 101 |
|
* @return BucketOptions |
| 102 |
|
* @throws \Assert\AssertionFailedException |
| 103 |
|
*/ |
| 104 |
|
public function getBucketOptions(array $moduleConfig, $bucketConfigName) |
| 105 |
|
{ |
| 106 |
|
Assertion::keyExists($moduleConfig, 'buckets'); |
| 107 |
|
|
| 108 |
|
$bucketsConfig = $moduleConfig['buckets']; |
| 109 |
|
Assertion::isArray($bucketsConfig); |
| 110 |
|
|
| 111 |
|
Assertion::keyExists($bucketsConfig, $bucketConfigName); |
| 112 |
|
$bucketConfig = $bucketsConfig[$bucketConfigName]; |
| 113 |
|
Assertion::isArray($bucketConfig); |
| 114 |
|
|
| 115 |
|
return new BucketOptions($bucketConfig); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
/** |
| 119 |
|
* @param array $moduleConfig |
|
@@ 124-136 (lines=13) @@
|
| 121 |
|
* @return ClusterOptions |
| 122 |
|
* @throws \Assert\AssertionFailedException |
| 123 |
|
*/ |
| 124 |
|
public function getClusterOptions(array $moduleConfig, $clusterName) |
| 125 |
|
{ |
| 126 |
|
Assertion::keyExists($moduleConfig, 'clusters'); |
| 127 |
|
|
| 128 |
|
$clustersConfig = $moduleConfig['clusters']; |
| 129 |
|
Assertion::isArray($clustersConfig); |
| 130 |
|
|
| 131 |
|
Assertion::keyExists($clustersConfig, $clusterName); |
| 132 |
|
$clusterConfig = $clustersConfig[$clusterName]; |
| 133 |
|
Assertion::isArray($clusterConfig); |
| 134 |
|
|
| 135 |
|
return new ClusterOptions($clusterConfig); |
| 136 |
|
} |
| 137 |
|
} |
| 138 |
|
|