@@ -73,7 +73,7 @@ |
||
73 | 73 | // All other special characters have to be escaped |
74 | 74 | // with two backslashes. |
75 | 75 | foreach ($this->regexSpecialChars as $char) { |
76 | - $string = str_replace($char, '\\' . $char, $string); |
|
76 | + $string = str_replace($char, '\\'.$char, $string); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // Restore the escaped quotes, which stay escaped |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $cmd = $this->commands->createCommand( |
52 | 52 | 'ShowDate', |
53 | 53 | '', |
54 | - $variableName . $format . $timezone, |
|
54 | + $variableName.$format.$timezone, |
|
55 | 55 | sprintf( |
56 | 56 | '{showdate: %s%s%s}', |
57 | 57 | $variableName, |
@@ -60,6 +60,6 @@ |
||
60 | 60 | return $string; |
61 | 61 | } |
62 | 62 | |
63 | - return '"' . str_replace('"', '\"', $string) . '"'; |
|
63 | + return '"'.str_replace('"', '\"', $string).'"'; |
|
64 | 64 | } |
65 | 65 | } |
@@ -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. |
@@ -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 | } |
@@ -56,20 +56,20 @@ discard block |
||
56 | 56 | public function getDecryptionKeyName() : string |
57 | 57 | { |
58 | 58 | $key = $this->getDecryptionKeyToken(); |
59 | - if($key === null) { |
|
59 | + if ($key === null) { |
|
60 | 60 | return ''; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $keyName = $key->getText(); |
64 | 64 | |
65 | - if(empty($keyName)) { |
|
65 | + if (empty($keyName)) { |
|
66 | 66 | $keyName = (string)DecryptSettings::getDefaultKeyName(); |
67 | 67 | } |
68 | 68 | |
69 | 69 | return $keyName; |
70 | 70 | } |
71 | 71 | |
72 | - public function enableDecryption(string $keyName=DecryptInterface::DEFAULT_DECRYPTION_KEY_NAME) : self |
|
72 | + public function enableDecryption(string $keyName = DecryptInterface::DEFAULT_DECRYPTION_KEY_NAME) : self |
|
73 | 73 | { |
74 | 74 | $this->decryptionKeyToken = $this |
75 | 75 | ->requireParams() |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | public function disableDecryption() : self |
83 | 83 | { |
84 | - if(isset($this->decryptionKeyToken)) { |
|
84 | + if (isset($this->decryptionKeyToken)) { |
|
85 | 85 | $this |
86 | 86 | ->requireParams() |
87 | 87 | ->getInfo() |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function getDecryptionKeyToken(): ?Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral; |
42 | 42 | |
43 | - public function enableDecryption(string $keyName=DecryptInterface::DEFAULT_DECRYPTION_KEY_NAME) : self; |
|
43 | + public function enableDecryption(string $keyName = DecryptInterface::DEFAULT_DECRYPTION_KEY_NAME) : self; |
|
44 | 44 | |
45 | 45 | public function disableDecryption() : self; |
46 | 46 | public function isDecryptionEnabled() : bool; |