|
| 1 | +<?php |
| 2 | + |
| 3 | +/* testStartPoint */ |
| 4 | +/* condition 0: namespace */ |
| 5 | +namespace Conditions\HorribleCode { |
| 6 | + |
| 7 | + /* condition 1: if */ |
| 8 | + if (!function_exists('letsGetSerious') ) { |
| 9 | + |
| 10 | + /* condition 2: function */ |
| 11 | + function letsGetSerious() { |
| 12 | + |
| 13 | + /* condition 3-1: if */ |
| 14 | + if (isset($loadthis)) { |
| 15 | + doing_something(); |
| 16 | + /* condition 3-2: else */ |
| 17 | + } else { |
| 18 | + |
| 19 | + /* condition 4: if */ |
| 20 | + if (!class_exists('SeriouslyNestedClass')) { |
| 21 | + |
| 22 | + /* condition 5: nested class */ |
| 23 | + class SeriouslyNestedClass extends SomeOtherClass { |
| 24 | + |
| 25 | + /* condition 6: class method */ |
| 26 | + public function SeriouslyNestedMethod(/* testSeriouslyNestedMethod */ $param) { |
| 27 | + |
| 28 | + /* condition 7: switch */ |
| 29 | + switch ($param) { |
| 30 | + |
| 31 | + /* condition 8a: case */ |
| 32 | + case 'testing': |
| 33 | + |
| 34 | + /* condition 9: while */ |
| 35 | + while ($a < 10 ) { |
| 36 | + |
| 37 | + /* condition 10-1: if */ |
| 38 | + if ($a === $b) { |
| 39 | + |
| 40 | + /* condition 11-1: nested anonymous class */ |
| 41 | + return new class() { |
| 42 | + |
| 43 | + /* condition 12: nested anonymous class method */ |
| 44 | + private function DidSomeoneSayNesting() { |
| 45 | + |
| 46 | + /* condition 13: closure */ |
| 47 | + $c = function() { |
| 48 | + /* testDeepestNested */ |
| 49 | + return 'closure'; |
| 50 | + }; |
| 51 | + } |
| 52 | + }; |
| 53 | + /* condition 10-2: elseif */ |
| 54 | + } elseif($bool) { |
| 55 | + echo 'hello world'; |
| 56 | + } |
| 57 | + |
| 58 | + /* condition 10-3: foreach */ |
| 59 | + foreach ($array as $k => $v) { |
| 60 | + |
| 61 | + /* condition 11-2: try */ |
| 62 | + try { |
| 63 | + --$k; |
| 64 | + |
| 65 | + /* condition 11-3: catch */ |
| 66 | + } catch (Exception $e) { |
| 67 | + /* testInException */ |
| 68 | + echo 'oh darn'; |
| 69 | + /* condition 11-4: finally */ |
| 70 | + } finally { |
| 71 | + return true; |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | + $a++; |
| 76 | + } |
| 77 | + break; |
| 78 | + |
| 79 | + /* condition 8b: default */ |
| 80 | + default: |
| 81 | + /* testInDefault */ |
| 82 | + $return = 'nada'; |
| 83 | + return $return; |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + } |
| 91 | +} |
0 commit comments