@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $bbdBlocks = $this->numBigBlockDepotBlocks; |
118 | 118 | |
119 | 119 | if ($this->numExtensionBlocks != 0) { |
120 | - $bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS)/4; |
|
120 | + $bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS) / 4; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | for ($i = 0; $i < $bbdBlocks; ++$i) { |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | for ($i = 0; $i < $this->numBigBlockDepotBlocks; ++$i) { |
147 | 147 | $pos = ($bigBlockDepotBlocks[$i] + 1) * self::BIG_BLOCK_SIZE; |
148 | 148 | |
149 | - $this->bigBlockChain .= substr($this->data, $pos, 4*$bbs); |
|
150 | - $pos += 4*$bbs; |
|
149 | + $this->bigBlockChain .= substr($this->data, $pos, 4 * $bbs); |
|
150 | + $pos += 4 * $bbs; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $pos = 0; |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | while ($sbdBlock != -2) { |
157 | 157 | $pos = ($sbdBlock + 1) * self::BIG_BLOCK_SIZE; |
158 | 158 | |
159 | - $this->smallBlockChain .= substr($this->data, $pos, 4*$bbs); |
|
160 | - $pos += 4*$bbs; |
|
159 | + $this->smallBlockChain .= substr($this->data, $pos, 4 * $bbs); |
|
160 | + $pos += 4 * $bbs; |
|
161 | 161 | |
162 | - $sbdBlock = self::getInt4d($this->bigBlockChain, $sbdBlock*4); |
|
162 | + $sbdBlock = self::getInt4d($this->bigBlockChain, $sbdBlock * 4); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | // read the directory stream |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $pos = $block * self::SMALL_BLOCK_SIZE; |
192 | 192 | $streamData .= substr($rootdata, $pos, self::SMALL_BLOCK_SIZE); |
193 | 193 | |
194 | - $block = self::getInt4d($this->smallBlockChain, $block*4); |
|
194 | + $block = self::getInt4d($this->smallBlockChain, $block * 4); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | return $streamData; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | while ($block != -2) { |
211 | 211 | $pos = ($block + 1) * self::BIG_BLOCK_SIZE; |
212 | 212 | $streamData .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); |
213 | - $block = self::getInt4d($this->bigBlockChain, $block*4); |
|
213 | + $block = self::getInt4d($this->bigBlockChain, $block * 4); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | return $streamData; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | while ($block != -2) { |
232 | 232 | $pos = ($block + 1) * self::BIG_BLOCK_SIZE; |
233 | 233 | $data .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); |
234 | - $block = self::getInt4d($this->bigBlockChain, $block*4); |
|
234 | + $block = self::getInt4d($this->bigBlockChain, $block * 4); |
|
235 | 235 | } |
236 | 236 | return $data; |
237 | 237 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $d = substr($this->entry, $offset, self::PROPERTY_STORAGE_BLOCK_SIZE); |
251 | 251 | |
252 | 252 | // size in bytes of name |
253 | - $nameSize = ord($d[self::SIZE_OF_NAME_POS]) | (ord($d[self::SIZE_OF_NAME_POS+1]) << 8); |
|
253 | + $nameSize = ord($d[self::SIZE_OF_NAME_POS]) | (ord($d[self::SIZE_OF_NAME_POS + 1]) << 8); |
|
254 | 254 | |
255 | 255 | // type of entry |
256 | 256 | $type = ord($d[self::TYPE_POS]); |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | $y1 = $offsetY; |
237 | 237 | |
238 | 238 | // Initialise end cell to the same as the start cell |
239 | - $col_end = $col_start; // Col containing lower right corner of object |
|
240 | - $row_end = $row_start; // Row containing bottom right corner of object |
|
239 | + $col_end = $col_start; // Col containing lower right corner of object |
|
240 | + $row_end = $row_start; // Row containing bottom right corner of object |
|
241 | 241 | |
242 | 242 | // Zero the specified offset if greater than the cell dimensions |
243 | 243 | if ($x1 >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start))) { |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | $y1 = 0; |
248 | 248 | } |
249 | 249 | |
250 | - $width = $width + $x1 -1; |
|
251 | - $height = $height + $y1 -1; |
|
250 | + $width = $width + $x1 - 1; |
|
251 | + $height = $height + $y1 - 1; |
|
252 | 252 | |
253 | 253 | // Subtract the underlying cell widths to find the end cell of the image |
254 | 254 | while ($width >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end))) { |
@@ -267,21 +267,21 @@ discard block |
||
267 | 267 | if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) == 0) { |
268 | 268 | return; |
269 | 269 | } |
270 | - if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) { |
|
270 | + if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | if (self::sizeRow($sheet, $row_start + 1) == 0) { |
274 | 274 | return; |
275 | 275 | } |
276 | - if (self::sizeRow($sheet, $row_end + 1) == 0) { |
|
276 | + if (self::sizeRow($sheet, $row_end + 1) == 0) { |
|
277 | 277 | return; |
278 | 278 | } |
279 | 279 | |
280 | 280 | // Convert the pixel values to the percentage value expected by Excel |
281 | - $x1 = $x1 / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024; |
|
282 | - $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; |
|
283 | - $x2 = ($width + 1) / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object |
|
284 | - $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object |
|
281 | + $x1 = $x1 / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024; |
|
282 | + $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; |
|
283 | + $x2 = ($width + 1) / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object |
|
284 | + $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object |
|
285 | 285 | |
286 | 286 | $startCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_start) . ($row_start + 1); |
287 | 287 | $endCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_end) . ($row_end + 1); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public static function degreesToAngle($pValue = 0) |
146 | 146 | { |
147 | - return (int)round($pValue * 60000); |
|
147 | + return (int) round($pValue * 60000); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | // Load the image into a string |
175 | 175 | $file = fopen($p_sFile, "rb"); |
176 | 176 | $read = fread($file, 10); |
177 | - while (!feof($file) && ($read<>"")) { |
|
177 | + while (!feof($file) && ($read <> "")) { |
|
178 | 178 | $read .= fread($file, 1024); |
179 | 179 | } |
180 | 180 | |
@@ -184,15 +184,15 @@ discard block |
||
184 | 184 | |
185 | 185 | // Process the header |
186 | 186 | // Structure: http://www.fastgraph.com/help/bmp_header_format.html |
187 | - if (substr($header, 0, 4)=="424d") { |
|
187 | + if (substr($header, 0, 4) == "424d") { |
|
188 | 188 | // Cut it in parts of 2 bytes |
189 | 189 | $header_parts = str_split($header, 2); |
190 | 190 | |
191 | 191 | // Get the width 4 bytes |
192 | - $width = hexdec($header_parts[19].$header_parts[18]); |
|
192 | + $width = hexdec($header_parts[19] . $header_parts[18]); |
|
193 | 193 | |
194 | 194 | // Get the height 4 bytes |
195 | - $height = hexdec($header_parts[23].$header_parts[22]); |
|
195 | + $height = hexdec($header_parts[23] . $header_parts[22]); |
|
196 | 196 | |
197 | 197 | // Unset the header params |
198 | 198 | unset($header_parts); |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | // Calculate if padding at the end-line is needed |
212 | 212 | // Divided by two to keep overview. |
213 | 213 | // 1 byte = 2 HEX-chars |
214 | - $body_size = (strlen($body)/2); |
|
215 | - $header_size = ($width*$height); |
|
214 | + $body_size = (strlen($body) / 2); |
|
215 | + $header_size = ($width * $height); |
|
216 | 216 | |
217 | 217 | // Use end-line padding? Only when needed |
218 | - $usePadding = ($body_size>($header_size*3)+4); |
|
218 | + $usePadding = ($body_size > ($header_size * 3) + 4); |
|
219 | 219 | |
220 | 220 | // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption |
221 | 221 | // Calculate the next DWORD-position in the body |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | // If padding needed, ignore image-padding |
226 | 226 | // Shift i to the ending of the current 32-bit-block |
227 | 227 | if ($usePadding) { |
228 | - $i += $width%4; |
|
228 | + $i += $width % 4; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | // Reset horizontal position |
@@ -243,13 +243,13 @@ discard block |
||
243 | 243 | // Calculation of the RGB-pixel (defined as BGR in image-data) |
244 | 244 | // Define $i_pos as absolute position in the body |
245 | 245 | $i_pos = $i * 2; |
246 | - $r = hexdec($body[$i_pos+4].$body[$i_pos+5]); |
|
247 | - $g = hexdec($body[$i_pos+2].$body[$i_pos+3]); |
|
248 | - $b = hexdec($body[$i_pos].$body[$i_pos+1]); |
|
246 | + $r = hexdec($body[$i_pos + 4] . $body[$i_pos + 5]); |
|
247 | + $g = hexdec($body[$i_pos + 2] . $body[$i_pos + 3]); |
|
248 | + $b = hexdec($body[$i_pos] . $body[$i_pos + 1]); |
|
249 | 249 | |
250 | 250 | // Calculate and draw the pixel |
251 | 251 | $color = imagecolorallocate($image, $r, $g, $b); |
252 | - imagesetpixel($image, $x, $height-$y, $color); |
|
252 | + imagesetpixel($image, $x, $height - $y, $color); |
|
253 | 253 | |
254 | 254 | // Raise the horizontal position |
255 | 255 | $x++; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | * |
47 | 47 | * @var string |
48 | 48 | */ |
49 | - private $tempFileName = ''; |
|
49 | + private $tempFileName = ''; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Create a new XMLWriter instance |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | const CHARSET_ANSI_JAPANESE_SHIFTJIS = 0x80; |
47 | 47 | const CHARSET_ANSI_KOREAN_HANGUL = 0x81; |
48 | 48 | const CHARSET_ANSI_KOREAN_JOHAB = 0x82; |
49 | - const CHARSET_ANSI_CHINESE_SIMIPLIFIED = 0x86; // gb2312 |
|
50 | - const CHARSET_ANSI_CHINESE_TRADITIONAL = 0x88; // big5 |
|
49 | + const CHARSET_ANSI_CHINESE_SIMIPLIFIED = 0x86; // gb2312 |
|
50 | + const CHARSET_ANSI_CHINESE_TRADITIONAL = 0x88; // big5 |
|
51 | 51 | const CHARSET_ANSI_GREEK = 0xA1; |
52 | 52 | const CHARSET_ANSI_TURKISH = 0xA2; |
53 | 53 | const CHARSET_ANSI_VIETNAMESE = 0xA3; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | ); |
513 | 513 | break; |
514 | 514 | default: |
515 | - throw new \PHPExcel\Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file'); |
|
515 | + throw new \PHPExcel\Exception('Unknown font name "' . $name . '". Cannot map to TrueType font file'); |
|
516 | 516 | break; |
517 | 517 | } |
518 | 518 |
@@ -91,16 +91,16 @@ |
||
91 | 91 | { |
92 | 92 | $filenameParts = pathinfo($localname); |
93 | 93 | |
94 | - $handle = fopen($this->tempDir.'/'.$filenameParts["basename"], "wb"); |
|
94 | + $handle = fopen($this->tempDir . '/' . $filenameParts["basename"], "wb"); |
|
95 | 95 | fwrite($handle, $contents); |
96 | 96 | fclose($handle); |
97 | 97 | |
98 | - $res = $this->zip->add($this->tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]); |
|
98 | + $res = $this->zip->add($this->tempDir . '/' . $filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]); |
|
99 | 99 | if ($res == 0) { |
100 | 100 | throw new \PHPExcel\Writer\Exception("Error zipping files : " . $this->zip->errorInfo(true)); |
101 | 101 | } |
102 | 102 | |
103 | - unlink($this->tempDir.'/'.$filenameParts["basename"]); |
|
103 | + unlink($this->tempDir . '/' . $filenameParts["basename"]); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
190 | 190 | . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 |
191 | 191 | . pack("V", $this->Size) // 124 |
192 | - . pack("V", 0); // 128 |
|
192 | + . pack("V", 0); // 128 |
|
193 | 193 | return $ret; |
194 | 194 | } |
195 | 195 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } elseif (count($to_save) == 1) { |
210 | 210 | $cnt = count($raList); |
211 | 211 | // If the first entry, it's the root... Don't clone it! |
212 | - $raList[$cnt] = ( $depth == 0 ) ? $to_save[0] : clone $to_save[0]; |
|
212 | + $raList[$cnt] = ($depth == 0) ? $to_save[0] : clone $to_save[0]; |
|
213 | 213 | $raList[$cnt]->No = $cnt; |
214 | 214 | $raList[$cnt]->PrevPps = 0xFFFFFFFF; |
215 | 215 | $raList[$cnt]->NextPps = 0xFFFFFFFF; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $aNext = array_slice($to_save, $iPos + 1); |
221 | 221 | $cnt = count($raList); |
222 | 222 | // If the first entry, it's the root... Don't clone it! |
223 | - $raList[$cnt] = ( $depth == 0 ) ? $to_save[$iPos] : clone $to_save[$iPos]; |
|
223 | + $raList[$cnt] = ($depth == 0) ? $to_save[$iPos] : clone $to_save[$iPos]; |
|
224 | 224 | $raList[$cnt]->No = $cnt; |
225 | 225 | $raList[$cnt]->PrevPps = self::_savePpsSetPnt($raList, $aPrev, $depth++); |
226 | 226 | $raList[$cnt]->NextPps = self::_savePpsSetPnt($raList, $aNext, $depth++); |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | public function save($filename) |
66 | 66 | { |
67 | 67 | // Initial Setting for saving |
68 | - $this->_BIG_BLOCK_SIZE = pow( |
|
68 | + $this->_BIG_BLOCK_SIZE = pow( |
|
69 | 69 | 2, |
70 | - (isset($this->_BIG_BLOCK_SIZE))? self::adjust2($this->_BIG_BLOCK_SIZE) : 9 |
|
70 | + (isset($this->_BIG_BLOCK_SIZE)) ? self::adjust2($this->_BIG_BLOCK_SIZE) : 9 |
|
71 | 71 | ); |
72 | - $this->_SMALL_BLOCK_SIZE= pow( |
|
72 | + $this->_SMALL_BLOCK_SIZE = pow( |
|
73 | 73 | 2, |
74 | - (isset($this->_SMALL_BLOCK_SIZE))? self::adjust2($this->_SMALL_BLOCK_SIZE) : 6 |
|
74 | + (isset($this->_SMALL_BLOCK_SIZE)) ? self::adjust2($this->_SMALL_BLOCK_SIZE) : 6 |
|
75 | 75 | ); |
76 | 76 | |
77 | 77 | if (is_resource($filename)) { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | public function _calcSize(&$raList) |
127 | 127 | { |
128 | 128 | // Calculate Basic Setting |
129 | - list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0,0,0); |
|
129 | + list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0, 0, 0); |
|
130 | 130 | $iSmallLen = 0; |
131 | 131 | $iSBcnt = 0; |
132 | 132 | $iCount = count($raList); |
@@ -135,21 +135,21 @@ discard block |
||
135 | 135 | $raList[$i]->Size = $raList[$i]->getDataLen(); |
136 | 136 | if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) { |
137 | 137 | $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) |
138 | - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); |
|
138 | + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0); |
|
139 | 139 | } else { |
140 | 140 | $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |
141 | - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
141 | + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | } |
145 | 145 | $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; |
146 | 146 | $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE); |
147 | - $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); |
|
148 | - $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + |
|
149 | - (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
147 | + $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt) ? 1 : 0); |
|
148 | + $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + |
|
149 | + (($iSmallLen % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
150 | 150 | $iCnt = count($raList); |
151 | 151 | $iBdCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_PPS_SIZE; |
152 | - $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); |
|
152 | + $iPPScnt = (floor($iCnt / $iBdCnt) + (($iCnt % $iBdCnt) ? 1 : 0)); |
|
153 | 153 | |
154 | 154 | return array($iSBDcnt, $iBBcnt, $iPPScnt); |
155 | 155 | } |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | */ |
165 | 165 | private static function adjust2($i2) |
166 | 166 | { |
167 | - $iWk = log($i2)/log(2); |
|
168 | - return ($iWk > floor($iWk))? floor($iWk)+1:$iWk; |
|
167 | + $iWk = log($i2) / log(2); |
|
168 | + return ($iWk > floor($iWk)) ? floor($iWk) + 1 : $iWk; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -187,17 +187,17 @@ discard block |
||
187 | 187 | $iBdExL = 0; |
188 | 188 | $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; |
189 | 189 | $iAllW = $iAll; |
190 | - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); |
|
191 | - $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); |
|
190 | + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0); |
|
191 | + $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0); |
|
192 | 192 | |
193 | 193 | // Calculate BD count |
194 | 194 | if ($iBdCnt > $i1stBdL) { |
195 | 195 | while (1) { |
196 | 196 | ++$iBdExL; |
197 | 197 | ++$iAllW; |
198 | - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); |
|
199 | - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); |
|
200 | - if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) { |
|
198 | + $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0); |
|
199 | + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0); |
|
200 | + if ($iBdCnt <= ($iBdExL * $iBlCnt + $i1stBdL)) { |
|
201 | 201 | break; |
202 | 202 | } |
203 | 203 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | . "\x00\x00\x00\x00" |
221 | 221 | . "\x00\x00\x00\x00" |
222 | 222 | . pack("V", $iBdCnt) |
223 | - . pack("V", $iBBcnt+$iSBDcnt) //ROOT START |
|
223 | + . pack("V", $iBBcnt + $iSBDcnt) //ROOT START |
|
224 | 224 | . pack("V", 0) |
225 | 225 | . pack("V", 0x1000) |
226 | 226 | . pack("V", $iSBDcnt ? 0 : -2) //Small Block Depot |
@@ -234,12 +234,12 @@ discard block |
||
234 | 234 | . pack("V", 0)// Extra BDList Count |
235 | 235 | ); |
236 | 236 | } else { |
237 | - fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL)); |
|
237 | + fwrite($FILE, pack("V", $iAll + $iBdCnt) . pack("V", $iBdExL)); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | // BDList |
241 | 241 | for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; ++$i) { |
242 | - fwrite($FILE, pack("V", $iAll+$i)); |
|
242 | + fwrite($FILE, pack("V", $iAll + $i)); |
|
243 | 243 | } |
244 | 244 | if ($i < $i1stBdL) { |
245 | 245 | $jB = $i1stBdL - $i; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $raList[$i]->startBlock = $iStBlk; |
286 | 286 | $iStBlk += |
287 | 287 | (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |
288 | - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); |
|
288 | + (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |
|
289 | 289 | } |
290 | 290 | // Close file for each PPS, and unlink it |
291 | 291 | //if (isset($raList[$i]->_PPS_FILE)) { |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | } |
319 | 319 | if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) { |
320 | 320 | $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) |
321 | - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); |
|
321 | + + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0); |
|
322 | 322 | // Add to SBD |
323 | 323 | $jB = $iSmbCnt - 1; |
324 | 324 | for ($j = 0; $j < $jB; ++$j) { |
325 | - fwrite($FILE, pack("V", $j+$iSmBlk+1)); |
|
325 | + fwrite($FILE, pack("V", $j + $iSmBlk + 1)); |
|
326 | 326 | } |
327 | 327 | fwrite($FILE, pack("V", -2)); |
328 | 328 | |
@@ -393,16 +393,16 @@ discard block |
||
393 | 393 | $iBdExL = 0; |
394 | 394 | $iAll = $iBsize + $iPpsCnt + $iSbdSize; |
395 | 395 | $iAllW = $iAll; |
396 | - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); |
|
397 | - $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); |
|
396 | + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0); |
|
397 | + $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0); |
|
398 | 398 | // Calculate BD count |
399 | - if ($iBdCnt >$i1stBdL) { |
|
399 | + if ($iBdCnt > $i1stBdL) { |
|
400 | 400 | while (1) { |
401 | 401 | ++$iBdExL; |
402 | 402 | ++$iAllW; |
403 | - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); |
|
404 | - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); |
|
405 | - if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) { |
|
403 | + $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0); |
|
404 | + $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0); |
|
405 | + if ($iBdCnt <= ($iBdExL * $iBbCnt + $i1stBdL)) { |
|
406 | 406 | break; |
407 | 407 | } |
408 | 408 | } |
@@ -412,19 +412,19 @@ discard block |
||
412 | 412 | // Set for SBD |
413 | 413 | if ($iSbdSize > 0) { |
414 | 414 | for ($i = 0; $i < ($iSbdSize - 1); ++$i) { |
415 | - fwrite($FILE, pack("V", $i+1)); |
|
415 | + fwrite($FILE, pack("V", $i + 1)); |
|
416 | 416 | } |
417 | 417 | fwrite($FILE, pack("V", -2)); |
418 | 418 | } |
419 | 419 | // Set for B |
420 | 420 | for ($i = 0; $i < ($iBsize - 1); ++$i) { |
421 | - fwrite($FILE, pack("V", $i+$iSbdSize+1)); |
|
421 | + fwrite($FILE, pack("V", $i + $iSbdSize + 1)); |
|
422 | 422 | } |
423 | 423 | fwrite($FILE, pack("V", -2)); |
424 | 424 | |
425 | 425 | // Set for PPS |
426 | 426 | for ($i = 0; $i < ($iPpsCnt - 1); ++$i) { |
427 | - fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1)); |
|
427 | + fwrite($FILE, pack("V", $i + $iSbdSize + $iBsize + 1)); |
|
428 | 428 | } |
429 | 429 | fwrite($FILE, pack("V", -2)); |
430 | 430 | // Set for BBD itself ( 0xFFFFFFFD : BBD) |
@@ -444,17 +444,17 @@ discard block |
||
444 | 444 | } |
445 | 445 | // Extra BDList |
446 | 446 | if ($iBdCnt > $i1stBdL) { |
447 | - $iN=0; |
|
448 | - $iNb=0; |
|
447 | + $iN = 0; |
|
448 | + $iNb = 0; |
|
449 | 449 | for ($i = $i1stBdL; $i < $iBdCnt; $i++, ++$iN) { |
450 | 450 | if ($iN >= ($iBbCnt - 1)) { |
451 | 451 | $iN = 0; |
452 | 452 | ++$iNb; |
453 | - fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb)); |
|
453 | + fwrite($FILE, pack("V", $iAll + $iBdCnt + $iNb)); |
|
454 | 454 | } |
455 | - fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i)); |
|
455 | + fwrite($FILE, pack("V", $iBsize + $iSbdSize + $iPpsCnt + $i)); |
|
456 | 456 | } |
457 | - if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) { |
|
457 | + if (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)) { |
|
458 | 458 | $iB = ($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)); |
459 | 459 | for ($i = 0; $i < $iB; ++$i) { |
460 | 460 | fwrite($FILE, pack("V", -1)); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * |
36 | 36 | * @var string |
37 | 37 | **/ |
38 | - protected $bestFitType = 'power'; |
|
38 | + protected $bestFitType = 'power'; |
|
39 | 39 | |
40 | 40 | |
41 | 41 | /** |