@@ -100,8 +100,7 @@ discard block |
||
| 100 | 100 | case '1': |
| 101 | 101 | case '2': |
| 102 | 102 | $symbol = ($switch == 1) |
| 103 | - ? $str[0] : |
|
| 104 | - HuffmanCoding::SYMBOL_EOF; |
|
| 103 | + ? $str[0] : HuffmanCoding::SYMBOL_EOF; |
|
| 105 | 104 | $str = mb_substr($str, 1); |
| 106 | 105 | |
| 107 | 106 | $retval = new self($symbol); |
@@ -128,7 +127,7 @@ discard block |
||
| 128 | 127 | { |
| 129 | 128 | if ($this->isLeaf()) { |
| 130 | 129 | if ($this->symbol === HuffmanCoding::SYMBOL_EOF) { |
| 131 | - return '2~'; // ~ stands in BC HuffmanCoding::SYMBOL_EOF may be more than one byte |
|
| 130 | + return '2~'; // ~ stands in BC HuffmanCoding::SYMBOL_EOF may be more than one byte |
|
| 132 | 131 | } else { |
| 133 | 132 | return '1'.$this->symbol; |
| 134 | 133 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | } |
| 28 | 28 | ++$weights[$sample[$i]]; |
| 29 | 29 | } |
| 30 | - $weights[self::SYMBOL_EOF] = 1; // add the EOF marker to the encoding |
|
| 30 | + $weights[self::SYMBOL_EOF] = 1; // add the EOF marker to the encoding |
|
| 31 | 31 | |
| 32 | 32 | $queue = new HuffmanNodeQueue(); |
| 33 | 33 | \arsort($weights); |