Passed
Push — master ( 5a1441...3162ad )
by Sebastian
03:48
created
src/Mailcode/Traits/Commands/Validation/DecryptTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
             ->getInfo()
35 35
             ->getTokenByParamName(DecryptInterface::PARAMETER_NAME);
36 36
 
37
-        if($token === null) {
37
+        if ($token === null) {
38 38
             return;
39 39
         }
40 40
 
41 41
         if (!$token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) {
42 42
             $this->validationResult->makeError(
43
-                t('Invalid decryption key token:') . ' ' . t('Expected a string.'),
43
+                t('Invalid decryption key token:').' '.t('Expected a string.'),
44 44
                 DecryptInterface::VALIDATION_DECRYPT_CODE_WRONG_TYPE
45 45
             );
46 46
             return;
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
     public function getDecryptionKeyName() : string
58 58
     {
59 59
         $key = $this->getDecryptionKeyToken();
60
-        if($key === null) {
60
+        if ($key === null) {
61 61
             return '';
62 62
         }
63 63
 
64 64
         $keyName = $key->getText();
65 65
 
66
-        if(empty($keyName)) {
66
+        if (empty($keyName)) {
67 67
             $keyName = (string)DecryptSettings::getDefaultKeyName();
68 68
         }
69 69
 
70 70
         return $keyName;
71 71
     }
72 72
 
73
-    public function enableDecryption(string $keyName=DecryptInterface::DEFAULT_DECRYPTION_KEY_NAME) : self
73
+    public function enableDecryption(string $keyName = DecryptInterface::DEFAULT_DECRYPTION_KEY_NAME) : self
74 74
     {
75 75
         $this->decryptionKeyToken = $this
76 76
             ->requireParams()
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function disableDecryption() : self
84 84
     {
85
-        if(isset($this->decryptionKeyToken)) {
85
+        if (isset($this->decryptionKeyToken)) {
86 86
             $this
87 87
                 ->requireParams()
88 88
                 ->getInfo()
Please login to merge, or discard this patch.
tools/syntax-highlighter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use Mailcode\Mailcode_Exception;
17 17
 use Mailcode\Mailcode_Translator_Exception;
18 18
 use function \AppLocalize\pt;
19
-use function \AppLocalize\pts;use function AppLocalize\t;
19
+use function \AppLocalize\pts; use function AppLocalize\t;
20 20
 
21 21
 require_once 'prepend.php';
22 22
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $error = null;
29 29
 $highlighted = '';
30 30
 
31
-if($request->getBool('highlight'))
31
+if ($request->getBool('highlight'))
32 32
 {
33 33
     $commandsText = $request->registerParam('mailcode')->getString();
34 34
 
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
         $error = $e->getMessage();
44 44
 
45 45
         $collection = $e->getCollection();
46
-        if($collection)
46
+        if ($collection)
47 47
         {
48 48
             $first = $collection->getFirstError();
49 49
             $error = $first->getMessage();
50 50
             $matched = $first->getMatchedText();
51
-            if(!empty($matched)) {
52
-                $error .= '<br>'. t('In command:').' <code>'.$matched.'</code>';
51
+            if (!empty($matched)) {
52
+                $error .= '<br>'.t('In command:').' <code>'.$matched.'</code>';
53 53
             }
54 54
         }
55 55
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         <p></p><br>
94 94
         <h2><?php pt('Highlighted commands') ?></h2>
95 95
         <?php
96
-            if(empty($commandsText))
96
+            if (empty($commandsText))
97 97
             {
98 98
                 ?>
99 99
                     <div class="alert alert-info">
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                     </div>
102 102
                 <?php
103 103
             }
104
-            else if($error)
104
+            else if ($error)
105 105
             {
106 106
                 ?>
107 107
                     <div class="alert alert-danger">
Please login to merge, or discard this patch.
tools/extractPhoneCountries.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 
13 13
 declare(strict_types=1);
14 14
 
15
-use AppUtils\ConvertHelper\JSONConverter;use AppUtils\CSVHelper;
16
-use AppUtils\CSVHelper_Exception;use AppUtils\FileHelper;
17
-use AppUtils\FileHelper_Exception;use libphonenumber\PhoneNumberFormat;
18
-use libphonenumber\PhoneNumberUtil;use Mailcode\Mailcode;use function AppLocalize\pts;
15
+use AppUtils\ConvertHelper\JSONConverter; use AppUtils\CSVHelper;
16
+use AppUtils\CSVHelper_Exception; use AppUtils\FileHelper;
17
+use AppUtils\FileHelper_Exception; use libphonenumber\PhoneNumberFormat;
18
+use libphonenumber\PhoneNumberUtil; use Mailcode\Mailcode; use function AppLocalize\pts;
19 19
 
20 20
 require_once 'prepend.php';
21 21
 
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 
95 95
         $meta = $phoneNumberUtil->getMetadataForRegion($code);
96 96
         if (!$meta) {
97
-            die('No metadata for ' . $code);
97
+            die('No metadata for '.$code);
98 98
         }
99 99
 
100 100
         $exampleNumber = $phoneNumberUtil->getExampleNumber($code);
101
-        if(empty($exampleNumber)) {
102
-            die('No example number for ' . $code);
101
+        if (empty($exampleNumber)) {
102
+            die('No example number for '.$code);
103 103
         }
104 104
 
105 105
         $local = $phoneNumberUtil->formatInOriginalFormat($exampleNumber, $code);
Please login to merge, or discard this patch.
tools/translator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $error = null;
32 32
 $activeSyntax = $syntaxes[0]->getTypeID();
33 33
 
34
-if($request->getBool('translate'))
34
+if ($request->getBool('translate'))
35 35
 {
36 36
     $commandsText = $request->registerParam('mailcode')->getString();
37 37
     $activeSyntax = $request->registerParam('syntax')
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
         $error = $e->getMessage();
49 49
 
50 50
         $collection = $e->getCollection();
51
-        if($collection)
51
+        if ($collection)
52 52
         {
53 53
             $first = $collection->getFirstError();
54 54
             $error = $first->getMessage();
55 55
             $matched = $first->getMatchedText();
56
-            if(!empty($matched)) {
56
+            if (!empty($matched)) {
57 57
                 $error .= '<br>'.t('In command:').' <code>'.$matched.'</code>';
58 58
             }
59 59
         }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                             $selected = '';
118 118
                             $typeID = $syntax->getTypeID();
119 119
 
120
-                            if($typeID === $activeSyntax) {
120
+                            if ($typeID === $activeSyntax) {
121 121
                                 $selected = ' selected';
122 122
                             }
123 123
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         <p></p><br>
138 138
         <h2><?php pt('Translated commands') ?></h2>
139 139
         <?php
140
-            if(empty($commandsText))
140
+            if (empty($commandsText))
141 141
             {
142 142
                 ?>
143 143
                     <div class="alert alert-info">
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                     </div>
146 146
                 <?php
147 147
             }
148
-            else if($error)
148
+            else if ($error)
149 149
             {
150 150
                 ?>
151 151
                     <div class="alert alert-danger">
Please login to merge, or discard this patch.