| @@ 116-146 (lines=31) @@ | ||
| 113 | ||
| 114 | $this->action(self::ACTION_DELETE_A_B); |
|
| 115 | ||
| 116 | while ($this->a !== null) {
|
|
| 117 | // determine next command |
|
| 118 | $command = self::ACTION_KEEP_A; // default |
|
| 119 | if ($this->a === ' ') {
|
|
| 120 | if (($this->lastByteOut === '+' || $this->lastByteOut === '-') |
|
| 121 | && ($this->b === $this->lastByteOut)) {
|
|
| 122 | // Don't delete this space. If we do, the addition/subtraction |
|
| 123 | // could be parsed as a post-increment |
|
| 124 | } elseif (! $this->isAlphaNum($this->b)) {
|
|
| 125 | $command = self::ACTION_DELETE_A; |
|
| 126 | } |
|
| 127 | } elseif ($this->a === "\n") {
|
|
| 128 | if ($this->b === ' ') {
|
|
| 129 | $command = self::ACTION_DELETE_A_B; |
|
| 130 | ||
| 131 | // in case of mbstring.func_overload & 2, must check for null b, |
|
| 132 | // otherwise mb_strpos will give WARNING |
|
| 133 | } elseif ($this->b === null |
|
| 134 | || (false === strpos('{[(+-!~', $this->b)
|
|
| 135 | && ! $this->isAlphaNum($this->b))) {
|
|
| 136 | $command = self::ACTION_DELETE_A; |
|
| 137 | } |
|
| 138 | } elseif (! $this->isAlphaNum($this->a)) {
|
|
| 139 | if ($this->b === ' ' |
|
| 140 | || ($this->b === "\n" |
|
| 141 | && (false === strpos('}])+-"\'', $this->a)))) {
|
|
| 142 | $command = self::ACTION_DELETE_A_B; |
|
| 143 | } |
|
| 144 | } |
|
| 145 | $this->action($command); |
|
| 146 | } |
|
| 147 | $this->output = trim($this->output); |
|
| 148 | ||
| 149 | if ($mbIntEnc !== null) {
|
|
| @@ 121-151 (lines=31) @@ | ||
| 118 | ||
| 119 | $this->action(self::ACTION_DELETE_A_B); |
|
| 120 | ||
| 121 | while ($this->a !== null) { |
|
| 122 | // determine next command |
|
| 123 | $command = self::ACTION_KEEP_A; // default |
|
| 124 | if ($this->a === ' ') { |
|
| 125 | if (($this->lastByteOut === '+' || $this->lastByteOut === '-') |
|
| 126 | && ($this->b === $this->lastByteOut)) { |
|
| 127 | // Don't delete this space. If we do, the addition/subtraction |
|
| 128 | // could be parsed as a post-increment |
|
| 129 | } elseif (! $this->isAlphaNum($this->b)) { |
|
| 130 | $command = self::ACTION_DELETE_A; |
|
| 131 | } |
|
| 132 | } elseif ($this->a === "\n") { |
|
| 133 | if ($this->b === ' ') { |
|
| 134 | $command = self::ACTION_DELETE_A_B; |
|
| 135 | ||
| 136 | // in case of mbstring.func_overload & 2, must check for null b, |
|
| 137 | // otherwise mb_strpos will give WARNING |
|
| 138 | } elseif ($this->b === null |
|
| 139 | || (false === strpos('{[(+-!~', $this->b) |
|
| 140 | && ! $this->isAlphaNum($this->b))) { |
|
| 141 | $command = self::ACTION_DELETE_A; |
|
| 142 | } |
|
| 143 | } elseif (! $this->isAlphaNum($this->a)) { |
|
| 144 | if ($this->b === ' ' |
|
| 145 | || ($this->b === "\n" |
|
| 146 | && (false === strpos('}])+-"\'', $this->a)))) { |
|
| 147 | $command = self::ACTION_DELETE_A_B; |
|
| 148 | } |
|
| 149 | } |
|
| 150 | $this->action($command); |
|
| 151 | } |
|
| 152 | $this->output = trim($this->output); |
|
| 153 | ||
| 154 | if ($mbIntEnc !== null) { |
|