Passed
Pull Request — master (#686)
by Vitor
04:56
created
lib/Provider/Gateway/TConfigurable.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,28 +20,28 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	public function __call(string $name, array $args) {
22 22
 		if (!preg_match('/^(?<operation>get|set|delete)(?<field>[A-Z][A-Za-z0-9_]*)$/', $name, $matches)) {
23
-			throw new ConfigurationException('Invalid method ' . $name);
23
+			throw new ConfigurationException('Invalid method '.$name);
24 24
 		}
25
-		$field = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $matches['field']));
25
+		$field = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $matches[ 'field' ]));
26 26
 		$key = $this->keyFromField($field);
27 27
 
28
-		switch ($matches['operation']) {
28
+		switch ($matches[ 'operation' ]) {
29 29
 			case 'get':
30 30
 				$val = (string)$this->getAppConfig()->getValueString(Application::APP_ID, $key, '');
31 31
 				if ($val === '') {
32
-					throw new ConfigurationException('No value set for ' . $field);
32
+					throw new ConfigurationException('No value set for '.$field);
33 33
 				}
34 34
 				return $val;
35 35
 
36 36
 			case 'set':
37
-				$this->getAppConfig()->setValueString(Application::APP_ID, $key, (string)($args[0] ?? ''));
37
+				$this->getAppConfig()->setValueString(Application::APP_ID, $key, (string)($args[ 0 ] ?? ''));
38 38
 				return $this;
39 39
 
40 40
 			case 'delete':
41 41
 				$this->getAppConfig()->deleteKey(Application::APP_ID, $key);
42 42
 				return $this;
43 43
 		}
44
-		throw new ConfigurationException('Invalid operation ' . $matches['operation']);
44
+		throw new ConfigurationException('Invalid operation '.$matches[ 'operation' ]);
45 45
 	}
46 46
 
47 47
 	/**
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 		$fields = $settings->fields;
53 53
 		foreach ($fields as $field) {
54 54
 			if ($field->field === $fieldName) {
55
-				return $this->getProviderId() . '_' . $fieldName;
55
+				return $this->getProviderId().'_'.$fieldName;
56 56
 			}
57 57
 		}
58
-		throw new ConfigurationException('Invalid configuration field: ' . $fieldName . ', check SCHEMA at ' . static::class);
58
+		throw new ConfigurationException('Invalid configuration field: '.$fieldName.', check SCHEMA at '.static::class);
59 59
 	}
60 60
 
61 61
 	/**
Please login to merge, or discard this patch.