@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $position = $this->getStartPosition(); |
| 56 | 56 | |
| 57 | 57 | // we're at the beginning of the string |
| 58 | - if($position === false || $position === 0) |
|
| 58 | + if ($position === false || $position === 0) |
|
| 59 | 59 | { |
| 60 | 60 | $this->log(sprintf( |
| 61 | 61 | 'Prepend: NO | Position: [%s] | Not found, or at beginning of string.', |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $prevPos = $position - $this->eolLength; |
| 69 | 69 | |
| 70 | - if($prevPos < 0) |
|
| 70 | + if ($prevPos < 0) |
|
| 71 | 71 | { |
| 72 | 72 | $prevPos = 0; |
| 73 | 73 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | protected function checkPreviousPosition(int $prevPos) : void |
| 79 | 79 | { |
| 80 | - if($this->isWithinCommand($prevPos)) |
|
| 80 | + if ($this->isWithinCommand($prevPos)) |
|
| 81 | 81 | { |
| 82 | 82 | $this->log(sprintf( |
| 83 | 83 | 'Prepend: NO | Position: [%s] | Is within a mailcode command.', |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $match = $this->subject->getSubstr($prevPos, $this->eolLength); |
| 91 | 91 | |
| 92 | - if($match !== $this->formatter->getEOLChar()) |
|
| 92 | + if ($match !== $this->formatter->getEOLChar()) |
|
| 93 | 93 | { |
| 94 | 94 | $this->log(sprintf( |
| 95 | 95 | 'Prepend: YES | Position: [%s] | Characters: [%s] | Do not match the EOL character.', |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $position = $this->getEndPosition(); |
| 109 | 109 | |
| 110 | 110 | // we're at the end of the string |
| 111 | - if($position === false || $position >= $subjectLength) |
|
| 111 | + if ($position === false || $position >= $subjectLength) |
|
| 112 | 112 | { |
| 113 | 113 | $this->log(sprintf( |
| 114 | 114 | 'Append: NO | Position: [%s] | End of string, or too long | Subject length: [%s]', |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $nextPos = $position + $this->eolLength; |
| 123 | 123 | |
| 124 | - if($nextPos > $subjectLength) |
|
| 124 | + if ($nextPos > $subjectLength) |
|
| 125 | 125 | { |
| 126 | 126 | $nextPos = $subjectLength - $this->eolLength; |
| 127 | 127 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | protected function checkNextPosition(int $nextPos) : void |
| 133 | 133 | { |
| 134 | - if($this->isWithinCommand($nextPos)) |
|
| 134 | + if ($this->isWithinCommand($nextPos)) |
|
| 135 | 135 | { |
| 136 | 136 | $this->log(sprintf( |
| 137 | 137 | 'Append: YES | Position: [%s] | Is within a mailcode command.', |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | $next = $this->subject->getSubstr($nextPos, $this->eolLength); |
| 147 | 147 | |
| 148 | - if($next !== $this->formatter->getEOLChar()) |
|
| 148 | + if ($next !== $this->formatter->getEOLChar()) |
|
| 149 | 149 | { |
| 150 | 150 | $this->log(sprintf( |
| 151 | 151 | 'Append: YES | Position: [%s] | Next characters: [%s] | Do not match the EOL character.', |
@@ -89,23 +89,23 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $placeholderID = $this->placeholder->getID(); |
| 91 | 91 | |
| 92 | - foreach($placeholders as $placeholder) |
|
| 92 | + foreach ($placeholders as $placeholder) |
|
| 93 | 93 | { |
| 94 | - if($placeholder->getID() === $placeholderID) |
|
| 94 | + if ($placeholder->getID() === $placeholderID) |
|
| 95 | 95 | { |
| 96 | 96 | continue; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $start = $this->subject->getSubstrPosition($placeholder->getReplacementText()); |
| 100 | 100 | |
| 101 | - if($start === false) |
|
| 101 | + if ($start === false) |
|
| 102 | 102 | { |
| 103 | 103 | continue; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $end = $start + $placeholder->getReplacementLength(); |
| 107 | 107 | |
| 108 | - if($position >= $start && $position <= $end) |
|
| 108 | + if ($position >= $start && $position <= $end) |
|
| 109 | 109 | { |
| 110 | 110 | return true; |
| 111 | 111 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $start = $this->getStartPosition(); |
| 123 | 123 | |
| 124 | - if($start !== false) |
|
| 124 | + if ($start !== false) |
|
| 125 | 125 | { |
| 126 | 126 | return $start + $this->placeholder->getReplacementLength(); |
| 127 | 127 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $needle = $this->placeholder->getReplacementText(); |
| 153 | 153 | |
| 154 | - if($this->subject->replaceSubstrings($needle, $replacementText)) |
|
| 154 | + if ($this->subject->replaceSubstrings($needle, $replacementText)) |
|
| 155 | 155 | { |
| 156 | 156 | return; |
| 157 | 157 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | public function format() : void |
| 170 | 170 | { |
| 171 | - if($this->requiresAdjustment() && (!empty($this->prepend) || !empty($this->append))) |
|
| 171 | + if ($this->requiresAdjustment() && (!empty($this->prepend) || !empty($this->append))) |
|
| 172 | 172 | { |
| 173 | 173 | $this->replaceWith(sprintf( |
| 174 | 174 | '%s%s%s', |