Passed
Push — master ( 8ec95d...ba9743 )
by Sebastian
04:36
created
src/Mailcode/Traits/Commands/Validation/Value.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  */
25 25
 trait Mailcode_Traits_Commands_Validation_Value
26 26
 {
27
-   /**
28
-    * @var Mailcode_Parser_Statement_Tokenizer_ValueInterface|NULL
29
-    */
27
+    /**
28
+     * @var Mailcode_Parser_Statement_Tokenizer_ValueInterface|NULL
29
+     */
30 30
     protected $valueToken;
31 31
     
32 32
     protected function validateSyntax_value() : void
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
         }
47 47
     }
48 48
     
49
-   /**
50
-    * Retrieves the variable being compared.
51
-    *
52
-    * @return string
53
-    */
49
+    /**
50
+     * Retrieves the variable being compared.
51
+     *
52
+     * @return string
53
+     */
54 54
     public function getValue() : string
55 55
     {
56 56
         if($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $var = $this->validator->createValue();
35 35
         
36
-        if($var->isValid())
36
+        if ($var->isValid())
37 37
         {
38 38
             $this->valueToken = $var->getToken();
39 39
         }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     */
54 54
     public function getValue() : string
55 55
     {
56
-        if($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
56
+        if ($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
57 57
         {
58 58
             return $this->valueToken->getValue();
59 59
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
         if($var->isValid())
37 37
         {
38 38
             $this->valueToken = $var->getToken();
39
-        }
40
-        else
39
+        } else
41 40
         {
42 41
             $this->validationResult->makeError(
43 42
                 t('No value has been specified.'),
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/Operand.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
  */
26 26
 trait Mailcode_Traits_Commands_Validation_Operand
27 27
 {
28
-   /**
29
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Operand|NULL
30
-    */
28
+    /**
29
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Operand|NULL
30
+     */
31 31
     protected $operandToken;
32 32
     
33
-   /**
34
-    * @return string[]
35
-    */
33
+    /**
34
+     * @return string[]
35
+     */
36 36
     abstract protected function getAllowedOperands() : array;
37 37
     
38 38
     protected function validateSyntax_operand() : void
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
         );
79 79
     }
80 80
     
81
-   /**
82
-    * Retrieves the operand sign.
83
-    *
84
-    * @return string
85
-    */
81
+    /**
82
+     * Retrieves the operand sign.
83
+     *
84
+     * @return string
85
+     */
86 86
     public function getSign() : string
87 87
     {
88 88
         return $this->getOperand()->getSign();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $var = $this->validator->createOperand();
41 41
         
42
-        if($var->isValid())
42
+        if ($var->isValid())
43 43
         {
44
-            if(in_array($var->getSign(), $this->getAllowedOperands()))
44
+            if (in_array($var->getSign(), $this->getAllowedOperands()))
45 45
             {
46 46
                 $this->operandToken = $var->getToken();
47 47
             }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     
67 67
     public function getOperand() : Mailcode_Parser_Statement_Tokenizer_Token_Operand
68 68
     {
69
-        if($this->operandToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
69
+        if ($this->operandToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
70 70
         {
71 71
             return $this->operandToken;
72 72
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
             if(in_array($var->getSign(), $this->getAllowedOperands()))
45 45
             {
46 46
                 $this->operandToken = $var->getToken();
47
-            }
48
-            else
47
+            } else
49 48
             {
50 49
                 $this->validationResult->makeError(
51 50
                     t('Invalid operand %1$s.', $var->getSign()).' '.
@@ -54,8 +53,7 @@  discard block
 block discarded – undo
54 53
                     Mailcode_Commands_CommonConstants::VALIDATION_INVALID_OPERAND
55 54
                 );
56 55
             }
57
-        }
58
-        else
56
+        } else
59 57
         {
60 58
             $this->validationResult->makeError(
61 59
                 t('No operand has been specified.'),
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/Variable.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
         if($var->isValid())
37 37
         {
38 38
             $this->variableToken = $var->getToken();
39
-        }
40
-        else
39
+        } else
41 40
         {
42 41
             $this->validationResult->makeError(
43 42
                 t('No variable has been specified.'),
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  */
25 25
 trait Mailcode_Traits_Commands_Validation_Variable
26 26
 {
27
-   /**
28
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
29
-    */
27
+    /**
28
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
29
+     */
30 30
     protected $variableToken;
31 31
     
32 32
     protected function validateSyntax_variable() : void
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
         );
61 61
     }
62 62
     
63
-   /**
64
-    * Retrieves the variable being compared.
65
-    *
66
-    * @return Mailcode_Variables_Variable
67
-    */
63
+    /**
64
+     * Retrieves the variable being compared.
65
+     *
66
+     * @return Mailcode_Variables_Variable
67
+     */
68 68
     public function getVariable() : Mailcode_Variables_Variable
69 69
     {
70 70
         if(isset($this->variableToken))
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $var = $this->validator->createVariable();
35 35
         
36
-        if($var->isValid())
36
+        if ($var->isValid())
37 37
         {
38 38
             $this->variableToken = $var->getToken();
39 39
         }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function getVariableToken() : Mailcode_Parser_Statement_Tokenizer_Token_Variable
50 50
     {
51
-        if(isset($this->variableToken))
51
+        if (isset($this->variableToken))
52 52
         {
53 53
             return $this->variableToken;
54 54
         }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     */
68 68
     public function getVariable() : Mailcode_Variables_Variable
69 69
     {
70
-        if(isset($this->variableToken))
70
+        if (isset($this->variableToken))
71 71
         {
72 72
             return $this->variableToken->getVariable();
73 73
         }
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $parent = $subject->getParent();
117 117
 
118
-        if($parent === null)
118
+        if ($parent === null)
119 119
         {
120 120
             return null;
121 121
         }
122 122
 
123
-        if($parent instanceof Mailcode_Commands_Command_For)
123
+        if ($parent instanceof Mailcode_Commands_Command_For)
124 124
         {
125 125
             return $parent;
126 126
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Info/Pruner.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -22,19 +22,19 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class Mailcode_Parser_Statement_Info_Pruner
24 24
 {
25
-   /**
26
-    * @var Mailcode_Parser_Statement_Info
27
-    */
25
+    /**
26
+     * @var Mailcode_Parser_Statement_Info
27
+     */
28 28
     private $info;
29 29
     
30
-   /**
31
-    * @var string[]
32
-    */
30
+    /**
31
+     * @var string[]
32
+     */
33 33
     private $exclude = array();
34 34
     
35
-   /**
36
-    * @var string[]
37
-    */
35
+    /**
36
+     * @var string[]
37
+     */
38 38
     private $classNames = array();
39 39
     
40 40
     public function __construct(Mailcode_Parser_Statement_Info $info)
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
         return $this;
75 75
     }
76 76
     
77
-   /**
78
-    * Retrieves all tokens in the statement matching the
79
-    * current criteria.
80
-    * 
81
-    * @return Mailcode_Parser_Statement_Tokenizer_Token[]
82
-    */
77
+    /**
78
+     * Retrieves all tokens in the statement matching the
79
+     * current criteria.
80
+     * 
81
+     * @return Mailcode_Parser_Statement_Tokenizer_Token[]
82
+     */
83 83
     public function getTokens() : array
84 84
     {
85 85
         $tokens = $this->info->getTokens();
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $id = $token->getID();
48 48
         
49
-        if(!in_array($id, $this->exclude))
49
+        if (!in_array($id, $this->exclude))
50 50
         {
51 51
             $this->exclude[] = $id;
52 52
         }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     
67 67
     public function limitByClassName(string $className) : Mailcode_Parser_Statement_Info_Pruner
68 68
     {
69
-        if(!in_array($className, $this->classNames))
69
+        if (!in_array($className, $this->classNames))
70 70
         {
71 71
             $this->classNames[] = $className;
72 72
         }
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
         $tokens = $this->info->getTokens();
86 86
         $keep = array(); 
87 87
         
88
-        foreach($tokens as $token)
88
+        foreach ($tokens as $token)
89 89
         {
90
-            if(in_array($token->getID(), $this->exclude))
90
+            if (in_array($token->getID(), $this->exclude))
91 91
             {
92 92
                 continue;
93 93
             }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/IfContains.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
     use Mailcode_Traits_Commands_Validation_Variable;
29 29
     use Mailcode_Traits_Commands_Validation_CaseSensitive;
30 30
     
31
-   /**
32
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[]
33
-    */
31
+    /**
32
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[]
33
+     */
34 34
     protected $searchTerms = array();
35 35
     
36 36
     protected function getValidations() : array
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         }
67 67
     }
68 68
     
69
-   /**
70
-    * Retrieves all search terms.
71
-    * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[]
72
-    */
69
+    /**
70
+     * Retrieves all search terms.
71
+     * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[]
72
+     */
73 73
     public function getSearchTerms() : array
74 74
     {
75 75
         return $this->searchTerms;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,15 +48,15 @@
 block discarded – undo
48 48
         ->limitToStringLiterals()
49 49
         ->getTokens();
50 50
         
51
-        foreach($tokens as $token)
51
+        foreach ($tokens as $token)
52 52
         {
53
-            if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
53
+            if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
54 54
             {
55 55
                 $this->searchTerms[] = $token;
56 56
             }
57 57
         }
58 58
         
59
-        if(empty($this->searchTerms))
59
+        if (empty($this->searchTerms))
60 60
         {
61 61
             $this->validationResult->makeError(
62 62
                 t('No search terms found:').' '.
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/CaseSensitive.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
  */
25 25
 trait Mailcode_Traits_Commands_Validation_CaseSensitive
26 26
 {
27
-   /**
28
-    * @var boolean
29
-    */
27
+    /**
28
+     * @var boolean
29
+     */
30 30
     protected $caseInsensitive = false;
31 31
 
32
-   /**
33
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL
34
-    */
32
+    /**
33
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL
34
+     */
35 35
     protected $caseToken;
36 36
     
37 37
     protected function validateSyntax_case_sensitive() : void
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         
41 41
         $this->caseInsensitive = $val->isValid();
42 42
         
43
-        if($val->isValid())
43
+        if ($val->isValid())
44 44
         {
45 45
             $this->caseToken = $val->getToken();
46 46
         }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     
54 54
     public function getCaseToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword
55 55
     {
56
-        if($this->caseToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
56
+        if ($this->caseToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
57 57
         {
58 58
             return $this->caseToken;
59 59
         }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/Comment.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Commands_Command_Comment extends Mailcode_Commands_Command implements Mailcode_Commands_Command_Type_Standalone
22 22
 {
23
-   /**
24
-    * @var string
25
-    */
23
+    /**
24
+     * @var string
25
+     */
26 26
     private $commentString = '';
27 27
     
28 28
     protected function init() : void
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
     
81 81
     protected function validateSyntax_comment() : void
82 82
     {
83
-        if(empty($this->commentString))
83
+        if (empty($this->commentString))
84 84
         {
85 85
             $this->validationResult->makeError(
86 86
                 t('The comment text ist empty.'),
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Tokenizer/Token/Operand.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
         return $this->getSign();
31 31
     }
32 32
     
33
-   /**
34
-    * Retrieves all known comparison operator signs.
35
-    * @return string[]
36
-    */
33
+    /**
34
+     * Retrieves all known comparison operator signs.
35
+     * @return string[]
36
+     */
37 37
     public static function getComparisonSigns() : array
38 38
     {
39 39
         return array(
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
         );
47 47
     }
48 48
     
49
-   /**
50
-    * Retrieves all known arithmetic operator signs.
51
-    * @return string[]
52
-    */
49
+    /**
50
+     * Retrieves all known arithmetic operator signs.
51
+     * @return string[]
52
+     */
53 53
     public static function getArithmeticSigns() : array
54 54
     {
55 55
         return array(
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
         );
61 61
     }
62 62
     
63
-   /**
64
-    * Whether the operator is comparison related (equals, not equals, smaller, greater...).
65
-    *  
66
-    * @return bool
67
-    */
63
+    /**
64
+     * Whether the operator is comparison related (equals, not equals, smaller, greater...).
65
+     *  
66
+     * @return bool
67
+     */
68 68
     public function isComparator() : bool
69 69
     {
70 70
         return 
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
         $this->isSmallerOrEquals();
77 77
     }
78 78
     
79
-   /**
80
-    * Whether the operator is calculation related (minus, plus, divide, multiply).
81
-    * 
82
-    * @return bool
83
-    */
79
+    /**
80
+     * Whether the operator is calculation related (minus, plus, divide, multiply).
81
+     * 
82
+     * @return bool
83
+     */
84 84
     public function isCalculator() : bool
85 85
     {
86 86
         return 
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/For.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
27 27
     const VALIDATION_WRONG_KEYWORD = 49702;
28 28
     const VALIDATION_VARIABLE_NAME_IS_THE_SAME = 49703;
29 29
     
30
-   /**
31
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
32
-    */
30
+    /**
31
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
32
+     */
33 33
     private $loopVar;
34 34
     
35
-   /**
36
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
37
-    */
35
+    /**
36
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
37
+     */
38 38
     private $sourceVar;
39 39
     
40
-   /**
41
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL
42
-    */
40
+    /**
41
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL
42
+     */
43 43
     private $keyword;
44 44
     
45 45
     public function getName() : string
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     
89 89
     public function getSourceVariable() : Mailcode_Variables_Variable
90 90
     {
91
-        if(isset($this->sourceVar))
91
+        if (isset($this->sourceVar))
92 92
         {
93 93
             return $this->sourceVar->getVariable();
94 94
         }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     
103 103
     public function getLoopVariable() : Mailcode_Variables_Variable
104 104
     {
105
-        if(isset($this->loopVar))
105
+        if (isset($this->loopVar))
106 106
         {
107 107
             return $this->loopVar->getVariable();
108 108
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $this->keyword = $info->getKeywordByIndex(1);
123 123
         $this->sourceVar = $info->getVariableByIndex(2);
124 124
         
125
-        if(!$this->loopVar || !$this->keyword || !$this->sourceVar)
125
+        if (!$this->loopVar || !$this->keyword || !$this->sourceVar)
126 126
         {
127 127
             $this->validationResult->makeError(
128 128
                 t('Not a valid for loop.').' '.t('Is the %1$s keyword missing?', 'in:'),
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     
136 136
     protected function validateSyntax_keyword() : void
137 137
     {
138
-        if($this->keyword->isForIn())
138
+        if ($this->keyword->isForIn())
139 139
         {
140 140
             return;
141 141
         }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     
149 149
     protected function validateSyntax_variable_names() : void
150 150
     {
151
-        if($this->sourceVar->getVariable()->getFullName() !== $this->loopVar->getVariable()->getFullName())
151
+        if ($this->sourceVar->getVariable()->getFullName() !== $this->loopVar->getVariable()->getFullName())
152 152
         {
153 153
             return;
154 154
         }
Please login to merge, or discard this patch.