@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if ($command->isCountEnabled()) |
28 | 28 | { |
29 | 29 | $result = $this->buildCountAssignment($command); |
30 | - if($result !== null) { |
|
30 | + if ($result !== null) { |
|
31 | 31 | $assignmentString = $result; |
32 | 32 | } |
33 | 33 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | |
50 | - if($variable->hasPath()) { |
|
50 | + if ($variable->hasPath()) { |
|
51 | 51 | return sprintf( |
52 | 52 | '$map.of(%s).keys("%s").count()', |
53 | 53 | dollarize($variable->getPath()), |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | public function translate(Mailcode_Commands_Command_ShowVariable $command): string |
24 | 24 | { |
25 | - if($command->isDecryptionEnabled()) |
|
25 | + if ($command->isDecryptionEnabled()) |
|
26 | 26 | { |
27 | 27 | $varName = $this->renderDecryptionKey($command); |
28 | 28 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $keyName = $command->getDecryptionKeyName(); |
40 | 40 | |
41 | - if(!empty($keyName)) |
|
41 | + if (!empty($keyName)) |
|
42 | 42 | { |
43 | 43 | $varName = sprintf( |
44 | 44 | 'text.decrypt(%s, "%s")', |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ); |
57 | 57 | } |
58 | 58 | |
59 | - if($this->hasVariableEncodings($command)) { |
|
59 | + if ($this->hasVariableEncodings($command)) { |
|
60 | 60 | $varName = '${'.$varName.'}'; |
61 | 61 | } |
62 | 62 |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | if($command->isDecryptionEnabled()) |
26 | 26 | { |
27 | 27 | $varName = $this->renderDecryptionKey($command); |
28 | - } |
|
29 | - else |
|
28 | + } else |
|
30 | 29 | { |
31 | 30 | $varName = undollarize($command->getVariableName()); |
32 | 31 | } |
@@ -45,8 +44,7 @@ discard block |
||
45 | 44 | dollarize($command->getVariableName()), |
46 | 45 | $keyName |
47 | 46 | ); |
48 | - } |
|
49 | - else |
|
47 | + } else |
|
50 | 48 | { |
51 | 49 | // This will make the decryption system use the system's |
52 | 50 | // default key name. |
@@ -31,15 +31,15 @@ |
||
31 | 31 | // This ending command is tied to a preprocessing command: Since |
32 | 32 | // we do not want to keep these, we return an empty string to strip |
33 | 33 | // it out. |
34 | - if($openCmd instanceof Mailcode_Interfaces_Commands_PreProcessing) { |
|
34 | + if ($openCmd instanceof Mailcode_Interfaces_Commands_PreProcessing) { |
|
35 | 35 | return ''; |
36 | 36 | } |
37 | 37 | |
38 | - if($openCmd instanceof Mailcode_Commands_Command_For) { |
|
38 | + if ($openCmd instanceof Mailcode_Commands_Command_For) { |
|
39 | 39 | return '{% endfor %}'; |
40 | 40 | } |
41 | 41 | |
42 | - if($openCmd instanceof Mailcode_Commands_IfBase) { |
|
42 | + if ($openCmd instanceof Mailcode_Commands_IfBase) { |
|
43 | 43 | return '{% endif %}'; |
44 | 44 | } |
45 | 45 |
@@ -23,6 +23,6 @@ |
||
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 | } |
@@ -28,7 +28,7 @@ |
||
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 | } |
@@ -26,6 +26,6 @@ |
||
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 | } |
@@ -33,7 +33,7 @@ |
||
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 | } |
@@ -33,7 +33,7 @@ |
||
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 | } |
@@ -34,13 +34,13 @@ discard block |
||
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 |
||
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 |
||
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() |