@@ -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 | } |
@@ -24,14 +24,14 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $varName = undollarize($command->getVariableName()); |
| 26 | 26 | |
| 27 | - if($command->isDecryptionEnabled()) { |
|
| 27 | + if ($command->isDecryptionEnabled()) { |
|
| 28 | 28 | $varName = sprintf( |
| 29 | 29 | 'text.decrypt(%s, "%s")', |
| 30 | 30 | dollarize($varName), |
| 31 | 31 | $command->getDecryptionKey() |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - if($this->hasVariableEncodings($command)) { |
|
| 34 | + if ($this->hasVariableEncodings($command)) { |
|
| 35 | 35 | $varName = '${'.$varName.'}'; |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function getDecryptionKeyToken(): ?Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral; |
| 44 | 44 | |
| 45 | - public function enableDecryption(string $key=DecryptInterface::DEFAULT_DECRYPTION_KEY) : self; |
|
| 45 | + public function enableDecryption(string $key = DecryptInterface::DEFAULT_DECRYPTION_KEY) : self; |
|
| 46 | 46 | |
| 47 | 47 | public function disableDecryption() : self; |
| 48 | 48 | public function isDecryptionEnabled() : bool; |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | ->getInfo() |
| 38 | 38 | ->getTokenByParamName(DecryptInterface::PARAMETER_NAME); |
| 39 | 39 | |
| 40 | - if($token === null) { |
|
| 40 | + if ($token === null) { |
|
| 41 | 41 | return; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | if (!$token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) { |
| 45 | 45 | $this->validationResult->makeError( |
| 46 | - t('Invalid decryption key token:') . ' ' . t('Expected a string.'), |
|
| 46 | + t('Invalid decryption key token:').' '.t('Expected a string.'), |
|
| 47 | 47 | DecryptInterface::VALIDATION_DECRYPT_CODE_WRONG_TYPE |
| 48 | 48 | ); |
| 49 | 49 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $key = $this->getDecryptionKey(); |
| 54 | 54 | |
| 55 | - if($key !== DecryptInterface::DEFAULT_DECRYPTION_KEY) { |
|
| 55 | + if ($key !== DecryptInterface::DEFAULT_DECRYPTION_KEY) { |
|
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -73,20 +73,20 @@ discard block |
||
| 73 | 73 | public function getDecryptionKey() : string |
| 74 | 74 | { |
| 75 | 75 | $key = $this->getDecryptionKeyToken(); |
| 76 | - if($key === null) { |
|
| 76 | + if ($key === null) { |
|
| 77 | 77 | return ''; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $key = $key->getText(); |
| 81 | 81 | |
| 82 | - if(empty($key) || $key === DecryptInterface::DEFAULT_DECRYPTION_KEY) { |
|
| 82 | + if (empty($key) || $key === DecryptInterface::DEFAULT_DECRYPTION_KEY) { |
|
| 83 | 83 | return DecryptSettings::getDefaultKey(); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $key; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - public function enableDecryption(string $key=DecryptInterface::DEFAULT_DECRYPTION_KEY) : self |
|
| 89 | + public function enableDecryption(string $key = DecryptInterface::DEFAULT_DECRYPTION_KEY) : self |
|
| 90 | 90 | { |
| 91 | 91 | $this->decryptionKeyToken = $this |
| 92 | 92 | ->requireParams() |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | public function disableDecryption() : self |
| 100 | 100 | { |
| 101 | - if(isset($this->decryptionKeyToken)) { |
|
| 101 | + if (isset($this->decryptionKeyToken)) { |
|
| 102 | 102 | $this |
| 103 | 103 | ->requireParams() |
| 104 | 104 | ->getInfo() |