Passed
Pull Request — master (#18)
by
unknown
03:40
created
src/Mailcode/Translator/Syntax/HubL/ShowNumberTranslation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
 {
24 24
     public function translate(Mailcode_Commands_Command_ShowNumber $command): string
25 25
     {
26
-        return '{{ ' . $command->getVariableName() . ' }}';
26
+        return '{{ '.$command->getVariableName().' }}';
27 27
     }
28 28
 }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/HubL/SetVariableTranslation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         if ($command->isCountEnabled())
29 29
         {
30 30
             $result = $this->buildCountAssignment($command);
31
-            if($result !== null) {
31
+            if ($result !== null) {
32 32
                 $assignmentString = $result;
33 33
             }
34 34
         }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/HubL/ShowPhoneTranslation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
 {
27 27
     public function translate(Mailcode_Commands_Command_ShowPhone $command): string
28 28
     {
29
-        return '{{ ' . $command->getVariableName() . ' }}';
29
+        return '{{ '.$command->getVariableName().' }}';
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/HubL.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $varName = undollarize($name);
44 44
 
45
-        if(self::areVariableNamesLowercase()) {
45
+        if (self::areVariableNamesLowercase()) {
46 46
             $varName = strtolower($varName);
47 47
         }
48 48
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $variables = Mailcode::create()->createVariables()->parseString($subject)->getAll();
55 55
 
56
-        foreach($variables as $variable) {
56
+        foreach ($variables as $variable) {
57 57
             $subject = str_replace($variable->getMatchedText(), $this->formatVariableName($variable->getFullName()), $subject);
58 58
         }
59 59
 
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
     public function createTranslator(Mailcode_Commands_Command $command) : BaseCommandTranslation
69 69
     {
70 70
         $class = sprintf(
71
-            __CLASS__ .'\%s\%sTranslation',
71
+            __CLASS__.'\%s\%sTranslation',
72 72
             $this->getTypeID(),
73 73
             $command->getID()
74 74
         );
75 75
 
76
-        if(!class_exists($class))
76
+        if (!class_exists($class))
77 77
         {
78 78
             throw new Mailcode_Translator_Exception(
79 79
                 sprintf('Unknown command %s in translator', $command->getID()),
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         
88 88
         $translator = new $class($command);
89 89
 
90
-        if($translator instanceof BaseCommandTranslation)
90
+        if ($translator instanceof BaseCommandTranslation)
91 91
         {
92 92
             return $translator;
93 93
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $subject = $safeguard->makeSafe();
117 117
         
118
-        if(!$safeguard->hasPlaceholders())
118
+        if (!$safeguard->hasPlaceholders())
119 119
         {
120 120
             return $subject;
121 121
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         
125 125
         $replaces = array();
126 126
         
127
-        foreach($placeholders as $placeholder)
127
+        foreach ($placeholders as $placeholder)
128 128
         {
129 129
             $command = $placeholder->getCommand();
130 130
 
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/IDNDecodeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      * @param bool $enabled
34 34
      * @return $this
35 35
      */
36
-    public function setIDNDecoding(bool $enabled=true) : self
36
+    public function setIDNDecoding(bool $enabled = true) : self
37 37
     {
38 38
         return $this->setEncodingEnabled(Mailcode_Commands_Keywords::TYPE_IDN_DECODE, $enabled);
39 39
     }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/IDNEncodeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      * @param bool $enabled
34 34
      * @return $this
35 35
      */
36
-    public function setIDNEncoding(bool $enabled=true) : self
36
+    public function setIDNEncoding(bool $enabled = true) : self
37 37
     {
38 38
         return $this->setEncodingEnabled(Mailcode_Commands_Keywords::TYPE_IDN_ENCODE, $enabled);
39 39
     }
Please login to merge, or discard this patch.
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.