DispatchController::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 1
nop 1
1
<?php
2
3
namespace Cowglow\InstagramGallery\Infrastructure;
4
5
6
class DispatchController
7
{
8
    protected static $dataType = '';
9
10
    public function __construct($dataType)
11
    {
12
        try {
13
            self::$dataType = $dataType;
14
        } catch (\RuntimeException $exception) {
0 ignored issues
show
Unused Code introduced by
catch (\RuntimeException $exception) is not reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
15
            throw new \RuntimeException($exception->getMessage());
16
        }
17
    }
18
19
    public function Initialize(): array
20
    {
21
        echo 'working';
22
        return ['working on it' => 'building Dispatcher'];
23
    }
24
}
25
26
//    public function __construct($params)
27
//    {
28
//        $rootDirectory = dirname(dirname(dirname(__DIR__))).DIRECTORY_SEPARATOR;
29
//        include_once $rootDirectory.'assets'.DIRECTORY_SEPARATOR.'partials'.DIRECTORY_SEPARATOR.'header.php';
30
//        include_once $rootDirectory.'assets'.DIRECTORY_SEPARATOR.'partials'.DIRECTORY_SEPARATOR.'footer.php';
31
//        $grams = array_reverse($params);
32
//
33
//        $counter = 0;
34
//        while ($counter < count($grams)) {
35
//            if ($counter % 3 === 0) {
36
//                echo '<div class="row">';
37
//            }
38
//            $gram = $grams[$counter];
39
//            <div class="col-lg-4">
40
//                <blockquote
41
//                        class="instagram-media"
42
//                        data-instgrm-version="7"
43
//                        style="
44
//						background:#FFF;
45
//						border:0;
46
//						border-radius:3px;
47
//						box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15);
48
//						margin: 1px;
49
//						max-width:658px;
50
//						padding:0;
51
//						width:99.375%;
52
//						width:-webkit-calc(100% - 2px);
53
//						width:calc(100% - 2px);">
54
//                    <div style="padding:8px;">
55
//                        <div style="
56
//							background:#F8F8F8;
57
//							line-height:0;
58
//							margin-top:40px;
59
//							padding:28.194444444444443% 0;
60
//							text-align:center;
61
//							width:100%;">
62
//                            <div style="
63
//								background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAMUExURczMzPf399fX1+bm5mzY9AMAAADiSURBVDjLvZXbEsMgCES5/P8/t9FuRVCRmU73JWlzosgSIIZURCjo/ad+EQJJB4Hv8BFt+IDpQoCx1wjOSBFhh2XssxEIYn3ulI/6MNReE07UIWJEv8UEOWDS88LY97kqyTliJKKtuYBbruAyVh5wOHiXmpi5we58Ek028czwyuQdLKPG1Bkb4NnM+VeAnfHqn1k4+GPT6uGQcvu2h2OVuIf/gWUFyy8OWEpdyZSa3aVCqpVoVvzZZ2VTnn2wU8qzVjDDetO90GSy9mVLqtgYSy231MxrY6I2gGqjrTY0L8fxCxfCBbhWrsYYAAAAAElFTkSuQmCC);
64
//								display:block;
65
//								height:44px;
66
//								margin:0 auto -44px;
67
//								position:relative;
68
//								top:-22px;
69
//								width:44px;">
70
//                            </div>
71
//                        </div>
72
//                        <p style="
73
//							color:#c9c8cd;
74
//							font-family:Arial,sans-serif;
75
//							font-size:14px;
76
//							line-height:17px;
77
//							margin-bottom:0;
78
//							margin-top:8px;
79
//							overflow:hidden;
80
//							padding:8px 0 7px;
81
//							text-align:center;
82
//							text-overflow:ellipsis;
83
//							white-space:nowrap;">
84
//                            <a href="https://www.instagram.com/p/--><?php //echo $gram;
85
?><!--"
86
//                               style="color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;"
87
//                               target="_blank">Loading...</a>
88
//                        </p>
89
//                    </div>
90
//                </blockquote>
91
//            </div>
92
//
93
//            $counter++;
94
//            if ($counter % 3 === 0) {
95
//                echo '</div>';
96
//            }
97
//        }
98
//    }
99