Passed
Pull Request — master (#11)
by
unknown
03:25
created
src/Mailcode/Commands/Command/For.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
         if (!$this->loopVar || !$this->keyword || !$this->sourceVar) {
148 148
             $this->validationResult->makeError(
149
-                t('Not a valid for loop.') . ' ' . t('Is the %1$s keyword missing?', 'in:'),
149
+                t('Not a valid for loop.').' '.t('Is the %1$s keyword missing?', 'in:'),
150 150
                 self::VALIDATION_INVALID_FOR_STATEMENT
151 151
             );
152 152
 
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
         }
192 192
 
193 193
         $this->validationResult->makeError(
194
-            t('The source variable is not a list variable:') . ' ' .
195
-            t('Expected a variable without dot, like %1$s.', '<code>$' . t('LIST') . '</code>'),
194
+            t('The source variable is not a list variable:').' '.
195
+            t('Expected a variable without dot, like %1$s.', '<code>$'.t('LIST').'</code>'),
196 196
             self::VALIDATION_VARIABLE_NAME_WITH_DOT
197 197
         );
198 198
     }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/SetVariable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         // allowed ones.
125 125
         if (!in_array($sign, $allowed)) {
126 126
             $this->validationResult->makeError(
127
-                t('The %1$s sign is not allowed in this command.', '<code>' . $sign . '</code>'),
127
+                t('The %1$s sign is not allowed in this command.', '<code>'.$sign.'</code>'),
128 128
                 Mailcode_Commands_CommonConstants::VALIDATION_INVALID_OPERAND
129 129
             );
130 130
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         throw new Mailcode_Exception(
152 152
             'No variable found.',
153
-            'Statement does not start with a variable: [' . $this->paramsString . ']',
153
+            'Statement does not start with a variable: ['.$this->paramsString.']',
154 154
             Mailcode_Commands_CommonConstants::ERROR_NO_VARIABLE_AVAILABLE
155 155
         );
156 156
     }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Misc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@
 block discarded – undo
58 58
      * @throws Mailcode_Exception
59 59
      * @throws Mailcode_Factory_Exception
60 60
      */
61
-    public function for(string $sourceVariable, string $loopVariable, string $breakAtValue = ''): Mailcode_Commands_Command_For
61
+    public function for (string $sourceVariable, string $loopVariable, string $breakAtValue = ''): Mailcode_Commands_Command_For
62 62
     {
63
-        $sourceVariable = '$' . ltrim($sourceVariable, '$');
64
-        $loopVariable = '$' . ltrim($loopVariable, '$');
63
+        $sourceVariable = '$'.ltrim($sourceVariable, '$');
64
+        $loopVariable = '$'.ltrim($loopVariable, '$');
65 65
 
66 66
         if (!empty($breakAtValue)) {
67 67
             $breakAtValue = sprintf(' break-at: %s', $breakAtValue);
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Set.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,20 +25,20 @@
 block discarded – undo
25 25
         $variableName = $this->instantiator->filterVariableName($variableName);
26 26
 
27 27
         if ($asCount) {
28
-            $params = $variableName . ' count: ' . $value;
28
+            $params = $variableName.' count: '.$value;
29 29
         } else {
30 30
             if ($quoteValue) {
31 31
                 $value = $this->instantiator->quoteString($value);
32 32
             }
33 33
 
34
-            $params = $variableName . ' = ' . $value;
34
+            $params = $variableName.' = '.$value;
35 35
         }
36 36
 
37 37
         $cmd = $this->commands->createCommand(
38 38
             'SetVariable',
39 39
             '', // type
40 40
             $params,
41
-            '{setvar: ' . $params . '}'
41
+            '{setvar: '.$params.'}'
42 42
         );
43 43
 
44 44
         $this->instantiator->checkCommand($cmd);
Please login to merge, or discard this patch.
src/Mailcode/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 {
23 23
     public function __construct(string $message, ?string $details = null, $code = null, $previous = null)
24 24
     {
25
-        if(defined('TESTS_ROOT') && !empty($details)) {
25
+        if (defined('TESTS_ROOT') && !empty($details)) {
26 26
             $message .= PHP_EOL.
27 27
                 'Details:'.PHP_EOL.
28 28
                 $details;
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Tokenizer/Process/Variables.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
         $vars = Mailcode::create()->findVariables($this->tokenized, $this->tokenizer->getSourceCommand())->getGroupedByHash();
12 12
 
13 13
         $names = array();
14
-        foreach($vars as $var)
14
+        foreach ($vars as $var)
15 15
         {
16 16
             $names[$var->getMatchedText()] = $var;
17 17
         }
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             return strlen($b) - strlen($a);
24 24
         });
25 25
 
26
-        foreach($names as $name => $var)
26
+        foreach ($names as $name => $var)
27 27
         {
28 28
             $this->registerToken('Variable', $name, $var);
29 29
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/CountTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         if ($this->countEnabled) {
49 49
             if (!$this->countToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) {
50 50
                 $this->validationResult->makeError(
51
-                    t('Invalid count type.' . ' ' . 'Expected Variable.'),
51
+                    t('Invalid count type.'.' '.'Expected Variable.'),
52 52
                     CountInterface::VALIDATION_COUNT_CODE_WRONG_TYPE
53 53
                 );
54 54
                 return;
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/BreakAtTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,13 +41,13 @@
 block discarded – undo
41 41
 
42 42
         $val = $this->validator->createKeyword(Mailcode_Commands_Keywords::TYPE_BREAK_AT);
43 43
 
44
-        $this->breakAtEnabled = $val->isValid() && $this->breakAtToken != null;;
44
+        $this->breakAtEnabled = $val->isValid() && $this->breakAtToken != null; ;
45 45
 
46 46
         if ($this->breakAtEnabled) {
47 47
             if (!$this->breakAtToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number &&
48 48
                 !$this->breakAtToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) {
49 49
                 $this->validationResult->makeError(
50
-                    t('Invalid break-at type.' . ' ' . 'Expected Number or Variable.'),
50
+                    t('Invalid break-at type.'.' '.'Expected Number or Variable.'),
51 51
                     BreakAtInterface::VALIDATION_BREAK_AT_CODE_WRONG_TYPE
52 52
                 );
53 53
                 return;
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         // All other special characters have to be escaped
73 73
         // with two backslashes.
74 74
         foreach ($this->regexSpecialChars as $char) {
75
-            $string = str_replace($char, '\\' . $char, $string);
75
+            $string = str_replace($char, '\\'.$char, $string);
76 76
         }
77 77
 
78 78
         // Restore the escaped quotes, which stay escaped
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
             );
92 92
         }
93 93
 
94
-        return $this->renderEncodings($command, '$' . $varName);
94
+        return $this->renderEncodings($command, '$'.$varName);
95 95
     }
96 96
 
97 97
     public function renderNumberFormat(string $varName, Mailcode_Number_Info $numberInfo, bool $absolute): string
98 98
     {
99
-        $varName = '$' . ltrim($varName, '$');
99
+        $varName = '$'.ltrim($varName, '$');
100 100
 
101 101
         if ($absolute) {
102 102
             $varName = sprintf('${numeric.abs(%s)}', $varName);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
         return sprintf(
119 119
             '$numeric.toNumber(%s)',
120
-            '$' . $varName
120
+            '$'.$varName
121 121
         );
122 122
     }
123 123
 
Please login to merge, or discard this patch.