@@ -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 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $varName = undollarize($name); |
44 | 44 | |
45 | - if(self::areVariableNamesLowercase()) { |
|
45 | + if (self::areVariableNamesLowercase()) { |
|
46 | 46 | $varName = strtolower($varName); |
47 | 47 | } |
48 | 48 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $variables = Mailcode::create()->createVariables()->parseString($subject)->getAll(); |
55 | 55 | |
56 | - foreach($variables as $variable) { |
|
56 | + foreach ($variables as $variable) { |
|
57 | 57 | $subject = str_replace($variable->getMatchedText(), $this->formatVariableName($variable->getFullName()), $subject); |
58 | 58 | } |
59 | 59 |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | public function createTranslator(Mailcode_Commands_Command $command) : BaseCommandTranslation |
69 | 69 | { |
70 | 70 | $class = sprintf( |
71 | - __CLASS__ .'\%s\%sTranslation', |
|
71 | + __CLASS__.'\%s\%sTranslation', |
|
72 | 72 | $this->getTypeID(), |
73 | 73 | $command->getID() |
74 | 74 | ); |
75 | 75 | |
76 | - if(!class_exists($class)) |
|
76 | + if (!class_exists($class)) |
|
77 | 77 | { |
78 | 78 | throw new Mailcode_Translator_Exception( |
79 | 79 | sprintf('Unknown command %s in translator', $command->getID()), |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $translator = new $class($command); |
89 | 89 | |
90 | - if($translator instanceof BaseCommandTranslation) |
|
90 | + if ($translator instanceof BaseCommandTranslation) |
|
91 | 91 | { |
92 | 92 | return $translator; |
93 | 93 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | $subject = $safeguard->makeSafe(); |
117 | 117 | |
118 | - if(!$safeguard->hasPlaceholders()) |
|
118 | + if (!$safeguard->hasPlaceholders()) |
|
119 | 119 | { |
120 | 120 | return $subject; |
121 | 121 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | $replaces = array(); |
126 | 126 | |
127 | - foreach($placeholders as $placeholder) |
|
127 | + foreach ($placeholders as $placeholder) |
|
128 | 128 | { |
129 | 129 | $command = $placeholder->getCommand(); |
130 | 130 |
@@ -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() |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | use Mailcode\Mailcode_Exception; |
17 | 17 | use Mailcode\Mailcode_Translator_Exception; |
18 | 18 | use function \AppLocalize\pt; |
19 | -use function \AppLocalize\pts;use function AppLocalize\t; |
|
19 | +use function \AppLocalize\pts; use function AppLocalize\t; |
|
20 | 20 | |
21 | 21 | require_once 'prepend.php'; |
22 | 22 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $error = null; |
29 | 29 | $highlighted = ''; |
30 | 30 | |
31 | -if($request->getBool('highlight')) |
|
31 | +if ($request->getBool('highlight')) |
|
32 | 32 | { |
33 | 33 | $commandsText = $request->registerParam('mailcode')->getString(); |
34 | 34 | |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | $error = $e->getMessage(); |
44 | 44 | |
45 | 45 | $collection = $e->getCollection(); |
46 | - if($collection) |
|
46 | + if ($collection) |
|
47 | 47 | { |
48 | 48 | $first = $collection->getFirstError(); |
49 | 49 | $error = $first->getMessage(); |
50 | 50 | $matched = $first->getMatchedText(); |
51 | - if(!empty($matched)) { |
|
52 | - $error .= '<br>'. t('In command:').' <code>'.$matched.'</code>'; |
|
51 | + if (!empty($matched)) { |
|
52 | + $error .= '<br>'.t('In command:').' <code>'.$matched.'</code>'; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | <p></p><br> |
94 | 94 | <h2><?php pt('Highlighted commands') ?></h2> |
95 | 95 | <?php |
96 | - if(empty($commandsText)) |
|
96 | + if (empty($commandsText)) |
|
97 | 97 | { |
98 | 98 | ?> |
99 | 99 | <div class="alert alert-info"> |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | </div> |
102 | 102 | <?php |
103 | 103 | } |
104 | - else if($error) |
|
104 | + else if ($error) |
|
105 | 105 | { |
106 | 106 | ?> |
107 | 107 | <div class="alert alert-danger"> |