Passed
Push — master ( f8e3f7...025a78 )
by Sebastian
03:51
created
src/NumberInfo.php 3 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -40,19 +40,19 @@  discard block
 block discarded – undo
40 40
  */
41 41
 class NumberInfo
42 42
 {
43
-   /**
44
-    * @var string|int|float|null
45
-    */
43
+    /**
44
+     * @var string|int|float|null
45
+     */
46 46
     protected $rawValue;
47 47
     
48
-   /**
49
-    * @var array<string,mixed>
50
-    */
48
+    /**
49
+     * @var array<string,mixed>
50
+     */
51 51
     protected $info;
52 52
     
53
-   /**
54
-    * @var bool
55
-    */
53
+    /**
54
+     * @var bool
55
+     */
56 56
     protected $empty = false;
57 57
 
58 58
     /**
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
     /**
64 64
      * Units and whether they allow decimal values.
65
-    * @var array<string,bool>
66
-    */
65
+     * @var array<string,bool>
66
+     */
67 67
     protected $knownUnits = array(
68 68
         '%' => true,
69 69
         'rem' => true,
@@ -141,21 +141,21 @@  discard block
 block discarded – undo
141 141
         return $this;
142 142
     }
143 143
     
144
-   /**
145
-    * Retrieves the raw, internal information array resulting
146
-    * from the parsing of the number.
147
-    *  
148
-    * @return array<string,mixed>
149
-    */
144
+    /**
145
+     * Retrieves the raw, internal information array resulting
146
+     * from the parsing of the number.
147
+     *  
148
+     * @return array<string,mixed>
149
+     */
150 150
     public function getRawInfo() : array
151 151
     {
152 152
         return $this->info;
153 153
     }
154 154
     
155
-   /**
156
-    * Whether the number was empty (null or empty string).
157
-    * @return boolean
158
-    */
155
+    /**
156
+     * Whether the number was empty (null or empty string).
157
+     * @return boolean
158
+     */
159 159
     public function isEmpty() : bool
160 160
     {
161 161
         return $this->empty;
@@ -729,12 +729,12 @@  discard block
 block discarded – undo
729 729
         return $cache[$key];
730 730
     }
731 731
     
732
-   /**
733
-    * Parses a string number notation with units included, e.g. 14px, 50%...
734
-    * 
735
-    * @param string $test
736
-    * @return array<string,mixed>
737
-    */
732
+    /**
733
+     * Parses a string number notation with units included, e.g. 14px, 50%...
734
+     * 
735
+     * @param string $test
736
+     * @return array<string,mixed>
737
+     */
738 738
     private function parseStringValue(string $test) : array
739 739
     {
740 740
         $number = null;
@@ -785,13 +785,13 @@  discard block
 block discarded – undo
785 785
         return $this->filterInfo($result);
786 786
     }
787 787
     
788
-   /**
789
-    * Attempts to determine what kind of units are specified
790
-    * in the string. Returns NULL if none could be matched.
791
-    * 
792
-    * @param string $value
793
-    * @return array<string,mixed>|NULL
794
-    */
788
+    /**
789
+     * Attempts to determine what kind of units are specified
790
+     * in the string. Returns NULL if none could be matched.
791
+     * 
792
+     * @param string $value
793
+     * @return array<string,mixed>|NULL
794
+     */
795 795
     private function findUnits(string $value) : ?array
796 796
     {
797 797
         $vlength = strlen($value);
@@ -819,12 +819,12 @@  discard block
 block discarded – undo
819 819
         return null;
820 820
     }
821 821
     
822
-   /**
823
-    * Creates the cache key for the specified value.
824
-    * 
825
-    * @param mixed $value
826
-    * @return string
827
-    */
822
+    /**
823
+     * Creates the cache key for the specified value.
824
+     * 
825
+     * @param mixed $value
826
+     * @return string
827
+     */
828 828
     private function createValueKey($value) : string
829 829
     {
830 830
         if(!is_string($value) && !is_numeric($value))
@@ -835,59 +835,59 @@  discard block
 block discarded – undo
835 835
         return (string)$value;
836 836
     }
837 837
 
838
-   /**
839
-    * Called if explicitly enabled: allows filtering the 
840
-    * number after the detection process has completed.
841
-    * 
842
-    * @param string|NULL $number The adjusted number
843
-    * @param string $originalString The original value before it was parsed
844
-    * @return string|null
845
-    */
838
+    /**
839
+     * Called if explicitly enabled: allows filtering the 
840
+     * number after the detection process has completed.
841
+     * 
842
+     * @param string|NULL $number The adjusted number
843
+     * @param string $originalString The original value before it was parsed
844
+     * @return string|null
845
+     */
846 846
     protected function postProcess(?string $number, /** @scrutinizer ignore-unused */ string $originalString)
847 847
     {
848 848
         return $number;
849 849
     }
850 850
     
851
-   /**
852
-    * Filters the value before it is parsed, but only if it is a string.
853
-    * 
854
-    * NOTE: This may be overwritten in a subclass, to allow custom filtering
855
-    * the values. An example of a use case would be a preprocessor for
856
-    * variables in a templating system.
857
-    * 
858
-    * @param string $trimmedString The trimmed value.
859
-    * @param array<string,mixed> $cache The internal values cache array.
860
-    * @param string $originalValue The original value that the NumberInfo was created for.
861
-    * @return string
862
-    * 
863
-    * @see NumberInfo::enablePostProcess()
864
-    */
851
+    /**
852
+     * Filters the value before it is parsed, but only if it is a string.
853
+     * 
854
+     * NOTE: This may be overwritten in a subclass, to allow custom filtering
855
+     * the values. An example of a use case would be a preprocessor for
856
+     * variables in a templating system.
857
+     * 
858
+     * @param string $trimmedString The trimmed value.
859
+     * @param array<string,mixed> $cache The internal values cache array.
860
+     * @param string $originalValue The original value that the NumberInfo was created for.
861
+     * @return string
862
+     * 
863
+     * @see NumberInfo::enablePostProcess()
864
+     */
865 865
     protected function preProcess(string $trimmedString, /** @scrutinizer ignore-unused */ array &$cache, /** @scrutinizer ignore-unused */ string $originalValue) : string
866 866
     {
867 867
         return str_replace(',', '.', $trimmedString);
868 868
     }
869 869
     
870
-   /**
871
-    * Enables the post-processing so the postProcess method gets called.
872
-    * This should be called in the {@link NumberInfo::preProcess()}
873
-    * method as needed.
874
-    * 
875
-    * @return $this
876
-    * @see NumberInfo::postProcess()
877
-    */
870
+    /**
871
+     * Enables the post-processing so the postProcess method gets called.
872
+     * This should be called in the {@link NumberInfo::preProcess()}
873
+     * method as needed.
874
+     * 
875
+     * @return $this
876
+     * @see NumberInfo::postProcess()
877
+     */
878 878
     protected function enablePostProcess() : NumberInfo
879 879
     {
880 880
         $this->postProcess = true;
881 881
         return $this;
882 882
     }
883 883
     
884
-   /**
885
-    * Filters the number info array to adjust the units
886
-    * and number according to the required rules.
887
-    * 
888
-    * @param array<string,mixed> $info
889
-    * @return array<string,mixed>
890
-    */
884
+    /**
885
+     * Filters the number info array to adjust the units
886
+     * and number according to the required rules.
887
+     * 
888
+     * @param array<string,mixed> $info
889
+     * @return array<string,mixed>
890
+     */
891 891
     protected function filterInfo(array $info) : array
892 892
     {
893 893
         $useUnits = 'px';
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     protected function _setValue($value)
132 132
     {
133
-        if($value instanceof NumberInfo) {
133
+        if ($value instanceof NumberInfo) {
134 134
             $value = $value->getValue();
135 135
         }
136 136
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function isPositive() : bool
172 172
     {
173
-        if($this->isEmpty())
173
+        if ($this->isEmpty())
174 174
         {
175 175
             return false;
176 176
         }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public function isZero() : bool
187 187
     {
188
-        if($this->isEmpty())
188
+        if ($this->isEmpty())
189 189
         {
190 190
             return false;
191 191
         }
@@ -231,23 +231,23 @@  discard block
 block discarded – undo
231 231
     {
232 232
         // Append the units if the value is a number,
233 233
         // so they can be inherited.
234
-        if($this->hasUnits() && is_numeric($number))
234
+        if ($this->hasUnits() && is_numeric($number))
235 235
         {
236 236
             $number .= $this->getUnits();
237 237
         }
238 238
 
239 239
         $new = parseNumber($number);
240 240
 
241
-        if($new->isEmpty())
241
+        if ($new->isEmpty())
242 242
         {
243 243
             return $this;
244 244
         }
245 245
 
246
-        if($new->getUnits() === $this->getUnits())
246
+        if ($new->getUnits() === $this->getUnits())
247 247
         {
248 248
             $value = $new->getNumber();
249 249
 
250
-            if($this->hasUnits()) {
250
+            if ($this->hasUnits()) {
251 251
                 $value .= $this->getUnits();
252 252
             }
253 253
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     {
290 290
         $number = (float)$this->info['number'];
291 291
 
292
-        if($this->hasDecimals())
292
+        if ($this->hasDecimals())
293 293
         {
294 294
             return $number;
295 295
         }
@@ -325,11 +325,11 @@  discard block
 block discarded – undo
325 325
      */
326 326
     public function getUnits() : string
327 327
     {
328
-        if($this->isEmpty()) {
328
+        if ($this->isEmpty()) {
329 329
             return '';
330 330
         }
331 331
 
332
-        if(!$this->hasUnits()) {
332
+        if (!$this->hasUnits()) {
333 333
             return 'px';
334 334
         }
335 335
         
@@ -363,15 +363,15 @@  discard block
 block discarded – undo
363 363
      */
364 364
     public function toAttribute() : string
365 365
     {
366
-        if($this->isEmpty()) {
366
+        if ($this->isEmpty()) {
367 367
             return '';
368 368
         }
369 369
         
370
-        if($this->isZero()) {
370
+        if ($this->isZero()) {
371 371
             return '0';
372 372
         }
373 373
         
374
-        if($this->isPercent()) {
374
+        if ($this->isPercent()) {
375 375
             return $this->getNumber().$this->getUnits();
376 376
         }
377 377
         
@@ -384,11 +384,11 @@  discard block
 block discarded – undo
384 384
      */
385 385
     public function toCSS() : string
386 386
     {
387
-        if($this->isEmpty()) {
387
+        if ($this->isEmpty()) {
388 388
             return '';
389 389
         }
390 390
         
391
-        if($this->isZero()) {
391
+        if ($this->isZero()) {
392 392
             return '0';
393 393
         }
394 394
         
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
     
398 398
     public function __toString()
399 399
     {
400
-        if($this->isEmpty()) {
400
+        if ($this->isEmpty()) {
401 401
             return '';
402 402
         }
403 403
         
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
      */
504 504
     public function add($value)
505 505
     {
506
-        if($this->isEmpty())
506
+        if ($this->isEmpty())
507 507
         {
508 508
             $this->setValue($value);
509 509
             return $this;
@@ -511,11 +511,11 @@  discard block
 block discarded – undo
511 511
         
512 512
         $number = parseNumber($value);
513 513
         
514
-        if($number->getUnits() === $this->getUnits() || !$number->hasUnits())
514
+        if ($number->getUnits() === $this->getUnits() || !$number->hasUnits())
515 515
         {
516 516
             $new = $this->getNumber() + $number->getNumber();
517 517
 
518
-            if($this->hasUnits())
518
+            if ($this->hasUnits())
519 519
             {
520 520
                 $new .= $this->getUnits();
521 521
             }
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
      */
537 537
     public function subtract($value)
538 538
     {
539
-        if($this->isEmpty())
539
+        if ($this->isEmpty())
540 540
         {
541 541
             $this->setValue($value);
542 542
             return $this;
@@ -544,11 +544,11 @@  discard block
 block discarded – undo
544 544
         
545 545
         $number = parseNumber($value);
546 546
         
547
-        if($number->getUnits() == $this->getUnits() || !$number->hasUnits())
547
+        if ($number->getUnits() == $this->getUnits() || !$number->hasUnits())
548 548
         {
549 549
             $new = $this->getNumber() - $number->getNumber();
550 550
 
551
-            if($this->hasUnits())
551
+            if ($this->hasUnits())
552 552
             {
553 553
                 $new .= $this->getUnits();
554 554
             }
@@ -588,13 +588,13 @@  discard block
 block discarded – undo
588 588
      */
589 589
     protected function percentOperation(string $operation, $percent)
590 590
     {
591
-        if($this->isZeroOrEmpty()) {
591
+        if ($this->isZeroOrEmpty()) {
592 592
             return $this;
593 593
         }
594 594
         
595 595
         $percent = parseNumber($percent);
596 596
 
597
-        if($percent->hasUnits() && !$percent->isPercent())
597
+        if ($percent->hasUnits() && !$percent->isPercent())
598 598
         {
599 599
             return $this;
600 600
         }
@@ -602,18 +602,18 @@  discard block
 block discarded – undo
602 602
         $number = $this->getNumber();
603 603
         $value = $number * $percent->getNumber() / 100;
604 604
         
605
-        if($operation == '-') {
605
+        if ($operation == '-') {
606 606
             $number = $number - $value;
607 607
         } else {
608 608
             $number = $number + $value;
609 609
         }
610 610
         
611
-        if($this->isUnitInteger())
611
+        if ($this->isUnitInteger())
612 612
         {
613 613
             $number = intval($number);
614 614
         }
615 615
 
616
-        if($this->hasUnits())
616
+        if ($this->hasUnits())
617 617
         {
618 618
             $number .= $this->getUnits();
619 619
         }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
     {
628 628
         $units = $this->getUnits();
629 629
 
630
-        if(isset($this->knownUnits[$units]))
630
+        if (isset($this->knownUnits[$units]))
631 631
         {
632 632
             return !$this->knownUnits[$units];
633 633
         }
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
     {
640 640
         $units = $this->getUnits();
641 641
 
642
-        if(isset($this->knownUnits[$units]))
642
+        if (isset($this->knownUnits[$units]))
643 643
         {
644 644
             return $this->knownUnits[$units];
645 645
         }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
         
679 679
         $key = $this->createValueKey($value);
680 680
 
681
-        if(array_key_exists($key, $cache)) {
681
+        if (array_key_exists($key, $cache)) {
682 682
             return $cache[$key];
683 683
         }
684 684
         
@@ -688,13 +688,13 @@  discard block
 block discarded – undo
688 688
             'number' => null
689 689
         );
690 690
         
691
-        if($key === '_EMPTY_') 
691
+        if ($key === '_EMPTY_') 
692 692
         {
693 693
             $cache[$key]['empty'] = true;
694 694
             return $cache[$key];
695 695
         }
696 696
         
697
-        if($value === 0 || $value === '0') 
697
+        if ($value === 0 || $value === '0') 
698 698
         {
699 699
             $cache[$key]['number'] = 0;
700 700
             $cache[$key] = $this->filterInfo($cache[$key]);
@@ -703,20 +703,20 @@  discard block
 block discarded – undo
703 703
         
704 704
         $test = trim((string)$value);
705 705
         
706
-        if($test === '') 
706
+        if ($test === '') 
707 707
         {
708 708
             $cache[$key]['empty'] = true;
709 709
             return $cache[$key];
710 710
         }
711 711
         
712 712
         // replace comma notation (which is only possible if it's a string)
713
-        if(is_string($value))
713
+        if (is_string($value))
714 714
         {
715 715
             $test = $this->preProcess($test, $cache, $value);
716 716
         }
717 717
         
718 718
         // convert to a number if it's numeric
719
-        if(is_numeric($test)) 
719
+        if (is_numeric($test)) 
720 720
         {
721 721
             $cache[$key]['number'] = (float)$test * 1;
722 722
             $cache[$key] = $this->filterInfo($cache[$key]);
@@ -742,19 +742,19 @@  discard block
 block discarded – undo
742 742
         $empty = false;
743 743
         
744 744
         $found = $this->findUnits($test);
745
-        if($found !== null) 
745
+        if ($found !== null) 
746 746
         {
747 747
             $number = $found['number'];
748 748
             $units = $found['units'];
749 749
         }
750 750
         
751 751
         // the filters have to restore the value
752
-        if($this->postProcess)
752
+        if ($this->postProcess)
753 753
         {
754 754
             $number = $this->postProcess($number, $test);
755 755
         }
756 756
         // empty number
757
-        else if($number === '' || $number === null || is_bool($number))
757
+        else if ($number === '' || $number === null || is_bool($number))
758 758
         {
759 759
             $number = null;
760 760
             $empty = true;
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
             $number = trim($number);
766 766
             
767 767
             // may be an arbitrary string in some cases
768
-            if(!is_numeric($number))
768
+            if (!is_numeric($number))
769 769
             {
770 770
                 $number = null;
771 771
                 $empty = true;
@@ -797,17 +797,17 @@  discard block
 block discarded – undo
797 797
         $vlength = strlen($value);
798 798
         $names = array_keys($this->knownUnits);
799 799
         
800
-        foreach($names as $unit)
800
+        foreach ($names as $unit)
801 801
         {
802 802
             $ulength = strlen($unit);
803
-            $start = $vlength-$ulength;
804
-            if($start < 0) {
803
+            $start = $vlength - $ulength;
804
+            if ($start < 0) {
805 805
                 continue;
806 806
             }
807 807
             
808 808
             $search = substr($value, $start, $ulength);
809 809
             
810
-            if($search==$unit) 
810
+            if ($search == $unit) 
811 811
             {
812 812
                 return array(
813 813
                     'units' => $unit,
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
     */
828 828
     private function createValueKey($value) : string
829 829
     {
830
-        if(!is_string($value) && !is_numeric($value))
830
+        if (!is_string($value) && !is_numeric($value))
831 831
         {
832 832
             return '_EMPTY_';
833 833
         }
@@ -891,12 +891,12 @@  discard block
 block discarded – undo
891 891
     protected function filterInfo(array $info) : array
892 892
     {
893 893
         $useUnits = 'px';
894
-        if($info['units'] !== null) {
894
+        if ($info['units'] !== null) {
895 895
             $useUnits = $info['units'];
896 896
         }
897 897
         
898 898
         // the units are non-decimal: convert decimal values
899
-        if($this->knownUnits[$useUnits] === false && !$info['empty'] && is_numeric($info['number']))
899
+        if ($this->knownUnits[$useUnits] === false && !$info['empty'] && is_numeric($info['number']))
900 900
         {
901 901
             $info['number'] = intval($info['number']);
902 902
         }
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
     {
923 923
         $number = floor($this->getNumber());
924 924
 
925
-        if($number % 2 == 1) $number--;
925
+        if ($number % 2 == 1) $number--;
926 926
 
927 927
         return $this->setNumber($number);
928 928
     }
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
     {
939 939
         $number = ceil($this->getNumber());
940 940
 
941
-        if($number % 2 == 1) $number++;
941
+        if ($number % 2 == 1) $number++;
942 942
 
943 943
         return $this->setNumber($number);
944 944
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -769,8 +769,7 @@  discard block
 block discarded – undo
769 769
             {
770 770
                 $number = null;
771 771
                 $empty = true;
772
-            }
773
-            else
772
+            } else
774 773
             {
775 774
                 $number = (float)$number * 1;
776 775
             }
@@ -922,7 +921,9 @@  discard block
 block discarded – undo
922 921
     {
923 922
         $number = floor($this->getNumber());
924 923
 
925
-        if($number % 2 == 1) $number--;
924
+        if($number % 2 == 1) {
925
+            $number--;
926
+        }
926 927
 
927 928
         return $this->setNumber($number);
928 929
     }
@@ -938,7 +939,9 @@  discard block
 block discarded – undo
938 939
     {
939 940
         $number = ceil($this->getNumber());
940 941
 
941
-        if($number % 2 == 1) $number++;
942
+        if($number % 2 == 1) {
943
+            $number++;
944
+        }
942 945
 
943 946
         return $this->setNumber($number);
944 947
     }
Please login to merge, or discard this patch.
src/FileHelper/PHPClassInfo/Class.php 2 patches
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -22,51 +22,51 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class FileHelper_PHPClassInfo_Class 
24 24
 {
25
-   /**
26
-    * @var FileHelper_PHPClassInfo
27
-    */
25
+    /**
26
+     * @var FileHelper_PHPClassInfo
27
+     */
28 28
     protected $info;
29 29
 
30
-   /**
31
-    * @var bool
32
-    */
30
+    /**
31
+     * @var bool
32
+     */
33 33
     protected $abstract = false;
34 34
     
35
-   /**
36
-    * @var bool
37
-    */
35
+    /**
36
+     * @var bool
37
+     */
38 38
     protected $final = false;
39 39
     
40
-   /**
41
-    * @var string
42
-    */
40
+    /**
41
+     * @var string
42
+     */
43 43
     protected $extends = '';
44 44
     
45
-   /**
46
-    * @var string[]
47
-    */
45
+    /**
46
+     * @var string[]
47
+     */
48 48
     protected $implements = array();
49 49
     
50
-   /**
51
-    * @var string
52
-    */
50
+    /**
51
+     * @var string
52
+     */
53 53
     protected $name;
54 54
     
55
-   /**
56
-    * @var string
57
-    */
55
+    /**
56
+     * @var string
57
+     */
58 58
     protected $declaration;
59 59
     
60
-   /**
61
-    * @var string
62
-    */
60
+    /**
61
+     * @var string
62
+     */
63 63
     protected $keyword;
64 64
     
65
-   /**
66
-    * @param FileHelper_PHPClassInfo $info The class info instance.
67
-    * @param string $declaration The full class declaration, e.g. "class SomeName extends SomeOtherClass".
68
-    * @param string $keyword The class keyword, if any, i.e. "abstract" or "final".
69
-    */
65
+    /**
66
+     * @param FileHelper_PHPClassInfo $info The class info instance.
67
+     * @param string $declaration The full class declaration, e.g. "class SomeName extends SomeOtherClass".
68
+     * @param string $keyword The class keyword, if any, i.e. "abstract" or "final".
69
+     */
70 70
     public function __construct(FileHelper_PHPClassInfo $info, string $declaration, string $keyword)
71 71
     {
72 72
         $this->info = $info;
@@ -76,31 +76,31 @@  discard block
 block discarded – undo
76 76
         $this->analyzeCode();
77 77
     }
78 78
     
79
-   /**
80
-    * Check if this class is a subclass of the specified
81
-    * class name.
82
-    * 
83
-    * @param string $className
84
-    * @return bool
85
-    */
79
+    /**
80
+     * Check if this class is a subclass of the specified
81
+     * class name.
82
+     * 
83
+     * @param string $className
84
+     * @return bool
85
+     */
86 86
     public function isSublassOf(string $className) : bool
87 87
     {
88 88
         return is_subclass_of($this->getNameNS(), $className);
89 89
     }
90 90
     
91
-   /**
92
-    * The class name without namespace.
93
-    * @return string
94
-    */
91
+    /**
92
+     * The class name without namespace.
93
+     * @return string
94
+     */
95 95
     public function getName() : string
96 96
     {
97 97
         return $this->name;
98 98
     }
99 99
     
100
-   /**
101
-    * The absolute class name with namespace (if any).
102
-    * @return string
103
-    */
100
+    /**
101
+     * The absolute class name with namespace (if any).
102
+     * @return string
103
+     */
104 104
     public function getNameNS() : string
105 105
     {
106 106
         $name = $this->getName();
@@ -112,48 +112,48 @@  discard block
 block discarded – undo
112 112
         return $name;
113 113
     }
114 114
     
115
-   /**
116
-    * Whether it is an abstract class.
117
-    * @return bool
118
-    */
115
+    /**
116
+     * Whether it is an abstract class.
117
+     * @return bool
118
+     */
119 119
     public function isAbstract() : bool
120 120
     {
121 121
         return $this->abstract;
122 122
     }
123 123
     
124
-   /**
125
-    * Whether it is a final class.
126
-    * @return bool
127
-    */
124
+    /**
125
+     * Whether it is a final class.
126
+     * @return bool
127
+     */
128 128
     public function isFinal() : bool
129 129
     {
130 130
         return $this->final;
131 131
     }
132 132
 
133
-   /**
134
-    * The name of the class that this class extends (with namespace, if specified).
135
-    * @return string
136
-    */
133
+    /**
134
+     * The name of the class that this class extends (with namespace, if specified).
135
+     * @return string
136
+     */
137 137
     public function getExtends() : string
138 138
     {
139 139
         return $this->extends;
140 140
     }
141 141
     
142
-   /**
143
-    * A list of interfaces the class implements, if any.
144
-    * @return string[]
145
-    */
142
+    /**
143
+     * A list of interfaces the class implements, if any.
144
+     * @return string[]
145
+     */
146 146
     public function getImplements() : array
147 147
     {
148 148
         return $this->implements;
149 149
     }
150 150
     
151
-   /**
152
-    * The class declaration string, with normalized spaces and sorted interface names.
153
-    * NOTE: does not include the keyword "abstract" or "final".
154
-    * 
155
-    * @return string
156
-    */
151
+    /**
152
+     * The class declaration string, with normalized spaces and sorted interface names.
153
+     * NOTE: does not include the keyword "abstract" or "final".
154
+     * 
155
+     * @return string
156
+     */
157 157
     public function getDeclaration() : string
158 158
     {
159 159
         $parts = array();
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
         return implode(' ', $parts);
174 174
     }
175 175
     
176
-   /**
177
-    * The keyword before "class", e.g. "abstract".
178
-    * @return string
179
-    */
176
+    /**
177
+     * The keyword before "class", e.g. "abstract".
178
+     * @return string
179
+     */
180 180
     public function getKeyword() : string
181 181
     {
182 182
         return $this->keyword;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $name = $this->getName();
107 107
         
108
-        if($this->info->hasNamespace()) {
108
+        if ($this->info->hasNamespace()) {
109 109
             $name = $this->info->getNamespace().'\\'.$this->name;
110 110
         }
111 111
         
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
         $parts[] = 'class';
161 161
         $parts[] = $this->getName();
162 162
         
163
-        if(!empty($this->extends)) {
163
+        if (!empty($this->extends)) {
164 164
             $parts[] = 'extends';
165 165
             $parts[] = $this->extends;
166 166
         }
167 167
         
168
-        if(!empty($this->implements)) {
168
+        if (!empty($this->implements)) {
169 169
             $parts[] = 'implements';
170 170
             $parts[] = implode(', ', $this->implements);
171 171
         }
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
     
185 185
     protected function analyzeCode() : void
186 186
     {
187
-        if($this->keyword == 'abstract') {
187
+        if ($this->keyword == 'abstract') {
188 188
             $this->abstract = true;
189
-        } else if($this->keyword == 'final') {
189
+        } else if ($this->keyword == 'final') {
190 190
             $this->final = true;
191 191
         }
192 192
         
@@ -203,16 +203,16 @@  discard block
 block discarded – undo
203 203
         
204 204
         $tokenName = 'none';
205 205
         
206
-        foreach($parts as $part)
206
+        foreach ($parts as $part)
207 207
         {
208 208
             $part = str_replace(',', '', $part);
209 209
             $part = trim($part);
210
-            if(empty($part)) {
210
+            if (empty($part)) {
211 211
                 continue;
212 212
             }
213 213
             
214 214
             $name = strtolower($part);
215
-            if($name == 'extends' || $name == 'implements') {
215
+            if ($name == 'extends' || $name == 'implements') {
216 216
                 $tokenName = $name;
217 217
                 continue;
218 218
             }
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
         
223 223
         $this->implements = $tokens['implements'];
224 224
         
225
-        if(!empty($this->implements)) {
225
+        if (!empty($this->implements)) {
226 226
             usort($this->implements, function(string $a, string $b) {
227 227
                 return strnatcasecmp($a, $b);
228 228
             });
229 229
         }
230 230
         
231
-        if(!empty($tokens['extends'])) {
231
+        if (!empty($tokens['extends'])) {
232 232
             $this->extends = $tokens['extends'][0];
233 233
         }
234 234
     }
Please login to merge, or discard this patch.
src/NamedClosure.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public static function fromClosure(Closure $closure, $origin) : NamedClosure
106 106
     {
107
-        if(is_object($origin))
107
+        if (is_object($origin))
108 108
         {
109 109
             $description = get_class($origin);
110 110
         }
111
-        else if(is_array($origin))
111
+        else if (is_array($origin))
112 112
         {
113 113
             $description = ConvertHelper::callback2string($origin);
114 114
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      * @param string|object $origin Optional origin. If not specified, the object and method name are used instead.
127 127
      * @return NamedClosure
128 128
      */
129
-    public static function fromObject(object $object, string $method, $origin='') : NamedClosure
129
+    public static function fromObject(object $object, string $method, $origin = '') : NamedClosure
130 130
     {
131 131
         return self::fromArray(array($object, $method), $origin);
132 132
     }
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
      * @param string|object $origin
137 137
      * @return NamedClosure
138 138
      */
139
-    public static function fromArray(array $callback, $origin='') : NamedClosure
139
+    public static function fromArray(array $callback, $origin = '') : NamedClosure
140 140
     {
141
-        if(empty($origin)) {
141
+        if (empty($origin)) {
142 142
             $origin = ConvertHelper::callback2string($callback);
143
-        } else if(is_object($origin)) {
143
+        } else if (is_object($origin)) {
144 144
             $origin = get_class($origin);
145 145
         }
146 146
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,12 +107,10 @@
 block discarded – undo
107 107
         if(is_object($origin))
108 108
         {
109 109
             $description = get_class($origin);
110
-        }
111
-        else if(is_array($origin))
110
+        } else if(is_array($origin))
112 111
         {
113 112
             $description = ConvertHelper::callback2string($origin);
114
-        }
115
-        else
113
+        } else
116 114
         {
117 115
             $description = $origin;
118 116
         }
Please login to merge, or discard this patch.
src/RGBAColor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      * @see RGBAColor::ERROR_INVALID_COLOR_COMPONENT
72 72
      * @see RGBAColor::ERROR_INVALID_PERCENTAGE_VALUE
73 73
      */
74
-    public function __construct(float $red, float $green, float $blue, float $alpha=100)
74
+    public function __construct(float $red, float $green, float $blue, float $alpha = 100)
75 75
     {
76 76
         $this->setColorPercentage(self::COMPONENT_RED, $red);
77 77
         $this->setColorPercentage(self:: COMPONENT_GREEN, $green);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function setTransparency(float $transparency) : RGBAColor
164 164
     {
165
-        return $this->setColorPercentage(self::COMPONENT_ALPHA, 100-$transparency);
165
+        return $this->setColorPercentage(self::COMPONENT_ALPHA, 100 - $transparency);
166 166
     }
167 167
 
168 168
     /**
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     {
283 283
         $this->requireValidComponent($name);
284 284
 
285
-        if($percentage >= 0 && $percentage <= 100)
285
+        if ($percentage >= 0 && $percentage <= 100)
286 286
         {
287 287
             $this->color[$name] = $percentage;
288 288
             return $this;
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     {
313 313
         $this->requireValidComponent($name);
314 314
 
315
-        if($value >= 0 && $value <= 255)
315
+        if ($value >= 0 && $value <= 255)
316 316
         {
317 317
             // Convert the value to a percentage for the internal storage.
318 318
             $percentage = $value * 100 / 255;
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     private function requireValidComponent(string $name) : void
339 339
     {
340
-        if(in_array($name, self::COLOR_COMPONENTS))
340
+        if (in_array($name, self::COLOR_COMPONENTS))
341 341
         {
342 342
             return;
343 343
         }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
     {
400 400
         $key = strval($offset);
401 401
 
402
-        if(isset($this->color[$key]))
402
+        if (isset($this->color[$key]))
403 403
         {
404 404
             return $this->color[$key];
405 405
         }
Please login to merge, or discard this patch.
src/RGBAColor/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public static function getPresetsManager() : RGBAColor_PresetsManager
40 40
     {
41
-        if(!isset(self::$presets))
41
+        if (!isset(self::$presets))
42 42
         {
43 43
             self::$presets = new RGBAColor_PresetsManager();
44 44
         }
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public static function createAuto($subject) : RGBAColor
62 62
     {
63
-        if($subject instanceof RGBAColor)
63
+        if ($subject instanceof RGBAColor)
64 64
         {
65 65
             return $subject;
66 66
         }
67 67
 
68
-        if(is_array($subject))
68
+        if (is_array($subject))
69 69
         {
70
-            if(RGBAColor_Converter::isColorArray($subject))
70
+            if (RGBAColor_Converter::isColorArray($subject))
71 71
             {
72 72
                 return self::createFromColor($subject);
73 73
             }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             return self::createFromIndexedColor($subject);
76 76
         }
77 77
 
78
-        if(is_string($subject))
78
+        if (is_string($subject))
79 79
         {
80 80
             return self::createFromHEX($subject);
81 81
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public static function createFromColor(array $color) : RGBAColor
118 118
     {
119
-        if(!isset($color[RGBAColor::COMPONENT_ALPHA]))
119
+        if (!isset($color[RGBAColor::COMPONENT_ALPHA]))
120 120
         {
121 121
             $color[RGBAColor::COMPONENT_ALPHA] = 255;
122 122
         }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $values = array_values($color);
164 164
         $amountKeys = count($values);
165 165
 
166
-        if($amountKeys === 3)
166
+        if ($amountKeys === 3)
167 167
         {
168 168
             return self::createFromColor(array(
169 169
                 RGBAColor::COMPONENT_RED => $color[0],
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             ));
173 173
         }
174 174
 
175
-        if($amountKeys === 4)
175
+        if ($amountKeys === 4)
176 176
         {
177 177
             return self::createFromColor(array(
178 178
                 RGBAColor::COMPONENT_RED => $color[0],
Please login to merge, or discard this patch.
src/RGBAColor/Comparator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@
 block discarded – undo
39 39
     {
40 40
         $parts = array(RGBAColor::COMPONENT_RED, RGBAColor::COMPONENT_GREEN, RGBAColor::COMPONENT_BLUE);
41 41
 
42
-        foreach($parts as $part)
42
+        foreach ($parts as $part)
43 43
         {
44
-            if($sourceColor->getColorValue($part) !== $targetColor->getColorValue($part))
44
+            if ($sourceColor->getColorValue($part) !== $targetColor->getColorValue($part))
45 45
             {
46 46
                 return false;
47 47
             }
Please login to merge, or discard this patch.
src/RGBAColor/PresetsManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
      */
61 61
     private function init() : void
62 62
     {
63
-        if(self::$initialized === true)
63
+        if (self::$initialized === true)
64 64
         {
65 65
             return;
66 66
         }
67 67
 
68 68
         $this
69 69
             ->registerGlobalPreset(self::COLOR_WHITE, 255, 255, 255, 255)
70
-            ->registerGlobalPreset(self::COLOR_BLACK, 0,0,0, 255)
70
+            ->registerGlobalPreset(self::COLOR_BLACK, 0, 0, 0, 255)
71 71
             ->registerGlobalPreset(self::COLOR_TRANSPARENT, 0, 0, 0, 0);
72 72
     }
73 73
 
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function getPreset(string $name) : array
82 82
     {
83
-        if(isset($this->customPresets[$name]))
83
+        if (isset($this->customPresets[$name]))
84 84
         {
85 85
             return $this->customPresets[$name];
86 86
         }
87 87
 
88
-        if(isset(self::$globalPresets[$name]))
88
+        if (isset(self::$globalPresets[$name]))
89 89
         {
90 90
             return self::$globalPresets[$name];
91 91
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $this->requireNotGlobal($name);
115 115
 
116
-        if(!isset(self::$globalPresets[$name]))
116
+        if (!isset(self::$globalPresets[$name]))
117 117
         {
118 118
             self::$globalPresets[$name] = array(
119 119
                 RGBAColor::COMPONENT_RED => $red,
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         );
136 136
     }
137 137
 
138
-    public function registerPreset(string $name, int $red, int $green, int $blue, int $alpha=255) : RGBAColor_PresetsManager
138
+    public function registerPreset(string $name, int $red, int $green, int $blue, int $alpha = 255) : RGBAColor_PresetsManager
139 139
     {
140 140
         $this->requireNotGlobal($name);
141 141
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     private function requireNotGlobal(string $name) : void
153 153
     {
154
-        if(!isset(self::$globalPresets[$name]))
154
+        if (!isset(self::$globalPresets[$name]))
155 155
         {
156 156
             return;
157 157
         }
Please login to merge, or discard this patch.
src/RGBAColor/Converter.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public static function requireValidColorArray(array $color) : void
50 50
     {
51
-        if(self::isColorArray($color))
51
+        if (self::isColorArray($color))
52 52
         {
53 53
             return;
54 54
         }
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
             RGBAColor::COMPONENT_BLUE
81 81
         );
82 82
 
83
-        foreach($keys as $key)
83
+        foreach ($keys as $key)
84 84
         {
85
-            if(!isset($color[$key]))
85
+            if (!isset($color[$key]))
86 86
             {
87 87
                 return false;
88 88
             }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             self::int2hex($color[RGBAColor::COMPONENT_GREEN]).
105 105
             self::int2hex($color[RGBAColor::COMPONENT_BLUE]);
106 106
 
107
-        if(isset($color[RGBAColor::COMPONENT_ALPHA]) && $color[RGBAColor::COMPONENT_ALPHA] < 255)
107
+        if (isset($color[RGBAColor::COMPONENT_ALPHA]) && $color[RGBAColor::COMPONENT_ALPHA] < 255)
108 108
         {
109 109
             $hex .= self::int2hex($color[RGBAColor::COMPONENT_ALPHA]);
110 110
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     private static function int2hex(int $int) : string
125 125
     {
126 126
         $str = dechex($int);
127
-        if(strlen($str) === 1)
127
+        if (strlen($str) === 1)
128 128
         {
129 129
             $str = $str.$str;
130 130
         }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public static function color2readable(RGBAColor $color) : string
145 145
     {
146
-        if($color->hasTransparency())
146
+        if ($color->hasTransparency())
147 147
         {
148 148
             return sprintf(
149 149
                 'RGBA(%s %s %s %s)',
@@ -207,11 +207,11 @@  discard block
 block discarded – undo
207 207
         $hex = strtoupper($hex);
208 208
         $length = strlen($hex);
209 209
 
210
-        if($length === 3)
210
+        if ($length === 3)
211 211
         {
212 212
             return self::parseHEX3($hex);
213 213
         }
214
-        else if($length === 6)
214
+        else if ($length === 6)
215 215
         {
216 216
             return self::parseHEX6($hex);
217 217
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -210,12 +210,10 @@
 block discarded – undo
210 210
         if($length === 3)
211 211
         {
212 212
             return self::parseHEX3($hex);
213
-        }
214
-        else if($length === 6)
213
+        } else if($length === 6)
215 214
         {
216 215
             return self::parseHEX6($hex);
217
-        }
218
-        else if ($length === 8)
216
+        } else if ($length === 8)
219 217
         {
220 218
             return self::parseHEX8($hex);
221 219
         }
Please login to merge, or discard this patch.
src/OperationResult/Collection.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
  */
27 27
 class OperationResult_Collection extends OperationResult
28 28
 {
29
-   /**
30
-    * @var OperationResult[]
31
-    */
29
+    /**
30
+     * @var OperationResult[]
31
+     */
32 32
     protected $results = array();
33 33
 
34 34
     /**
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
         return $this;
124 124
     }
125 125
     
126
-   /**
127
-    * @return OperationResult[]
128
-    */
126
+    /**
127
+     * @return OperationResult[]
128
+     */
129 129
     public function getResults() : array
130 130
     {
131 131
         return $this->results;
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @param int $code
37 37
      * @return $this
38 38
      */
39
-    public function makeError(string $message, int $code=0) : OperationResult
39
+    public function makeError(string $message, int $code = 0) : OperationResult
40 40
     {
41 41
         return $this->add('makeError', $message, $code);
42 42
     }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param int $code
47 47
      * @return $this
48 48
      */
49
-    public function makeSuccess(string $message, int $code=0) : OperationResult
49
+    public function makeSuccess(string $message, int $code = 0) : OperationResult
50 50
     {
51 51
         return $this->add('makeSuccess', $message, $code);
52 52
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param int $code
57 57
      * @return $this
58 58
      */
59
-    public function makeWarning(string $message, int $code=0) : OperationResult
59
+    public function makeWarning(string $message, int $code = 0) : OperationResult
60 60
     {
61 61
         return $this->add('makeWarning', $message, $code);
62 62
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @param int $code
67 67
      * @return $this
68 68
      */
69
-    public function makeNotice(string $message, int $code=0) : OperationResult
69
+    public function makeNotice(string $message, int $code = 0) : OperationResult
70 70
     {
71 71
         return $this->add('makeNotice', $message, $code);
72 72
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      * @param int $code
78 78
      * @return $this
79 79
      */
80
-    protected function add(string $method, string $message, int $code=0) : OperationResult
80
+    protected function add(string $method, string $message, int $code = 0) : OperationResult
81 81
     {
82 82
         $result = new OperationResult($this->subject);
83 83
         $result->$method($message, $code);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function addResult(OperationResult $result) : OperationResult_Collection
97 97
     {
98
-        if($result instanceof OperationResult_Collection)
98
+        if ($result instanceof OperationResult_Collection)
99 99
         {
100 100
             return $this->importCollection($result);
101 101
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $results = $collection->getResults();
117 117
         
118
-        foreach($results as $result)
118
+        foreach ($results as $result)
119 119
         {
120 120
             $this->addResult($result);
121 121
         }
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
     
134 134
     public function isValid() : bool
135 135
     {
136
-        foreach($this->results as $result)
136
+        foreach ($this->results as $result)
137 137
         {
138
-            if(!$result->isValid())
138
+            if (!$result->isValid())
139 139
             {
140 140
                 return false;
141 141
             }
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
     
147 147
     public function hasCode() : bool
148 148
     {
149
-        foreach($this->results as $result)
149
+        foreach ($this->results as $result)
150 150
         {
151
-            if($result->hasCode())
151
+            if ($result->hasCode())
152 152
             {
153 153
                 return true;
154 154
             }
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
     
160 160
     public function getCode() : int
161 161
     {
162
-        foreach($this->results as $result)
162
+        foreach ($this->results as $result)
163 163
         {
164
-            if($result->hasCode())
164
+            if ($result->hasCode())
165 165
             {
166 166
                 return $result->getCode();
167 167
             }
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
         return 0;
171 171
     }
172 172
     
173
-    public function getMessage(string $type='') : string
173
+    public function getMessage(string $type = '') : string
174 174
     {
175
-        foreach($this->results as $result)
175
+        foreach ($this->results as $result)
176 176
         {
177 177
             $msg = $result->getMessage($type);
178 178
             
179
-            if(!empty($msg))
179
+            if (!empty($msg))
180 180
             {
181 181
                 return $msg;
182 182
             }
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
     
188 188
     public function containsCode(int $code) : bool
189 189
     {
190
-        foreach($this->results as $result)
190
+        foreach ($this->results as $result)
191 191
         {
192
-            if($result->getCode() === $code)
192
+            if ($result->getCode() === $code)
193 193
             {
194 194
                 return true;
195 195
             }
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
     {
223 223
         $amount = 0;
224 224
         
225
-        foreach($this->results as $result)
225
+        foreach ($this->results as $result)
226 226
         {
227
-            if($result->isType($type))
227
+            if ($result->isType($type))
228 228
             {
229 229
                 $amount++;
230 230
             }
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
     {
263 263
         $results = array();
264 264
         
265
-        foreach($this->results as $result)
265
+        foreach ($this->results as $result)
266 266
         {
267
-            if($result->isType($type))
267
+            if ($result->isType($type))
268 268
             {
269 269
                 $results[] = $result;
270 270
             }
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
     
276 276
     public function isType(string $type) : bool
277 277
     {
278
-        foreach($this->results as $result)
278
+        foreach ($this->results as $result)
279 279
         {
280
-            if($result->isType($type))
280
+            if ($result->isType($type))
281 281
             {
282 282
                 return true;
283 283
             }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
         $lines[] = 'Collection #'.$this->getID();
294 294
         $lines[] = 'Subject: '.get_class($this->subject);
295 295
         
296
-        foreach($this->results as $result)
296
+        foreach ($this->results as $result)
297 297
         {
298 298
             $lines[] = ' - '.$result->getType().' #'.$result->getCode().' "'.$result->getMessage($result->getType()).'"';
299 299
         }
Please login to merge, or discard this patch.