Completed
Push — 1.10.x ( 9d8f25...0ad4ea )
by Angel Fernando Quiroz
80:30 queued 40:12
created
main/inc/lib/pear/HTML/QuickForm/select.php 3 patches
Doc Comments   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      *
146 146
      * @since     1.0
147 147
      * @access    public
148
-     * @return    array of selected values
148
+     * @return    string of selected values
149 149
      */
150 150
     function getSelected()
151 151
     {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     /**
209 209
      * Sets the value of the form element
210 210
      *
211
-     * @param     mixed    $values  Array or comma delimited string of selected values
211
+     * @param     mixed    $value  Array or comma delimited string of selected values
212 212
      * @since     1.0
213 213
      * @access    public
214 214
      * @return    void
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      *
227 227
      * @since     1.0
228 228
      * @access    public
229
-     * @return    array of selected values
229
+     * @return    string of selected values
230 230
      */
231 231
     function getValue()
232 232
     {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      *
258 258
      * @since     1.0
259 259
      * @access    public
260
-     * @return    int
260
+     * @return    string|null
261 261
      */
262 262
     function getSize()
263 263
     {
@@ -357,12 +357,9 @@  discard block
 block discarded – undo
357 357
         /**
358 358
      * Adds a new OPTION to the SELECT
359 359
      *
360
-     * @param     string    $text       Display text for the OPTION
361
-     * @param     string    $value      Value for the OPTION
362
-     * @param     mixed     $attributes Either a typical HTML attribute string
363
-     *                                  or an associative array
364 360
      * @since     1.0
365 361
      * @access    public
362
+     * @param string $label
366 363
      * @return    void
367 364
      */
368 365
     function addOptGroup($options, $label)
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -355,16 +355,16 @@  discard block
 block discarded – undo
355 355
 
356 356
 
357 357
         /**
358
-     * Adds a new OPTION to the SELECT
359
-     *
360
-     * @param     string    $text       Display text for the OPTION
361
-     * @param     string    $value      Value for the OPTION
362
-     * @param     mixed     $attributes Either a typical HTML attribute string
363
-     *                                  or an associative array
364
-     * @since     1.0
365
-     * @access    public
366
-     * @return    void
367
-     */
358
+         * Adds a new OPTION to the SELECT
359
+         *
360
+         * @param     string    $text       Display text for the OPTION
361
+         * @param     string    $value      Value for the OPTION
362
+         * @param     mixed     $attributes Either a typical HTML attribute string
363
+         *                                  or an associative array
364
+         * @since     1.0
365
+         * @access    public
366
+         * @return    void
367
+         */
368 368
     function addOptGroup($options, $label)
369 369
     {
370 370
         foreach ($options as $option) {
@@ -614,10 +614,10 @@  discard block
 block discarded – undo
614 614
             }
615 615
             foreach ($value as $key => $item) {
616 616
                 $html .= '<input' . $this->_getAttrString(array(
617
-                             'type'  => 'hidden',
618
-                             'name'  => $name,
619
-                             'value' => $this->_values[$key]
620
-                         ) + $idAttr) . ' />';
617
+                                'type'  => 'hidden',
618
+                                'name'  => $name,
619
+                                'value' => $this->_values[$key]
620
+                            ) + $idAttr) . ' />';
621 621
             }
622 622
         }
623 623
         return $html;
@@ -626,10 +626,10 @@  discard block
 block discarded – undo
626 626
     // }}}
627 627
     // {{{ exportValue()
628 628
 
629
-   /**
630
-    * We check the options and return only the values that _could_ have been
631
-    * selected. We also return a scalar value if select is not "multiple"
632
-    */
629
+    /**
630
+     * We check the options and return only the values that _could_ have been
631
+     * selected. We also return a scalar value if select is not "multiple"
632
+     */
633 633
     function exportValue(&$submitValues, $assoc = false)
634 634
     {
635 635
         $value = $this->_findValue($submitValues);
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             if (!empty($attributes['class'])) {
87 87
                 $oldClass = $attributes['class'];
88 88
             }
89
-            $attributes['class'] = $oldClass . ' selectpicker show-tick form-control';
89
+            $attributes['class'] = $oldClass.' selectpicker show-tick form-control';
90 90
             $attributes['data-live-search'] = 'true';
91 91
         }
92 92
         $columnsSize = isset($attributes['cols-size']) ? $attributes['cols-size'] : null;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     function getPrivateName()
197 197
     {
198 198
         if ($this->getAttribute('multiple')) {
199
-            return $this->getName() . '[]';
199
+            return $this->getName().'[]';
200 200
         } else {
201 201
             return $this->getName();
202 202
         }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
      */
313 313
     function getMultiple()
314 314
     {
315
-        return (bool)$this->getAttribute('multiple');
315
+        return (bool) $this->getAttribute('multiple');
316 316
     } //end func getMultiple
317 317
 
318 318
     // }}}
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     function addOption($text, $value, $attributes = null, $return_array = false)
333 333
     {
334 334
         if (null === $attributes) {
335
-            $attributes = array('value' => (string)$value);
335
+            $attributes = array('value' => (string) $value);
336 336
         } else {
337 337
             $attributes = $this->_parseAttributes($attributes);
338 338
             if (isset($attributes['selected'])) {
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                     $this->_values[] = $value;
345 345
                 }
346 346
             }
347
-            $this->_updateAttrArray($attributes, array('value' => (string)$value));
347
+            $this->_updateAttrArray($attributes, array('value' => (string) $value));
348 348
         }
349 349
         if ($return_array) {
350 350
             return array('text' => $text, 'attr' => $attributes);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      * @return    PEAR_Error on error or true
384 384
      * @throws    PEAR_Error
385 385
      */
386
-    function loadArray($arr, $values=null)
386
+    function loadArray($arr, $values = null)
387 387
     {
388 388
         if (!is_array($arr)) {
389 389
             return PEAR::raiseError('Argument 1 of HTML_Select::loadArray is not a valid array');
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      * @return    PEAR_Error on error or true
421 421
      * @throws    PEAR_Error
422 422
      */
423
-    function loadDbResult(&$result, $textCol=null, $valueCol=null, $values=null)
423
+    function loadDbResult(&$result, $textCol = null, $valueCol = null, $values = null)
424 424
     {
425 425
         if (!is_object($result) || !is_a($result, 'db_result')) {
426 426
             return PEAR::raiseError('Argument 1 of HTML_Select::loadDbResult is not a valid DB_result');
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
             $this->setValue($values);
430 430
         }
431 431
         $fetchMode = ($textCol && $valueCol) ? DB_FETCHMODE_ASSOC : DB_FETCHMODE_ORDERED;
432
-        while (is_array($row = $result->fetchRow($fetchMode)) ) {
432
+        while (is_array($row = $result->fetchRow($fetchMode))) {
433 433
             if ($fetchMode == DB_FETCHMODE_ASSOC) {
434 434
                 $this->addOption($row[$textCol], $row[$valueCol]);
435 435
             } else {
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      * @return    void
456 456
      * @throws    PEAR_Error
457 457
      */
458
-    function loadQuery(&$conn, $sql, $textCol=null, $valueCol=null, $values=null)
458
+    function loadQuery(&$conn, $sql, $textCol = null, $valueCol = null, $values = null)
459 459
     {
460 460
         if (is_string($conn)) {
461 461
             require_once('DB.php');
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      * @return    PEAR_Error on error or true
503 503
      * @throws    PEAR_Error
504 504
      */
505
-    function load(&$options, $param1=null, $param2=null, $param3=null, $param4=null)
505
+    function load(&$options, $param1 = null, $param2 = null, $param3 = null, $param4 = null)
506 506
     {
507 507
         switch (true) {
508 508
             case is_array($options):
@@ -539,32 +539,32 @@  discard block
 block discarded – undo
539 539
             $strHtml = '';
540 540
 
541 541
             if ($this->getComment() != '') {
542
-                $strHtml .= $tabs . '<!-- ' . $this->getComment() . " //-->\n";
542
+                $strHtml .= $tabs.'<!-- '.$this->getComment()." //-->\n";
543 543
             }
544 544
 
545 545
             if (!$this->getMultiple()) {
546 546
                 $attrString = $this->_getAttrString($this->_attributes);
547 547
             } else {
548 548
                 $myName = $this->getName();
549
-                $this->setName($myName . '[]');
549
+                $this->setName($myName.'[]');
550 550
                 $attrString = $this->_getAttrString($this->_attributes);
551 551
                 $this->setName($myName);
552 552
             }
553 553
 
554
-            $strHtml .= $tabs . '<select ' . $attrString . ">\n";
554
+            $strHtml .= $tabs.'<select '.$attrString.">\n";
555 555
 
556
-            $strValues = is_array($this->_values)? array_map('strval', $this->_values): array();
556
+            $strValues = is_array($this->_values) ? array_map('strval', $this->_values) : array();
557 557
 
558 558
             foreach ($this->_options as $option) {
559 559
 
560 560
                 if (!empty($strValues) && in_array($option['attr']['value'], $strValues, true)) {
561 561
                     $option['attr']['selected'] = 'selected';
562 562
                 }
563
-                $strHtml .= $tabs . "<option" . $this->_getAttrString($option['attr']) . '>' .
564
-                    $option['text'] . "</option>";
563
+                $strHtml .= $tabs."<option".$this->_getAttrString($option['attr']).'>'.
564
+                    $option['text']."</option>";
565 565
             }
566 566
             foreach ($this->_optgroups as $optgroup) {
567
-                $strHtml .= $tabs . '<optgroup label="' . $optgroup['label'] . '">';
567
+                $strHtml .= $tabs.'<optgroup label="'.$optgroup['label'].'">';
568 568
                 foreach ($optgroup['options'] as $option) {
569 569
                     $text = $option['text'];
570 570
                     unset($option['text']);
@@ -573,11 +573,11 @@  discard block
 block discarded – undo
573 573
                         $option['selected'] = 'selected';
574 574
                     }
575 575
 
576
-                    $strHtml .= $tabs . " <option" . $this->_getAttrString($option) . '>' .$text . "</option>";
576
+                    $strHtml .= $tabs." <option".$this->_getAttrString($option).'>'.$text."</option>";
577 577
                 }
578 578
                 $strHtml .= "</optgroup>";
579 579
             }
580
-            return $strHtml . $tabs . '</select>';
580
+            return $strHtml.$tabs.'</select>';
581 581
         }
582 582
     }
583 583
 
@@ -602,22 +602,22 @@  discard block
 block discarded – undo
602 602
                 }
603 603
             }
604 604
         }
605
-        $html = empty($value)? '&nbsp;': join('<br />', $value);
605
+        $html = empty($value) ? '&nbsp;' : join('<br />', $value);
606 606
         if ($this->_persistantFreeze) {
607 607
             $name = $this->getPrivateName();
608 608
             // Only use id attribute if doing single hidden input
609 609
             if (1 == count($value)) {
610 610
                 $id     = $this->getAttribute('id');
611
-                $idAttr = isset($id)? array('id' => $id): array();
611
+                $idAttr = isset($id) ? array('id' => $id) : array();
612 612
             } else {
613 613
                 $idAttr = array();
614 614
             }
615 615
             foreach ($value as $key => $item) {
616
-                $html .= '<input' . $this->_getAttrString(array(
616
+                $html .= '<input'.$this->_getAttrString(array(
617 617
                              'type'  => 'hidden',
618 618
                              'name'  => $name,
619 619
                              'value' => $this->_values[$key]
620
-                         ) + $idAttr) . ' />';
620
+                         ) + $idAttr).' />';
621 621
             }
622 622
         }
623 623
         return $html;
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
         $value = $this->_findValue($submitValues);
636 636
         if (is_null($value)) {
637 637
             $value = $this->getValue();
638
-        } elseif(!is_array($value)) {
638
+        } elseif (!is_array($value)) {
639 639
             $value = array($value);
640 640
         }
641 641
         if (is_array($value) && !empty($this->_options)) {
Please login to merge, or discard this patch.
main/inc/lib/pear/HTML/QuickForm/submit.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
      * Freeze the element so that only its value is returned
61 61
      *
62 62
      * @access    public
63
-     * @return    void
63
+     * @return    boolean
64 64
      */
65 65
     function freeze()
66 66
     {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,10 +70,10 @@
 block discarded – undo
70 70
     // }}}
71 71
     // {{{ exportValue()
72 72
 
73
-   /**
74
-    * Only return the value if it is found within $submitValues (i.e. if
75
-    * this particular submit button was clicked)
76
-    */
73
+    /**
74
+     * Only return the value if it is found within $submitValues (i.e. if
75
+     * this particular submit button was clicked)
76
+     */
77 77
     function exportValue(&$submitValues, $assoc = false)
78 78
     {
79 79
         return $this->_prepareValue($this->_findValue($submitValues), $assoc);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      * @access    public
16 16
      * @return    void
17 17
      */
18
-    public function __construct($elementName=null, $value=null, $attributes=null)
18
+    public function __construct($elementName = null, $value = null, $attributes = null)
19 19
     {
20 20
         parent::__construct($elementName, null, $attributes);
21 21
         $this->setValue($value);
Please login to merge, or discard this patch.
main/inc/lib/pear/HTML/QuickForm/textarea.php 3 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -54,6 +54,8 @@
 block discarded – undo
54 54
      * @param     string    Input field name attribute
55 55
      * @param     mixed     Label(s) for a field
56 56
      * @param     mixed     Either a typical HTML attribute string or an associative array
57
+     * @param string $elementName
58
+     * @param string $elementLabel
57 59
      * @since     1.0
58 60
      * @access    public
59 61
      * @return    void
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -194,13 +194,13 @@
 block discarded – undo
194 194
             return $this->getFrozenHtml();
195 195
         } else {
196 196
             return $this->_getTabs() .
197
-                   '<textarea' . $this->_getAttrString($this->_attributes) . '>' .
198
-                   // because we wrap the form later we don't want the text indented
199
-                   // Modified by Ivan Tcholakov, 16-MAR-2010.
200
-                   //preg_replace("/(\r\n|\n|\r)/", '&#010;', htmlspecialchars($this->_value)) .
201
-                   preg_replace("/(\r\n|\n|\r)/", '&#010;', @htmlspecialchars($this->_value, ENT_COMPAT, HTML_Common::charset())) .
202
-                   //
203
-                   '</textarea>';
197
+                    '<textarea' . $this->_getAttrString($this->_attributes) . '>' .
198
+                    // because we wrap the form later we don't want the text indented
199
+                    // Modified by Ivan Tcholakov, 16-MAR-2010.
200
+                    //preg_replace("/(\r\n|\n|\r)/", '&#010;', htmlspecialchars($this->_value)) .
201
+                    preg_replace("/(\r\n|\n|\r)/", '&#010;', @htmlspecialchars($this->_value, ENT_COMPAT, HTML_Common::charset())) .
202
+                    //
203
+                    '</textarea>';
204 204
         }
205 205
     }
206 206
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @access    public
59 59
      * @return    void
60 60
      */
61
-    public function __construct($elementName=null, $elementLabel=null, $attributes=null)
61
+    public function __construct($elementName = null, $elementLabel = null, $attributes = null)
62 62
     {
63 63
         $attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'form-control';
64 64
         $columnsSize = isset($attributes['cols-size']) ? $attributes['cols-size'] : null;
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
         if ($this->_flagFrozen) {
194 194
             return $this->getFrozenHtml();
195 195
         } else {
196
-            return $this->_getTabs() .
197
-                   '<textarea' . $this->_getAttrString($this->_attributes) . '>' .
196
+            return $this->_getTabs().
197
+                   '<textarea'.$this->_getAttrString($this->_attributes).'>'.
198 198
                    // because we wrap the form later we don't want the text indented
199 199
                    // Modified by Ivan Tcholakov, 16-MAR-2010.
200 200
                    //preg_replace("/(\r\n|\n|\r)/", '&#010;', htmlspecialchars($this->_value)) .
201
-                   preg_replace("/(\r\n|\n|\r)/", '&#010;', @htmlspecialchars($this->_value, ENT_COMPAT, HTML_Common::charset())) .
201
+                   preg_replace("/(\r\n|\n|\r)/", '&#010;', @htmlspecialchars($this->_value, ENT_COMPAT, HTML_Common::charset())).
202 202
                    //
203 203
                    '</textarea>';
204 204
         }
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
         $value = @htmlspecialchars($this->getValue(), ENT_COMPAT, HTML_Common::charset());
219 219
         //
220 220
         if ($this->getAttribute('wrap') == 'off') {
221
-            $html = $this->_getTabs() . '<pre>' . $value."</pre>\n";
221
+            $html = $this->_getTabs().'<pre>'.$value."</pre>\n";
222 222
         } else {
223 223
             $html = nl2br($value)."\n";
224 224
         }
225
-        return $html . $this->_getPersistantData();
225
+        return $html.$this->_getPersistantData();
226 226
     }
227 227
     
228 228
     /**
Please login to merge, or discard this patch.
main/inc/lib/pear/HTML/Table.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
      * Adds a table row and returns the row identifier
666 666
      * @param    array     $contents     (optional) Must be a indexed array of
667 667
      *                                   valid cell contents
668
-     * @param    mixed     $attributes   (optional) Associative array or string
668
+     * @param    string     $attributes   (optional) Associative array or string
669 669
      *                                   of table row attributes. This can also
670 670
      *                                   be an array of attributes, in which
671 671
      *                                   case the attributes will be repeated
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
     /**
720 720
      * Updates the row attributes for an existing row
721 721
      * @param    int      $row          Row index
722
-     * @param    mixed    $attributes   Associative array or string of table row
722
+     * @param    string    $attributes   Associative array or string of table row
723 723
      *                                  attributes
724 724
      * @param    bool     $inTR         false if attributes are to be applied in
725 725
      *                                  TD tags; true if attributes are to be
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
      */
165 165
     function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false)
166 166
     {
167
-        parent::__construct($attributes, (int)$tabOffset);
168
-        $this->_useTGroups = (boolean)$useTGroups;
167
+        parent::__construct($attributes, (int) $tabOffset);
168
+        $this->_useTGroups = (boolean) $useTGroups;
169 169
         $this->addBody();
170 170
         if ($this->_useTGroups) {
171 171
             $this->_thead = new HTML_Table_Storage($tabOffset, $this->_useTGroups);
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
     function _adjustTbodyCount($body, $method)
273 273
     {
274 274
         if ($this->_autoGrow) {
275
-            while ($this->_tbodyCount <= (int)$body) {
275
+            while ($this->_tbodyCount <= (int) $body) {
276 276
                 $this->addBody();
277 277
             }
278 278
         } else {
279
-            return PEAR::raiseError('Invalid body reference[' .
280
-                $body . '] in HTML_Table::' . $method);
279
+            return PEAR::raiseError('Invalid body reference['.
280
+                $body.'] in HTML_Table::'.$method);
281 281
         }
282 282
     }
283 283
 
@@ -939,26 +939,26 @@  discard block
 block discarded – undo
939 939
             $tBodyMaxColCount = max($tBodyColCounts);
940 940
         }
941 941
         if ($this->_comment) {
942
-            $strHtml .= $tabs . "<!-- $this->_comment -->" . $lnEnd;
942
+            $strHtml .= $tabs."<!-- $this->_comment -->".$lnEnd;
943 943
         }
944 944
         if ($this->getRowCount() > 0 && $tBodyMaxColCount > 0) {
945 945
             $strHtml .=
946
-                $tabs . '<table' . $this->_getAttrString($this->_attributes) . '>' . $lnEnd;
946
+                $tabs.'<table'.$this->_getAttrString($this->_attributes).'>'.$lnEnd;
947 947
             if (!empty($this->_caption)) {
948 948
                 $attr = $this->_caption['attr'];
949 949
                 $contents = $this->_caption['contents'];
950
-                $strHtml .= $tabs . $tab . '<caption' . $this->_getAttrString($attr) . '>';
950
+                $strHtml .= $tabs.$tab.'<caption'.$this->_getAttrString($attr).'>';
951 951
                 if (is_array($contents)) {
952 952
                     $contents = implode(', ', $contents);
953 953
                 }
954 954
                 $strHtml .= $contents;
955
-                $strHtml .= '</caption>' . $lnEnd;
955
+                $strHtml .= '</caption>'.$lnEnd;
956 956
             }
957 957
             if (!empty($this->_colgroup)) {
958 958
                 foreach ($this->_colgroup as $g => $col) {
959 959
                     $attr = $this->_colgroup[$g]['attr'];
960 960
                     $contents = $this->_colgroup[$g]['contents'];
961
-                    $strHtml .= $tabs . $tab . '<colgroup' . $this->_getAttrString($attr) . '>';
961
+                    $strHtml .= $tabs.$tab.'<colgroup'.$this->_getAttrString($attr).'>';
962 962
                     if (!empty($contents)) {
963 963
                         $strHtml .= $lnEnd;
964 964
                         if (!is_array($contents)) {
@@ -966,11 +966,11 @@  discard block
 block discarded – undo
966 966
                         }
967 967
                         foreach ($contents as $a => $colAttr) {
968 968
                             $attr = $this->_parseAttributes($colAttr);
969
-                            $strHtml .= $tabs . $tab . $tab . '<col' . $this->_getAttrString($attr) . ' />' . $lnEnd;
969
+                            $strHtml .= $tabs.$tab.$tab.'<col'.$this->_getAttrString($attr).' />'.$lnEnd;
970 970
                         }
971
-                        $strHtml .= $tabs . $tab;
971
+                        $strHtml .= $tabs.$tab;
972 972
                     }
973
-                    $strHtml .= '</colgroup>' . $lnEnd;
973
+                    $strHtml .= '</colgroup>'.$lnEnd;
974 974
                 }
975 975
             }
976 976
             if ($this->_useTGroups) {
@@ -986,31 +986,31 @@  discard block
 block discarded – undo
986 986
                 if ($this->_thead !== null) {
987 987
                     $this->_thead->setColCount($maxColCount);
988 988
                     if ($this->_thead->getRowCount() > 0) {
989
-                        $strHtml .= $tabs . $tab . '<thead' .
990
-                                    $this->_getAttrString($this->_thead->_attributes) .
991
-                                    '>' . $lnEnd;
989
+                        $strHtml .= $tabs.$tab.'<thead'.
990
+                                    $this->_getAttrString($this->_thead->_attributes).
991
+                                    '>'.$lnEnd;
992 992
                         $strHtml .= $this->_thead->toHtml($tabs, $tab);
993
-                        $strHtml .= $tabs . $tab . '</thead>' . $lnEnd;
993
+                        $strHtml .= $tabs.$tab.'</thead>'.$lnEnd;
994 994
                     }
995 995
                 }
996 996
                 if ($this->_tfoot !== null) {
997 997
                     $this->_tfoot->setColCount($maxColCount);
998 998
                     if ($this->_tfoot->getRowCount() > 0) {
999
-                        $strHtml .= $tabs . $tab . '<tfoot' .
1000
-                                    $this->_getAttrString($this->_tfoot->_attributes) .
1001
-                                    '>' . $lnEnd;
999
+                        $strHtml .= $tabs.$tab.'<tfoot'.
1000
+                                    $this->_getAttrString($this->_tfoot->_attributes).
1001
+                                    '>'.$lnEnd;
1002 1002
                         $strHtml .= $this->_tfoot->toHtml($tabs, $tab);
1003
-                        $strHtml .= $tabs . $tab . '</tfoot>' . $lnEnd;
1003
+                        $strHtml .= $tabs.$tab.'</tfoot>'.$lnEnd;
1004 1004
                     }
1005 1005
                 }
1006 1006
                 for ($i = 0; $i < $this->_tbodyCount; $i++) {
1007 1007
                     $this->_tbodies[$i]->setColCount($maxColCount);
1008 1008
                     if ($this->_tbodies[$i]->getRowCount() > 0) {
1009
-                        $strHtml .= $tabs . $tab . '<tbody' .
1010
-                                    $this->_getAttrString($this->_tbodies[$i]->_attributes) .
1011
-                                    '>' . $lnEnd;
1009
+                        $strHtml .= $tabs.$tab.'<tbody'.
1010
+                                    $this->_getAttrString($this->_tbodies[$i]->_attributes).
1011
+                                    '>'.$lnEnd;
1012 1012
                         $strHtml .= $this->_tbodies[$i]->toHtml($tabs, $tab);
1013
-                        $strHtml .= $tabs . $tab . '</tbody>' . $lnEnd;
1013
+                        $strHtml .= $tabs.$tab.'</tbody>'.$lnEnd;
1014 1014
                     }
1015 1015
                 }
1016 1016
             } else {
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                     $strHtml .= $this->_tbodies[$i]->toHtml($tabs, $tab);
1020 1020
                 }
1021 1021
             }
1022
-            $strHtml .= $tabs . '</table>' . $lnEnd;
1022
+            $strHtml .= $tabs.'</table>'.$lnEnd;
1023 1023
         }
1024 1024
         return $strHtml;
1025 1025
     }
Please login to merge, or discard this patch.
Indentation   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,6 @@  discard block
 block discarded – undo
48 48
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
49 49
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50 50
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51
-
52 51
  *
53 52
  * @category   HTML
54 53
  * @package    HTML_Table
@@ -256,7 +255,7 @@  discard block
 block discarded – undo
256 255
 
257 256
         $body = $this->_tbodyCount++;
258 257
         $this->_tbodies[$body] = new HTML_Table_Storage($this->_tabOffset,
259
-                                                         $this->_useTGroups);
258
+                                                            $this->_useTGroups);
260 259
         $this->_tbodies[$body]->setAutoFill($this->_autoFill);
261 260
         $this->_tbodies[$body]->setAttributes($attributes);
262 261
         return $body;
@@ -308,7 +307,7 @@  discard block
 block discarded – undo
308 307
         if (isset($colgroup)) {
309 308
             $attributes = $this->_parseAttributes($attributes);
310 309
             $this->_colgroup[] = array('attr' => $attributes,
311
-                                       'contents' => $colgroup);
310
+                                        'contents' => $colgroup);
312 311
         } else {
313 312
             $this->_colgroup = array();
314 313
         }
Please login to merge, or discard this patch.
main/inc/lib/pear/HTML/Table/Storage.php 2 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     /**
166 166
      * Returns the autoFill value
167 167
      * @access   public
168
-     * @return   mixed
168
+     * @return   string
169 169
      */
170 170
     function getAutoFill()
171 171
     {
@@ -174,7 +174,6 @@  discard block
 block discarded – undo
174 174
 
175 175
     /**
176 176
      * Sets the autoGrow value
177
-     * @param    bool   $fill
178 177
      * @access   public
179 178
      */
180 179
     function setAutoGrow($grow)
@@ -185,7 +184,7 @@  discard block
 block discarded – undo
185 184
     /**
186 185
      * Returns the autoGrow value
187 186
      * @access   public
188
-     * @return   mixed
187
+     * @return   boolean
189 188
      */
190 189
     function getAutoGrow()
191 190
     {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
      */
129 129
     function HTML_Table_Storage($tabOffset = 0, $useTGroups = false)
130 130
     {
131
-        parent::__construct(null, (int)$tabOffset);
132
-        $this->_useTGroups = (boolean)$useTGroups;
131
+        parent::__construct(null, (int) $tabOffset);
132
+        $this->_useTGroups = (boolean) $useTGroups;
133 133
     }
134 134
 
135 135
     /**
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
      */
289 289
     function setCellAttributes($row, $col, $attributes)
290 290
     {
291
-        if (   isset($this->_structure[$row][$col])
291
+        if (isset($this->_structure[$row][$col])
292 292
             && $this->_structure[$row][$col] == '__SPANNED__'
293 293
         ) {
294 294
             return;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      */
315 315
     function updateCellAttributes($row, $col, $attributes)
316 316
     {
317
-        if (   isset($this->_structure[$row][$col])
317
+        if (isset($this->_structure[$row][$col])
318 318
             && $this->_structure[$row][$col] == '__SPANNED__'
319 319
         ) {
320 320
             return;
@@ -337,13 +337,13 @@  discard block
 block discarded – undo
337 337
      */
338 338
     function getCellAttributes($row, $col)
339 339
     {
340
-        if (   isset($this->_structure[$row][$col])
340
+        if (isset($this->_structure[$row][$col])
341 341
             && $this->_structure[$row][$col] != '__SPANNED__'
342 342
         ) {
343 343
             return $this->_structure[$row][$col]['attr'];
344 344
         } elseif (!isset($this->_structure[$row][$col])) {
345
-            return PEAR::raiseError('Invalid table cell reference[' .
346
-                $row . '][' . $col . '] in HTML_Table::getCellAttributes');
345
+            return PEAR::raiseError('Invalid table cell reference['.
346
+                $row.']['.$col.'] in HTML_Table::getCellAttributes');
347 347
         }
348 348
         return;
349 349
     }
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
      */
406 406
     function _setSingleCellContents($row, $col, $contents, $type = 'TD')
407 407
     {
408
-        if (   isset($this->_structure[$row][$col])
408
+        if (isset($this->_structure[$row][$col])
409 409
             && $this->_structure[$row][$col] == '__SPANNED__'
410 410
         ) {
411 411
             return;
@@ -427,14 +427,14 @@  discard block
 block discarded – undo
427 427
      */
428 428
     function getCellContents($row, $col)
429 429
     {
430
-        if (   isset($this->_structure[$row][$col])
430
+        if (isset($this->_structure[$row][$col])
431 431
             && $this->_structure[$row][$col] == '__SPANNED__'
432 432
         ) {
433 433
             return;
434 434
         }
435 435
         if (!isset($this->_structure[$row][$col])) {
436
-            return PEAR::raiseError('Invalid table cell reference[' .
437
-                $row . '][' . $col . '] in HTML_Table::getCellContents');
436
+            return PEAR::raiseError('Invalid table cell reference['.
437
+                $row.']['.$col.'] in HTML_Table::getCellContents');
438 438
         }
439 439
         return $this->_structure[$row][$col]['contents'];
440 440
     }
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $inTR = false)
478 478
     {
479 479
         if (isset($contents) && !is_array($contents)) {
480
-            return PEAR::raiseError('First parameter to HTML_Table::addRow ' .
480
+            return PEAR::raiseError('First parameter to HTML_Table::addRow '.
481 481
                 'must be an array');
482 482
         }
483 483
         if (is_null($contents)) {
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
     function addCol($contents = null, $attributes = null, $type = 'td')
621 621
     {
622 622
         if (isset($contents) && !is_array($contents)) {
623
-            return PEAR::raiseError('First parameter to HTML_Table::addCol ' .
623
+            return PEAR::raiseError('First parameter to HTML_Table::addCol '.
624 624
                 'must be an array');
625 625
         }
626 626
         if (is_null($contents)) {
@@ -727,13 +727,13 @@  discard block
 block discarded – undo
727 727
             $extraTab = '';
728 728
         }
729 729
         if ($this->_cols > 0) {
730
-            for ($i = 0 ; $i < $this->_rows ; $i++) {
730
+            for ($i = 0; $i < $this->_rows; $i++) {
731 731
                 $attr = '';
732 732
                 if (isset($this->_structure[$i]['attr'])) {
733 733
                     $attr = $this->_getAttrString($this->_structure[$i]['attr']);
734 734
                 }
735
-                $strHtml .= $tabs .$tab . $extraTab . '<tr'.$attr.'>' . $lnEnd;
736
-                for ($j = 0 ; $j < $this->_cols ; $j++) {
735
+                $strHtml .= $tabs.$tab.$extraTab.'<tr'.$attr.'>'.$lnEnd;
736
+                for ($j = 0; $j < $this->_cols; $j++) {
737 737
                     $attr     = '';
738 738
                     $contents = '';
739 739
                     $type     = 'td';
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
                     if (is_object($contents)) {
754 754
                         // changes indent and line end settings on nested tables
755 755
                         if (is_subclass_of($contents, 'html_common')) {
756
-                            $contents->setTab($tab . $extraTab);
756
+                            $contents->setTab($tab.$extraTab);
757 757
                             $contents->setTabOffset($this->_tabOffset + 3);
758 758
                             $contents->_nestLevel = $this->_nestLevel + 1;
759 759
                             $contents->setLineEnd($this->_getLineEnd());
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
                         $contents = implode(', ', $contents);
769 769
                     }
770 770
 
771
-                    $typeContent = $tabs . $tab . $tab . $extraTab . "<$type" . $this->_getAttrString($attr) . '>';
771
+                    $typeContent = $tabs.$tab.$tab.$extraTab."<$type".$this->_getAttrString($attr).'>';
772 772
 
773 773
                     if (empty($contents)) {
774 774
                         if (isset($this->_autoFill) && $this->_autoFill) {
@@ -777,14 +777,14 @@  discard block
 block discarded – undo
777 777
                     } else {
778 778
                         $typeContent .= $contents;
779 779
                     }
780
-                    $typeContent .= "</$type>" . $lnEnd;
780
+                    $typeContent .= "</$type>".$lnEnd;
781 781
 
782 782
                     if (!empty($contents)) {
783 783
                         $strHtml .= $typeContent;
784 784
                     }
785 785
 
786 786
                 }
787
-                $strHtml .= $tabs . $tab . $extraTab . '</tr>' . $lnEnd;
787
+                $strHtml .= $tabs.$tab.$extraTab.'</tr>'.$lnEnd;
788 788
             }
789 789
         }
790 790
         return $strHtml;
Please login to merge, or discard this patch.
main/inc/lib/pear/Image/Text.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
      * the Image_Text object after changing options. For possible options, please
329 329
      * take a look at the class options array!
330 330
      *
331
-     * @param array|string $option A single option name or the options array.
332
-     * @param mixed        $value  Option value if $option is string.
331
+     * @param string $option A single option name or the options array.
332
+     * @param string        $value  Option value if $option is string.
333 333
      *
334 334
      * @return void
335 335
      * @see    Image_Text::Image_Text()
@@ -982,7 +982,7 @@  discard block
 block discarded – undo
982 982
      * @param bool $save Save or not the image on printout.
983 983
      * @param bool $free Free the image on exit.
984 984
      *
985
-     * @return  bool         True on success
985
+     * @return  boolean|null         True on success
986 986
      * @see Image_Text::save()
987 987
      * @throws Image_Text_Exception
988 988
      */
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
      * @param string $scolor string of colorcode.
1134 1134
      *
1135 1135
      * @see Image_Text::IMAGE_TEXT_REGEX_HTMLCOLOR
1136
-     * @return bool|array false if string can't be converted to array
1136
+     * @return resource false if string can't be converted to array
1137 1137
      */
1138 1138
     public static function convertString2RGB($scolor)
1139 1139
     {
Please login to merge, or discard this patch.
Switch Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -346,19 +346,19 @@  discard block
 block discarded – undo
346 346
         }
347 347
         foreach ($option as $opt => $val) {
348 348
             switch ($opt) {
349
-            case 'color':
350
-                $this->setColors($val);
351
-                break;
352
-            case 'text':
353
-                if (is_array($val)) {
354
-                    $this->_text = implode('\n', $val);
355
-                } else {
356
-                    $this->_text = $val;
357
-                }
358
-                break;
359
-            default:
360
-                $this->_options[$opt] = $val;
361
-                break;
349
+                case 'color':
350
+                    $this->setColors($val);
351
+                    break;
352
+                case 'text':
353
+                    if (is_array($val)) {
354
+                        $this->_text = implode('\n', $val);
355
+                    } else {
356
+                        $this->_text = $val;
357
+                    }
358
+                    break;
359
+                default:
360
+                    $this->_options[$opt] = $val;
361
+                    break;
362 362
             }
363 363
             if (isset($reInits[$opt])) {
364 364
                 $this->_init = false;
@@ -511,45 +511,45 @@  discard block
 block discarded – undo
511 511
         $image_canvas = false;
512 512
         switch (true) {
513 513
 
514
-        case (empty($this->_options['canvas'])):
515
-            // Create new image from width && height of the clipping
516
-            $this->_img = imagecreatetruecolor(
517
-                $this->_options['width'], $this->_options['height']
518
-            );
519
-            if (!$this->_img) {
520
-                throw new Image_Text_Exception('Could not create image canvas.');
521
-            }
522
-            break;
514
+            case (empty($this->_options['canvas'])):
515
+                // Create new image from width && height of the clipping
516
+                $this->_img = imagecreatetruecolor(
517
+                    $this->_options['width'], $this->_options['height']
518
+                );
519
+                if (!$this->_img) {
520
+                    throw new Image_Text_Exception('Could not create image canvas.');
521
+                }
522
+                break;
523 523
 
524
-        case (is_resource($this->_options['canvas']) &&
525
-            get_resource_type($this->_options['canvas']) == 'gd'):
526
-            // The canvas is an image resource
527
-            $image_canvas = true;
528
-            $this->_img = $this->_options['canvas'];
529
-            break;
524
+            case (is_resource($this->_options['canvas']) &&
525
+                get_resource_type($this->_options['canvas']) == 'gd'):
526
+                // The canvas is an image resource
527
+                $image_canvas = true;
528
+                $this->_img = $this->_options['canvas'];
529
+                break;
530 530
 
531
-        case (is_array($this->_options['canvas']) &&
532
-            isset($this->_options['canvas']['width']) &&
533
-            isset($this->_options['canvas']['height'])):
531
+            case (is_array($this->_options['canvas']) &&
532
+                isset($this->_options['canvas']['width']) &&
533
+                isset($this->_options['canvas']['height'])):
534 534
 
535
-            // Canvas must be a width and height measure
536
-            $this->_img = imagecreatetruecolor(
537
-                $this->_options['canvas']['width'],
538
-                $this->_options['canvas']['height']
539
-            );
540
-            break;
535
+                // Canvas must be a width and height measure
536
+                $this->_img = imagecreatetruecolor(
537
+                    $this->_options['canvas']['width'],
538
+                    $this->_options['canvas']['height']
539
+                );
540
+                break;
541 541
 
542
-        case (is_array($this->_options['canvas']) &&
543
-            isset($this->_options['canvas']['size']) &&
544
-            ($this->_options['canvas']['size'] = 'auto')):
542
+            case (is_array($this->_options['canvas']) &&
543
+                isset($this->_options['canvas']['size']) &&
544
+                ($this->_options['canvas']['size'] = 'auto')):
545 545
 
546
-        case (is_string($this->_options['canvas']) &&
547
-            ($this->_options['canvas'] = 'auto')):
548
-            $this->_mode = 'auto';
549
-            break;
546
+            case (is_string($this->_options['canvas']) &&
547
+                ($this->_options['canvas'] = 'auto')):
548
+                $this->_mode = 'auto';
549
+                break;
550 550
 
551
-        default:
552
-            throw new Image_Text_Exception('Could not create image canvas.');
551
+            default:
552
+                throw new Image_Text_Exception('Could not create image canvas.');
553 553
         }
554 554
 
555 555
         if ($this->_img) {
@@ -889,19 +889,19 @@  discard block
 block discarded – undo
889 889
         $cosR = cos($radians);
890 890
 
891 891
         switch ($this->_options['valign']) {
892
-        case self::IMAGE_TEXT_ALIGN_TOP:
893
-            $valign_space = 0;
894
-            break;
895
-        case self::IMAGE_TEXT_ALIGN_MIDDLE:
896
-            $valign_space = ($this->_options['height']
897
-                    - $this->_realTextSize['height']) / 2;
898
-            break;
899
-        case self::IMAGE_TEXT_ALIGN_BOTTOM:
900
-            $valign_space = $this->_options['height']
901
-                - $this->_realTextSize['height'];
902
-            break;
903
-        default:
904
-            $valign_space = 0;
892
+            case self::IMAGE_TEXT_ALIGN_TOP:
893
+                $valign_space = 0;
894
+                break;
895
+            case self::IMAGE_TEXT_ALIGN_MIDDLE:
896
+                $valign_space = ($this->_options['height']
897
+                        - $this->_realTextSize['height']) / 2;
898
+                break;
899
+            case self::IMAGE_TEXT_ALIGN_BOTTOM:
900
+                $valign_space = $this->_options['height']
901
+                    - $this->_realTextSize['height'];
902
+                break;
903
+            default:
904
+                $valign_space = 0;
905 905
         }
906 906
 
907 907
         $space = (1 + $line_spacing) * $size;
@@ -932,18 +932,18 @@  discard block
 block discarded – undo
932 932
             // Calc the position using the block width, the current line width and
933 933
             // obviously the angle. That gives us the offset to slide the line.
934 934
             switch ($align) {
935
-            case self::IMAGE_TEXT_ALIGN_LEFT:
936
-                $hyp = 0;
937
-                break;
938
-            case self::IMAGE_TEXT_ALIGN_RIGHT:
939
-                $hyp = $block_width - $line_width - $left_margin;
940
-                break;
941
-            case self::IMAGE_TEXT_ALIGN_CENTER:
942
-                $hyp = ($block_width - $line_width) / 2 - $left_margin;
943
-                break;
944
-            default:
945
-                $hyp = 0;
946
-                break;
935
+                case self::IMAGE_TEXT_ALIGN_LEFT:
936
+                    $hyp = 0;
937
+                    break;
938
+                case self::IMAGE_TEXT_ALIGN_RIGHT:
939
+                    $hyp = $block_width - $line_width - $left_margin;
940
+                    break;
941
+                case self::IMAGE_TEXT_ALIGN_CENTER:
942
+                    $hyp = ($block_width - $line_width) / 2 - $left_margin;
943
+                    break;
944
+                default:
945
+                    $hyp = 0;
946
+                    break;
947 947
             }
948 948
 
949 949
             $posx = $new_posx + $cosR * $hyp;
@@ -997,17 +997,17 @@  discard block
 block discarded – undo
997 997
             throw new Image_Text_Exception('Header already sent.');
998 998
         }
999 999
         switch ($this->_options['image_type']) {
1000
-        case IMAGETYPE_PNG:
1001
-            $imgout = 'imagepng';
1002
-            break;
1003
-        case IMAGETYPE_JPEG:
1004
-            $imgout = 'imagejpeg';
1005
-            break;
1006
-        case IMAGETYPE_BMP:
1007
-            $imgout = 'imagebmp';
1008
-            break;
1009
-        default:
1010
-            throw new Image_Text_Exception('Unsupported image type.');
1000
+            case IMAGETYPE_PNG:
1001
+                $imgout = 'imagepng';
1002
+                break;
1003
+            case IMAGETYPE_JPEG:
1004
+                $imgout = 'imagejpeg';
1005
+                break;
1006
+            case IMAGETYPE_BMP:
1007
+                $imgout = 'imagebmp';
1008
+                break;
1009
+            default:
1010
+                throw new Image_Text_Exception('Unsupported image type.');
1011 1011
         }
1012 1012
         if ($save) {
1013 1013
             $imgout($this->_img);
@@ -1048,18 +1048,18 @@  discard block
 block discarded – undo
1048 1048
         }
1049 1049
 
1050 1050
         switch ($this->_options['image_type']) {
1051
-        case IMAGETYPE_PNG:
1052
-            $imgout = 'imagepng';
1053
-            break;
1054
-        case IMAGETYPE_JPEG:
1055
-            $imgout = 'imagejpeg';
1056
-            break;
1057
-        case IMAGETYPE_BMP:
1058
-            $imgout = 'imagebmp';
1059
-            break;
1060
-        default:
1061
-            throw new Image_Text_Exception('Unsupported image type.');
1062
-            break;
1051
+            case IMAGETYPE_PNG:
1052
+                $imgout = 'imagepng';
1053
+                break;
1054
+            case IMAGETYPE_JPEG:
1055
+                $imgout = 'imagejpeg';
1056
+                break;
1057
+            case IMAGETYPE_BMP:
1058
+                $imgout = 'imagebmp';
1059
+                break;
1060
+            default:
1061
+                throw new Image_Text_Exception('Unsupported image type.');
1062
+                break;
1063 1063
         }
1064 1064
 
1065 1065
         $res = $imgout($this->_img, $destFile);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
         $space = (1 + $this->_options['line_spacing'])
684 684
             * $this->_options['font_size'];
685 685
 
686
-        $max_lines = (int)$this->_options['max_lines'];
686
+        $max_lines = (int) $this->_options['max_lines'];
687 687
 
688 688
         if (($max_lines < 1) && !$force) {
689 689
             return false;
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
                     'color' => $c
733 733
                 );
734 734
                 $text_width = max($text_width, ($bounds[2] - $bounds[0]));
735
-                $text_height += (int)$space;
735
+                $text_height += (int) $space;
736 736
                 if (($text_height > $block_height) && !$force) {
737 737
                     return false;
738 738
                 }
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
                 $text_line_next = $token;
750 750
                 $beginning_of_line = false;
751 751
             } else {
752
-                $text_line_next = $text_line . ' ' . $token;
752
+                $text_line_next = $text_line.' '.$token;
753 753
             }
754 754
             $bounds = imagettfbbox($size, 0, $font, $text_line_next);
755 755
             $prev_width = isset($prev_width) ? $width : 0;
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
                     'color' => $c
777 777
                 );
778 778
                 $text_width = max($text_width, ($bounds[2] - $bounds[0]));
779
-                $text_height += (int)$space;
779
+                $text_height += (int) $space;
780 780
                 if (($text_height > $block_height) && !$force) {
781 781
                     return false;
782 782
                 }
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
     {
991 991
         if (!headers_sent()) {
992 992
             header(
993
-                "Content-type: " .
993
+                "Content-type: ".
994 994
                 image_type_to_mime_type($this->_options['image_type'])
995 995
             );
996 996
         } else {
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
                 $y += $vC[1];
1122 1122
             }
1123 1123
         }
1124
-        return array('x' => (int)round($x, 0), 'y' => (int)round($y, 0));
1124
+        return array('x' => (int) round($x, 0), 'y' => (int) round($y, 0));
1125 1125
     }
1126 1126
 
1127 1127
     /**
Please login to merge, or discard this patch.
main/inc/lib/pear/OLE/OLE.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@
 block discarded – undo
286 286
     *
287 287
     * @access private
288 288
     * @param integer $blockId the block id of the first block
289
-    * @return mixed true on success, PEAR_Error on failure
289
+    * @return boolean true on success, PEAR_Error on failure
290 290
     */
291 291
     function _readPpsWks($blockId)
292 292
     {
Please login to merge, or discard this patch.
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -49,74 +49,74 @@  discard block
 block discarded – undo
49 49
 {
50 50
 
51 51
     /**
52
-    * The file handle for reading an OLE container
53
-    * @var resource
54
-    */
52
+     * The file handle for reading an OLE container
53
+     * @var resource
54
+     */
55 55
     var $_file_handle;
56 56
 
57 57
     /**
58
-    * Array of PPS's found on the OLE container
59
-    * @var array
60
-    */
58
+     * Array of PPS's found on the OLE container
59
+     * @var array
60
+     */
61 61
     var $_list;
62 62
 
63 63
     /**
64
-    * Root directory of OLE container
65
-    * @var OLE_PPS_Root
66
-    */
64
+     * Root directory of OLE container
65
+     * @var OLE_PPS_Root
66
+     */
67 67
     var $root;
68 68
 
69 69
     /**
70
-    * Big Block Allocation Table
71
-    * @var array  (blockId => nextBlockId)
72
-    */
70
+     * Big Block Allocation Table
71
+     * @var array  (blockId => nextBlockId)
72
+     */
73 73
     var $bbat;
74 74
 
75 75
     /**
76
-    * Short Block Allocation Table
77
-    * @var array  (blockId => nextBlockId)
78
-    */
76
+     * Short Block Allocation Table
77
+     * @var array  (blockId => nextBlockId)
78
+     */
79 79
     var $sbat;
80 80
 
81 81
     /**
82
-    * Size of big blocks. This is usually 512.
83
-    * @var  int  number of octets per block.
84
-    */
82
+     * Size of big blocks. This is usually 512.
83
+     * @var  int  number of octets per block.
84
+     */
85 85
     var $bigBlockSize;
86 86
 
87 87
     /**
88
-    * Size of small blocks. This is usually 64.
89
-    * @var  int  number of octets per block
90
-    */
88
+     * Size of small blocks. This is usually 64.
89
+     * @var  int  number of octets per block
90
+     */
91 91
     var $smallBlockSize;
92 92
 
93 93
     /**
94
-    * Creates a new OLE object
95
-    * @access public
96
-    */
94
+     * Creates a new OLE object
95
+     * @access public
96
+     */
97 97
     function OLE()
98 98
     {
99 99
         $this->_list = array();
100 100
     }
101 101
 
102 102
     /**
103
-    * Destructor (using PEAR)
104
-    * Just closes the file handle on the OLE file.
105
-    *
106
-    * @access private
107
-    */
103
+     * Destructor (using PEAR)
104
+     * Just closes the file handle on the OLE file.
105
+     *
106
+     * @access private
107
+     */
108 108
     function _OLE()
109 109
     {
110 110
         fclose($this->_file_handle);
111 111
     }
112 112
 
113 113
     /**
114
-    * Reads an OLE container from the contents of the file given.
115
-    *
116
-    * @access public
117
-    * @param string $file
118
-    * @return mixed true on success, PEAR_Error on failure
119
-    */
114
+     * Reads an OLE container from the contents of the file given.
115
+     *
116
+     * @access public
117
+     * @param string $file
118
+     * @return mixed true on success, PEAR_Error on failure
119
+     */
120 120
     function read($file)
121 121
     {
122 122
         $fh = @fopen($file, "r");
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
     }
282 282
 
283 283
     /**
284
-    * Gets information about all PPS's on the OLE container from the PPS WK's
285
-    * creates an OLE_PPS object for each one.
286
-    *
287
-    * @access private
288
-    * @param integer $blockId the block id of the first block
289
-    * @return mixed true on success, PEAR_Error on failure
290
-    */
284
+     * Gets information about all PPS's on the OLE container from the PPS WK's
285
+     * creates an OLE_PPS object for each one.
286
+     *
287
+     * @access private
288
+     * @param integer $blockId the block id of the first block
289
+     * @return mixed true on success, PEAR_Error on failure
290
+     */
291 291
     function _readPpsWks($blockId)
292 292
     {
293 293
         $fh = $this->getStream($blockId);
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
                 break;
308 308
             case OLE_PPS_TYPE_DIR:
309 309
                 $pps = new OLE_PPS(null, null, null, null, null,
310
-                                   null, null, null, null, array());
310
+                                    null, null, null, null, array());
311 311
                 break;
312 312
             case OLE_PPS_TYPE_FILE:
313 313
                 require_once 'OLE/PPS/File.php';
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
     }
361 361
 
362 362
     /**
363
-    * It checks whether the PPS tree is complete (all PPS's read)
364
-    * starting with the given PPS (not necessarily root)
365
-    *
366
-    * @access private
367
-    * @param integer $index The index of the PPS from which we are checking
368
-    * @return boolean Whether the PPS tree for the given PPS is complete
369
-    */
363
+     * It checks whether the PPS tree is complete (all PPS's read)
364
+     * starting with the given PPS (not necessarily root)
365
+     *
366
+     * @access private
367
+     * @param integer $index The index of the PPS from which we are checking
368
+     * @return boolean Whether the PPS tree for the given PPS is complete
369
+     */
370 370
     function _ppsTreeComplete($index)
371 371
     {
372 372
         return isset($this->_list[$index]) &&
@@ -380,12 +380,12 @@  discard block
 block discarded – undo
380 380
     }
381 381
 
382 382
     /**
383
-    * Checks whether a PPS is a File PPS or not.
384
-    * If there is no PPS for the index given, it will return false.
385
-    * @param integer $index The index for the PPS
386
-    * @return bool true if it's a File PPS, false otherwise
387
-    * @access public
388
-    */
383
+     * Checks whether a PPS is a File PPS or not.
384
+     * If there is no PPS for the index given, it will return false.
385
+     * @param integer $index The index for the PPS
386
+     * @return bool true if it's a File PPS, false otherwise
387
+     * @access public
388
+     */
389 389
     function isFile($index)
390 390
     {
391 391
         if (isset($this->_list[$index])) {
@@ -395,12 +395,12 @@  discard block
 block discarded – undo
395 395
     }
396 396
 
397 397
     /**
398
-    * Checks whether a PPS is a Root PPS or not.
399
-    * If there is no PPS for the index given, it will return false.
400
-    * @param integer $index The index for the PPS.
401
-    * @return bool true if it's a Root PPS, false otherwise
402
-    * @access public
403
-    */
398
+     * Checks whether a PPS is a Root PPS or not.
399
+     * If there is no PPS for the index given, it will return false.
400
+     * @param integer $index The index for the PPS.
401
+     * @return bool true if it's a Root PPS, false otherwise
402
+     * @access public
403
+     */
404 404
     function isRoot($index)
405 405
     {
406 406
         if (isset($this->_list[$index])) {
@@ -410,26 +410,26 @@  discard block
 block discarded – undo
410 410
     }
411 411
 
412 412
     /**
413
-    * Gives the total number of PPS's found in the OLE container.
414
-    * @return integer The total number of PPS's found in the OLE container
415
-    * @access public
416
-    */
413
+     * Gives the total number of PPS's found in the OLE container.
414
+     * @return integer The total number of PPS's found in the OLE container
415
+     * @access public
416
+     */
417 417
     function ppsTotal()
418 418
     {
419 419
         return count($this->_list);
420 420
     }
421 421
 
422 422
     /**
423
-    * Gets data from a PPS
424
-    * If there is no PPS for the index given, it will return an empty string.
425
-    * @param integer $index    The index for the PPS
426
-    * @param integer $position The position from which to start reading
427
-    *                          (relative to the PPS)
428
-    * @param integer $length   The amount of bytes to read (at most)
429
-    * @return string The binary string containing the data requested
430
-    * @access public
431
-    * @see OLE_PPS_File::getStream()
432
-    */
423
+     * Gets data from a PPS
424
+     * If there is no PPS for the index given, it will return an empty string.
425
+     * @param integer $index    The index for the PPS
426
+     * @param integer $position The position from which to start reading
427
+     *                          (relative to the PPS)
428
+     * @param integer $length   The amount of bytes to read (at most)
429
+     * @return string The binary string containing the data requested
430
+     * @access public
431
+     * @see OLE_PPS_File::getStream()
432
+     */
433 433
     function getData($index, $position, $length)
434 434
     {
435 435
         // if position is not valid return empty string
@@ -446,12 +446,12 @@  discard block
 block discarded – undo
446 446
     }
447 447
 
448 448
     /**
449
-    * Gets the data length from a PPS
450
-    * If there is no PPS for the index given, it will return 0.
451
-    * @param integer $index The index for the PPS
452
-    * @return integer The amount of bytes in data the PPS has
453
-    * @access public
454
-    */
449
+     * Gets the data length from a PPS
450
+     * If there is no PPS for the index given, it will return 0.
451
+     * @param integer $index The index for the PPS
452
+     * @return integer The amount of bytes in data the PPS has
453
+     * @access public
454
+     */
455 455
     function getDataLength($index)
456 456
     {
457 457
         if (isset($this->_list[$index])) {
@@ -461,13 +461,13 @@  discard block
 block discarded – undo
461 461
     }
462 462
 
463 463
     /**
464
-    * Utility function to transform ASCII text to Unicode
465
-    *
466
-    * @access public
467
-    * @static
468
-    * @param string $ascii The ASCII string to transform
469
-    * @return string The string in Unicode
470
-    */
464
+     * Utility function to transform ASCII text to Unicode
465
+     *
466
+     * @access public
467
+     * @static
468
+     * @param string $ascii The ASCII string to transform
469
+     * @return string The string in Unicode
470
+     */
471 471
     function Asc2Ucs($ascii)
472 472
     {
473 473
         $rawname = '';
@@ -478,14 +478,14 @@  discard block
 block discarded – undo
478 478
     }
479 479
 
480 480
     /**
481
-    * Utility function
482
-    * Returns a string for the OLE container with the date given
483
-    *
484
-    * @access public
485
-    * @static
486
-    * @param integer $date A timestamp
487
-    * @return string The string for the OLE container
488
-    */
481
+     * Utility function
482
+     * Returns a string for the OLE container with the date given
483
+     *
484
+     * @access public
485
+     * @static
486
+     * @param integer $date A timestamp
487
+     * @return string The string for the OLE container
488
+     */
489 489
     function LocalDate2OLE($date = null)
490 490
     {
491 491
         if (!isset($date)) {
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         // calculate seconds
501 501
         $big_date = $days * 24 * 3600 +
502 502
             gmmktime(date("H",$date),date("i",$date),date("s",$date),
503
-                     date("m",$date),date("d",$date),date("Y",$date));
503
+                        date("m",$date),date("d",$date),date("Y",$date));
504 504
         // multiply just to make MS happy
505 505
         $big_date *= 10000000;
506 506
 
@@ -525,12 +525,12 @@  discard block
 block discarded – undo
525 525
     }
526 526
 
527 527
     /**
528
-    * Returns a timestamp from an OLE container's date
529
-    * @param integer $string A binary string with the encoded date
530
-    * @return string The timestamp corresponding to the string
531
-    * @access public
532
-    * @static
533
-    */
528
+     * Returns a timestamp from an OLE container's date
529
+     * @param integer $string A binary string with the encoded date
530
+     * @return string The timestamp corresponding to the string
531
+     * @access public
532
+     * @static
533
+     */
534 534
     function OLE2LocalDate($string)
535 535
     {
536 536
         if (strlen($string) != 8) {
Please login to merge, or discard this patch.
Switch Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -300,21 +300,21 @@
 block discarded – undo
300 300
             $name = str_replace("\x00", "", $nameUtf16);
301 301
             $type = $this->_readInt1($fh);
302 302
             switch ($type) {
303
-            case OLE_PPS_TYPE_ROOT:
304
-                require_once 'OLE/PPS/Root.php';
305
-                $pps = new OLE_PPS_Root(null, null, array());
306
-                $this->root = $pps;
307
-                break;
308
-            case OLE_PPS_TYPE_DIR:
309
-                $pps = new OLE_PPS(null, null, null, null, null,
310
-                                   null, null, null, null, array());
311
-                break;
312
-            case OLE_PPS_TYPE_FILE:
313
-                require_once 'OLE/PPS/File.php';
314
-                $pps = new OLE_PPS_File($name);
315
-                break;
316
-            default:
317
-                continue;
303
+                case OLE_PPS_TYPE_ROOT:
304
+                    require_once 'OLE/PPS/Root.php';
305
+                    $pps = new OLE_PPS_Root(null, null, array());
306
+                    $this->root = $pps;
307
+                    break;
308
+                case OLE_PPS_TYPE_DIR:
309
+                    $pps = new OLE_PPS(null, null, null, null, null,
310
+                                       null, null, null, null, array());
311
+                    break;
312
+                case OLE_PPS_TYPE_FILE:
313
+                    require_once 'OLE/PPS/File.php';
314
+                    $pps = new OLE_PPS_File($name);
315
+                    break;
316
+                default:
317
+                    continue;
318 318
             }
319 319
             fseek($fh, 1, SEEK_CUR);
320 320
             $pps->Type    = $type;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
 /**
24 24
 * Constants for OLE package
25 25
 */
26
-define('OLE_PPS_TYPE_ROOT',        5);
27
-define('OLE_PPS_TYPE_DIR',         1);
28
-define('OLE_PPS_TYPE_FILE',        2);
26
+define('OLE_PPS_TYPE_ROOT', 5);
27
+define('OLE_PPS_TYPE_DIR', 1);
28
+define('OLE_PPS_TYPE_FILE', 2);
29 29
 define('OLE_DATA_SIZE_SMALL', 0x1000);
30
-define('OLE_LONG_INT_SIZE',        4);
31
-define('OLE_PPS_SIZE',          0x80);
30
+define('OLE_LONG_INT_SIZE', 4);
31
+define('OLE_PPS_SIZE', 0x80);
32 32
 
33 33
 /**
34 34
 * Array for storing OLE instances that are accessed from
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         for ($i = 0; $i < $bbatBlockCount; $i++) {
184 184
             $pos = $this->_getBlockOffset($mbatBlocks[$i]);
185 185
             fseek($fh, $pos);
186
-            for ($j = 0 ; $j < $this->bigBlockSize / 4; $j++) {
186
+            for ($j = 0; $j < $this->bigBlockSize / 4; $j++) {
187 187
                 $this->bbat[] = $this->_readInt4($fh);
188 188
             }
189 189
         }
@@ -234,12 +234,12 @@  discard block
 block discarded – undo
234 234
         $GLOBALS['_OLE_INSTANCES'][] = $this;
235 235
         $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES']));
236 236
 
237
-        $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId;
237
+        $path = 'ole-chainedblockstream://oleInstanceId='.$instanceId;
238 238
         if (is_a($blockIdOrPps, 'OLE_PPS')) {
239
-            $path .= '&blockId=' . $blockIdOrPps->_StartBlock;
240
-            $path .= '&size=' . $blockIdOrPps->Size;
239
+            $path .= '&blockId='.$blockIdOrPps->_StartBlock;
240
+            $path .= '&size='.$blockIdOrPps->Size;
241 241
         } else {
242
-            $path .= '&blockId=' . $blockIdOrPps;
242
+            $path .= '&blockId='.$blockIdOrPps;
243 243
         }
244 244
         return fopen($path, 'r');
245 245
     }
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     {
473 473
         $rawname = '';
474 474
         for ($i = 0; $i < strlen($ascii); $i++) {
475
-            $rawname .= $ascii{$i} . "\x00";
475
+            $rawname .= $ascii{$i}."\x00";
476 476
         }
477 477
         return $rawname;
478 478
     }
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
         $days = 134774;
500 500
         // calculate seconds
501 501
         $big_date = $days * 24 * 3600 +
502
-            gmmktime(date("H",$date),date("i",$date),date("s",$date),
503
-                     date("m",$date),date("d",$date),date("Y",$date));
502
+            gmmktime(date("H", $date), date("i", $date), date("s", $date),
503
+                     date("m", $date), date("d", $date), date("Y", $date));
504 504
         // multiply just to make MS happy
505 505
         $big_date *= 10000000;
506 506
 
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
         }
539 539
 
540 540
         // factor used for separating numbers into 4 bytes parts
541
-        $factor = pow(2,32);
541
+        $factor = pow(2, 32);
542 542
         $high_part = 0;
543 543
         for ($i = 0; $i < 4; $i++) {
544 544
             list(, $high_part) = unpack('C', $string{(7 - $i)});
Please login to merge, or discard this patch.
main/inc/lib/pear/OLE/PPS/File.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     *
64 64
     * @access public
65 65
     * @param string $dir The dir to be used as temp dir
66
-    * @return true if given dir is valid, false otherwise
66
+    * @return boolean if given dir is valid, false otherwise
67 67
     */
68 68
     function setTempDir($dir)
69 69
     {
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 class OLE_PPS_File extends OLE_PPS
31 31
 {
32 32
     /**
33
-    * The temporary dir for storing the OLE file
34
-    * @var string
35
-    */
33
+     * The temporary dir for storing the OLE file
34
+     * @var string
35
+     */
36 36
     var $_tmp_dir;
37 37
 
38 38
     /**
39
-    * The constructor
40
-    *
41
-    * @access public
42
-    * @param string $name The name of the file (in Unicode)
43
-    * @see OLE::Asc2Ucs()
44
-    */
39
+     * The constructor
40
+     *
41
+     * @access public
42
+     * @param string $name The name of the file (in Unicode)
43
+     * @see OLE::Asc2Ucs()
44
+     */
45 45
     function OLE_PPS_File($name)
46 46
     {
47 47
         $this->_tmp_dir = '';
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-    * Sets the temp dir used for storing the OLE file
63
-    *
64
-    * @access public
65
-    * @param string $dir The dir to be used as temp dir
66
-    * @return true if given dir is valid, false otherwise
67
-    */
62
+     * Sets the temp dir used for storing the OLE file
63
+     *
64
+     * @access public
65
+     * @param string $dir The dir to be used as temp dir
66
+     * @return true if given dir is valid, false otherwise
67
+     */
68 68
     function setTempDir($dir)
69 69
     {
70 70
         if (is_dir($dir)) {
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
     }
76 76
 
77 77
     /**
78
-    * Initialization method. Has to be called right after OLE_PPS_File().
79
-    *
80
-    * @access public
81
-    * @return mixed true on success. PEAR_Error on failure
82
-    */
78
+     * Initialization method. Has to be called right after OLE_PPS_File().
79
+     *
80
+     * @access public
81
+     * @return mixed true on success. PEAR_Error on failure
82
+     */
83 83
     function init()
84 84
     {
85 85
         $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
     }
97 97
 
98 98
     /**
99
-    * Append data to PPS
100
-    *
101
-    * @access public
102
-    * @param string $data The data to append
103
-    */
99
+     * Append data to PPS
100
+     *
101
+     * @access public
102
+     * @param string $data The data to append
103
+     */
104 104
     function append($data)
105 105
     {
106 106
         if ($this->_PPS_FILE) {
Please login to merge, or discard this patch.
main/inc/lib/pear/OLE/PPS/Root.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     *
66 66
     * @access public
67 67
     * @param string $dir The dir to be used as temp dir
68
-    * @return true if given dir is valid, false otherwise
68
+    * @return boolean if given dir is valid, false otherwise
69 69
     */
70 70
     function setTempDir($dir)
71 71
     {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     *
143 143
     * @access private
144 144
     * @param array $raList Reference to an array of PPS's
145
-    * @return array The array of numbers
145
+    * @return double[] The array of numbers
146 146
     */
147 147
     function _calcSize(&$raList)
148 148
     {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     * @access private
181 181
     * @param integer $i2 The argument
182 182
     * @see save()
183
-    * @return integer
183
+    * @return double
184 184
     */
185 185
     function _adjust2($i2)
186 186
     {
Please login to merge, or discard this patch.
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -32,41 +32,41 @@  discard block
 block discarded – undo
32 32
 class OLE_PPS_Root extends OLE_PPS
33 33
 {
34 34
     /**
35
-    * The temporary dir for storing the OLE file
36
-    * @var string
37
-    */
35
+     * The temporary dir for storing the OLE file
36
+     * @var string
37
+     */
38 38
     var $_tmp_dir;
39 39
 
40 40
     /**
41
-    * Constructor
42
-    *
43
-    * @access public
44
-    * @param integer $time_1st A timestamp
45
-    * @param integer $time_2nd A timestamp
46
-    */
41
+     * Constructor
42
+     *
43
+     * @access public
44
+     * @param integer $time_1st A timestamp
45
+     * @param integer $time_2nd A timestamp
46
+     */
47 47
     function OLE_PPS_Root($time_1st, $time_2nd, $raChild)
48 48
     {
49 49
         $this->_tmp_dir = '';
50 50
         $this->OLE_PPS(
51
-           null,
52
-           OLE::Asc2Ucs('Root Entry'),
53
-           OLE_PPS_TYPE_ROOT,
54
-           null,
55
-           null,
56
-           null,
57
-           $time_1st,
58
-           $time_2nd,
59
-           null,
60
-           $raChild);
51
+            null,
52
+            OLE::Asc2Ucs('Root Entry'),
53
+            OLE_PPS_TYPE_ROOT,
54
+            null,
55
+            null,
56
+            null,
57
+            $time_1st,
58
+            $time_2nd,
59
+            null,
60
+            $raChild);
61 61
     }
62 62
 
63 63
     /**
64
-    * Sets the temp dir used for storing the OLE file
65
-    *
66
-    * @access public
67
-    * @param string $dir The dir to be used as temp dir
68
-    * @return true if given dir is valid, false otherwise
69
-    */
64
+     * Sets the temp dir used for storing the OLE file
65
+     *
66
+     * @access public
67
+     * @param string $dir The dir to be used as temp dir
68
+     * @return true if given dir is valid, false otherwise
69
+     */
70 70
     function setTempDir($dir)
71 71
     {
72 72
         if (is_dir($dir)) {
@@ -77,21 +77,21 @@  discard block
 block discarded – undo
77 77
     }
78 78
 
79 79
     /**
80
-    * Method for saving the whole OLE container (including files).
81
-    * In fact, if called with an empty argument (or '-'), it saves to a
82
-    * temporary file and then outputs it's contents to stdout.
83
-    *
84
-    * @param string $filename The name of the file where to save the OLE container
85
-    * @access public
86
-    * @return mixed true on success, PEAR_Error on failure
87
-    */
80
+     * Method for saving the whole OLE container (including files).
81
+     * In fact, if called with an empty argument (or '-'), it saves to a
82
+     * temporary file and then outputs it's contents to stdout.
83
+     *
84
+     * @param string $filename The name of the file where to save the OLE container
85
+     * @access public
86
+     * @return mixed true on success, PEAR_Error on failure
87
+     */
88 88
     function save($filename)
89 89
     {
90 90
         // Initial Setting for saving
91 91
         $this->_BIG_BLOCK_SIZE  = pow(2,
92
-                      ((isset($this->_BIG_BLOCK_SIZE))? $this->_adjust2($this->_BIG_BLOCK_SIZE)  : 9));
92
+                        ((isset($this->_BIG_BLOCK_SIZE))? $this->_adjust2($this->_BIG_BLOCK_SIZE)  : 9));
93 93
         $this->_SMALL_BLOCK_SIZE= pow(2,
94
-                      ((isset($this->_SMALL_BLOCK_SIZE))?  $this->_adjust2($this->_SMALL_BLOCK_SIZE): 6));
94
+                        ((isset($this->_SMALL_BLOCK_SIZE))?  $this->_adjust2($this->_SMALL_BLOCK_SIZE): 6));
95 95
 
96 96
         // Open temp file if we are sending output to stdout
97 97
         if (($filename == '-') || ($filename == '')) {
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
     }
139 139
 
140 140
     /**
141
-    * Calculate some numbers
142
-    *
143
-    * @access private
144
-    * @param array $raList Reference to an array of PPS's
145
-    * @return array The array of numbers
146
-    */
141
+     * Calculate some numbers
142
+     *
143
+     * @access private
144
+     * @param array $raList Reference to an array of PPS's
145
+     * @return array The array of numbers
146
+     */
147 147
     function _calcSize(&$raList)
148 148
     {
149 149
         // Calculate Basic Setting
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
     }
176 176
 
177 177
     /**
178
-    * Helper function for caculating a magic value for block sizes
179
-    *
180
-    * @access private
181
-    * @param integer $i2 The argument
182
-    * @see save()
183
-    * @return integer
184
-    */
178
+     * Helper function for caculating a magic value for block sizes
179
+     *
180
+     * @access private
181
+     * @param integer $i2 The argument
182
+     * @see save()
183
+     * @return integer
184
+     */
185 185
     function _adjust2($i2)
186 186
     {
187 187
         $iWk = log($i2)/log(2);
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
     }
190 190
 
191 191
     /**
192
-    * Save OLE header
193
-    *
194
-    * @access private
195
-    * @param integer $iSBDcnt
196
-    * @param integer $iBBcnt
197
-    * @param integer $iPPScnt
198
-    */
192
+     * Save OLE header
193
+     *
194
+     * @access private
195
+     * @param integer $iSBDcnt
196
+     * @param integer $iBBcnt
197
+     * @param integer $iPPScnt
198
+     */
199 199
     function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt)
200 200
     {
201 201
         $FILE = $this->_FILEH_;
@@ -225,32 +225,32 @@  discard block
 block discarded – undo
225 225
 
226 226
         // Save Header
227 227
         fwrite($FILE,
228
-                  "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"
229
-                  . "\x00\x00\x00\x00"
230
-                  . "\x00\x00\x00\x00"
231
-                  . "\x00\x00\x00\x00"
232
-                  . "\x00\x00\x00\x00"
233
-                  . pack("v", 0x3b)
234
-                  . pack("v", 0x03)
235
-                  . pack("v", -2)
236
-                  . pack("v", 9)
237
-                  . pack("v", 6)
238
-                  . pack("v", 0)
239
-                  . "\x00\x00\x00\x00"
240
-                  . "\x00\x00\x00\x00"
241
-                  . pack("V", $iBdCnt)
242
-                  . pack("V", $iBBcnt+$iSBDcnt) //ROOT START
243
-                  . pack("V", 0)
244
-                  . pack("V", 0x1000)
245
-                  . pack("V", 0)                  //Small Block Depot
246
-                  . pack("V", 1)
247
-          );
228
+                    "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"
229
+                    . "\x00\x00\x00\x00"
230
+                    . "\x00\x00\x00\x00"
231
+                    . "\x00\x00\x00\x00"
232
+                    . "\x00\x00\x00\x00"
233
+                    . pack("v", 0x3b)
234
+                    . pack("v", 0x03)
235
+                    . pack("v", -2)
236
+                    . pack("v", 9)
237
+                    . pack("v", 6)
238
+                    . pack("v", 0)
239
+                    . "\x00\x00\x00\x00"
240
+                    . "\x00\x00\x00\x00"
241
+                    . pack("V", $iBdCnt)
242
+                    . pack("V", $iBBcnt+$iSBDcnt) //ROOT START
243
+                    . pack("V", 0)
244
+                    . pack("V", 0x1000)
245
+                    . pack("V", 0)                  //Small Block Depot
246
+                    . pack("V", 1)
247
+            );
248 248
         // Extra BDList Start, Count
249 249
         if ($iBdCnt < $i1stBdL) {
250 250
             fwrite($FILE,
251
-                      pack("V", -2).      // Extra BDList Start
252
-                      pack("V", 0)        // Extra BDList Count
253
-                  );
251
+                        pack("V", -2).      // Extra BDList Start
252
+                        pack("V", 0)        // Extra BDList Count
253
+                    );
254 254
         } else {
255 255
             fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL));
256 256
         }
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
     }
268 268
 
269 269
     /**
270
-    * Saving big data (PPS's with data bigger than OLE_DATA_SIZE_SMALL)
271
-    *
272
-    * @access private
273
-    * @param integer $iStBlk
274
-    * @param array &$raList Reference to array of PPS's
275
-    */
270
+     * Saving big data (PPS's with data bigger than OLE_DATA_SIZE_SMALL)
271
+     *
272
+     * @access private
273
+     * @param integer $iStBlk
274
+     * @param array &$raList Reference to array of PPS's
275
+     */
276 276
     function _saveBigData($iStBlk, &$raList)
277 277
     {
278 278
         $FILE = $this->_FILEH_;
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
     }
319 319
 
320 320
     /**
321
-    * get small data (PPS's with data smaller than OLE_DATA_SIZE_SMALL)
322
-    *
323
-    * @access private
324
-    * @param array &$raList Reference to array of PPS's
325
-    */
321
+     * get small data (PPS's with data smaller than OLE_DATA_SIZE_SMALL)
322
+     *
323
+     * @access private
324
+     * @param array &$raList Reference to array of PPS's
325
+     */
326 326
     function _makeSmallData(&$raList)
327 327
     {
328 328
         $sRes = '';
@@ -374,11 +374,11 @@  discard block
 block discarded – undo
374 374
     }
375 375
 
376 376
     /**
377
-    * Saves all the PPS's WKs
378
-    *
379
-    * @access private
380
-    * @param array $raList Reference to an array with all PPS's
381
-    */
377
+     * Saves all the PPS's WKs
378
+     *
379
+     * @access private
380
+     * @param array $raList Reference to an array with all PPS's
381
+     */
382 382
     function _savePps(&$raList)
383 383
     {
384 384
         // Save each PPS WK
@@ -396,13 +396,13 @@  discard block
 block discarded – undo
396 396
     }
397 397
 
398 398
     /**
399
-    * Saving Big Block Depot
400
-    *
401
-    * @access private
402
-    * @param integer $iSbdSize
403
-    * @param integer $iBsize
404
-    * @param integer $iPpsCnt
405
-    */
399
+     * Saving Big Block Depot
400
+     *
401
+     * @access private
402
+     * @param integer $iSbdSize
403
+     * @param integer $iBsize
404
+     * @param integer $iPpsCnt
405
+     */
406 406
     function _saveBbd($iSbdSize, $iBsize, $iPpsCnt)
407 407
     {
408 408
         $FILE = $this->_FILEH_;
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
     {
90 90
         // Initial Setting for saving
91 91
         $this->_BIG_BLOCK_SIZE  = pow(2,
92
-                      ((isset($this->_BIG_BLOCK_SIZE))? $this->_adjust2($this->_BIG_BLOCK_SIZE)  : 9));
93
-        $this->_SMALL_BLOCK_SIZE= pow(2,
94
-                      ((isset($this->_SMALL_BLOCK_SIZE))?  $this->_adjust2($this->_SMALL_BLOCK_SIZE): 6));
92
+                      ((isset($this->_BIG_BLOCK_SIZE)) ? $this->_adjust2($this->_BIG_BLOCK_SIZE) : 9));
93
+        $this->_SMALL_BLOCK_SIZE = pow(2,
94
+                      ((isset($this->_SMALL_BLOCK_SIZE)) ? $this->_adjust2($this->_SMALL_BLOCK_SIZE) : 6));
95 95
 
96 96
         // Open temp file if we are sending output to stdout
97 97
         if (($filename == '-') || ($filename == '')) {
98 98
             $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
99
-            $this->_FILEH_ = @fopen($this->_tmp_filename,"w+b");
99
+            $this->_FILEH_ = @fopen($this->_tmp_filename, "w+b");
100 100
             if ($this->_FILEH_ == false) {
101 101
                 return $this->raiseError("Can't create temporary file.");
102 102
             }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     function _calcSize(&$raList)
148 148
     {
149 149
         // Calculate Basic Setting
150
-        list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0,0,0);
150
+        list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0, 0, 0);
151 151
         $iSmallLen = 0;
152 152
         $iSBcnt = 0;
153 153
         for ($i = 0; $i < count($raList); $i++) {
@@ -155,21 +155,21 @@  discard block
 block discarded – undo
155 155
                 $raList[$i]->Size = $raList[$i]->_DataLen();
156 156
                 if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) {
157 157
                     $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
158
-                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
158
+                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0);
159 159
                 } else {
160 160
                     $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) +
161
-                        (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0));
161
+                        (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0));
162 162
                 }
163 163
             }
164 164
         }
165 165
         $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE;
166 166
         $iSlCnt = floor($this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE);
167
-        $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0);
168
-        $iBBcnt +=  (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) +
169
-                      (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0));
167
+        $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt) ? 1 : 0);
168
+        $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) +
169
+                      (($iSmallLen % $this->_BIG_BLOCK_SIZE) ? 1 : 0));
170 170
         $iCnt = count($raList);
171 171
         $iBdCnt = $this->_BIG_BLOCK_SIZE / OLE_PPS_SIZE;
172
-        $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0));
172
+        $iPPScnt = (floor($iCnt / $iBdCnt) + (($iCnt % $iBdCnt) ? 1 : 0));
173 173
 
174 174
         return array($iSBDcnt, $iBBcnt, $iPPScnt);
175 175
     }
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
     */
185 185
     function _adjust2($i2)
186 186
     {
187
-        $iWk = log($i2)/log(2);
188
-        return ($iWk > floor($iWk))? floor($iWk)+1:$iWk;
187
+        $iWk = log($i2) / log(2);
188
+        return ($iWk > floor($iWk)) ? floor($iWk) + 1 : $iWk;
189 189
     }
190 190
 
191 191
     /**
@@ -207,17 +207,17 @@  discard block
 block discarded – undo
207 207
         $iBdExL = 0;
208 208
         $iAll = $iBBcnt + $iPPScnt + $iSBDcnt;
209 209
         $iAllW = $iAll;
210
-        $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
211
-        $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
210
+        $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0);
211
+        $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0);
212 212
 
213 213
         // Calculate BD count
214 214
         if ($iBdCnt > $i1stBdL) {
215 215
             while (1) {
216 216
                 $iBdExL++;
217 217
                 $iAllW++;
218
-                $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
219
-                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
220
-                if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) {
218
+                $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt) ? 1 : 0);
219
+                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW + $iBdCntW) % $iBlCnt) ? 1 : 0);
220
+                if ($iBdCnt <= ($iBdExL * $iBlCnt + $i1stBdL)) {
221 221
                     break;
222 222
                 }
223 223
             }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                   . "\x00\x00\x00\x00"
240 240
                   . "\x00\x00\x00\x00"
241 241
                   . pack("V", $iBdCnt)
242
-                  . pack("V", $iBBcnt+$iSBDcnt) //ROOT START
242
+                  . pack("V", $iBBcnt + $iSBDcnt) //ROOT START
243 243
                   . pack("V", 0)
244 244
                   . pack("V", 0x1000)
245 245
                   . pack("V", 0)                  //Small Block Depot
@@ -248,19 +248,19 @@  discard block
 block discarded – undo
248 248
         // Extra BDList Start, Count
249 249
         if ($iBdCnt < $i1stBdL) {
250 250
             fwrite($FILE,
251
-                      pack("V", -2).      // Extra BDList Start
251
+                      pack("V", -2).// Extra BDList Start
252 252
                       pack("V", 0)        // Extra BDList Count
253 253
                   );
254 254
         } else {
255
-            fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL));
255
+            fwrite($FILE, pack("V", $iAll + $iBdCnt).pack("V", $iBdExL));
256 256
         }
257 257
 
258 258
         // BDList
259 259
         for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; $i++) {
260
-            fwrite($FILE, pack("V", $iAll+$i));
260
+            fwrite($FILE, pack("V", $iAll + $i));
261 261
         }
262 262
         if ($i < $i1stBdL) {
263
-            for ($j = 0; $j < ($i1stBdL-$i); $j++) {
263
+            for ($j = 0; $j < ($i1stBdL - $i); $j++) {
264 264
                 fwrite($FILE, (pack("V", -1)));
265 265
             }
266 266
         }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
                     if (isset($raList[$i]->_PPS_FILE)) {
289 289
                         $iLen = 0;
290 290
                         fseek($raList[$i]->_PPS_FILE, 0); // To The Top
291
-                        while($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
291
+                        while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
292 292
                             $iLen += strlen($sBuff);
293 293
                             fwrite($FILE, $sBuff);
294 294
                         }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                     $raList[$i]->_StartBlock = $iStBlk;
306 306
                     $iStBlk +=
307 307
                             (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) +
308
-                                (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0));
308
+                                (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0));
309 309
                 }
310 310
                 // Close file for each PPS, and unlink it
311 311
                 if (isset($raList[$i]->_PPS_FILE)) {
@@ -337,10 +337,10 @@  discard block
 block discarded – undo
337 337
                 }
338 338
                 if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) {
339 339
                     $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
340
-                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
340
+                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) ? 1 : 0);
341 341
                     // Add to SBD
342
-                    for ($j = 0; $j < ($iSmbCnt-1); $j++) {
343
-                        fwrite($FILE, pack("V", $j+$iSmBlk+1));
342
+                    for ($j = 0; $j < ($iSmbCnt - 1); $j++) {
343
+                        fwrite($FILE, pack("V", $j + $iSmBlk + 1));
344 344
                     }
345 345
                     fwrite($FILE, pack("V", -2));
346 346
 
@@ -413,16 +413,16 @@  discard block
 block discarded – undo
413 413
         $iBdExL = 0;
414 414
         $iAll = $iBsize + $iPpsCnt + $iSbdSize;
415 415
         $iAllW = $iAll;
416
-        $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0);
417
-        $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0);
416
+        $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0);
417
+        $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0);
418 418
         // Calculate BD count
419
-        if ($iBdCnt >$i1stBdL) {
419
+        if ($iBdCnt > $i1stBdL) {
420 420
             while (1) {
421 421
                 $iBdExL++;
422 422
                 $iAllW++;
423
-                $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0);
424
-                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0);
425
-                if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) {
423
+                $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0);
424
+                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0);
425
+                if ($iBdCnt <= ($iBdExL * $iBbCnt + $i1stBdL)) {
426 426
                     break;
427 427
                 }
428 428
             }
@@ -432,19 +432,19 @@  discard block
 block discarded – undo
432 432
         // Set for SBD
433 433
         if ($iSbdSize > 0) {
434 434
             for ($i = 0; $i < ($iSbdSize - 1); $i++) {
435
-                fwrite($FILE, pack("V", $i+1));
435
+                fwrite($FILE, pack("V", $i + 1));
436 436
             }
437 437
             fwrite($FILE, pack("V", -2));
438 438
         }
439 439
         // Set for B
440 440
         for ($i = 0; $i < ($iBsize - 1); $i++) {
441
-            fwrite($FILE, pack("V", $i+$iSbdSize+1));
441
+            fwrite($FILE, pack("V", $i + $iSbdSize + 1));
442 442
         }
443 443
         fwrite($FILE, pack("V", -2));
444 444
 
445 445
         // Set for PPS
446 446
         for ($i = 0; $i < ($iPpsCnt - 1); $i++) {
447
-            fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1));
447
+            fwrite($FILE, pack("V", $i + $iSbdSize + $iBsize + 1));
448 448
         }
449 449
         fwrite($FILE, pack("V", -2));
450 450
         // Set for BBD itself ( 0xFFFFFFFD : BBD)
@@ -463,17 +463,17 @@  discard block
 block discarded – undo
463 463
         }
464 464
         // Extra BDList
465 465
         if ($iBdCnt > $i1stBdL) {
466
-            $iN=0;
467
-            $iNb=0;
468
-            for ($i = $i1stBdL;$i < $iBdCnt; $i++, $iN++) {
466
+            $iN = 0;
467
+            $iNb = 0;
468
+            for ($i = $i1stBdL; $i < $iBdCnt; $i++, $iN++) {
469 469
                 if ($iN >= ($iBbCnt - 1)) {
470 470
                     $iN = 0;
471 471
                     $iNb++;
472
-                    fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb));
472
+                    fwrite($FILE, pack("V", $iAll + $iBdCnt + $iNb));
473 473
                 }
474
-                fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i));
474
+                fwrite($FILE, pack("V", $iBsize + $iSbdSize + $iPpsCnt + $i));
475 475
             }
476
-            if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) {
476
+            if (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)) {
477 477
                 for ($i = 0; $i < (($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1))); $i++) {
478 478
                     fwrite($FILE, pack("V", -1));
479 479
                 }
Please login to merge, or discard this patch.