PluginProbe
Media Cloud Sync / 1.4.1
Media Cloud Sync v1.4.1
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 / EndpointV2 / Rule / ErrorRule.php

ErrorRule.php in Media Cloud Sync 1.4.1, at includes/sdk/s3/Aws/EndpointV2/Rule/ErrorRule.php

39 lines 1.1 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\EndpointV2\Rule;
4
5 use Dudlewebs\WPMCS\s3\Aws\EndpointV2\Ruleset\RulesetStandardLibrary;
6 use Dudlewebs\WPMCS\s3\Aws\Exception\UnresolvedEndpointException;
7 class ErrorRule extends AbstractRule
8 {
9 /** @var array */
10 private $error;
11 public function __construct($definition)
12 {
13 parent::__construct($definition);
14 $this->error = $definition['error'];
15 }
16 /**
17 * @return array
18 */
19 public function getError()
20 {
21 return $this->error;
22 }
23 /**
24 * If an error rule's conditions are met, raise an
25 * UnresolvedEndpointError containing the fully resolved error string.
26 *
27 * @return null
28 * @throws UnresolvedEndpointException
29 */
30 public function evaluate(array $inputParameters, RulesetStandardLibrary $standardLibrary)
31 {
32 if ($this->evaluateConditions($inputParameters, $standardLibrary)) {
33 $message = $standardLibrary->resolveValue($this->error, $inputParameters);
34 throw new UnresolvedEndpointException($message);
35 }
36 return \false;
37 }
38 }
39