Code Duplication    Length = 12-12 lines in 3 locations

config/di.php 1 location

@@ 23-34 (lines=12) @@
20
        ],
21
        "url" => [
22
            "shared" => true,
23
            "callback" => function () {
24
                $url = new \Anax\Url\Url();
25
                $request = $this->get("request");
26
                $url->setSiteUrl($request->getSiteUrl());
27
                $url->setBaseUrl($request->getBaseUrl());
28
                $url->setStaticSiteUrl($request->getSiteUrl());
29
                $url->setStaticBaseUrl($request->getBaseUrl());
30
                $url->setScriptName($request->getScriptName());
31
                $url->configure("url.php");
32
                $url->setDefaultsFromConfiguration();
33
                return $url;
34
            }
35
        ],
36
        "router" => [
37
            "shared" => true,

config/di_anax-site-develop.php 1 location

@@ 28-39 (lines=12) @@
25
        ],
26
        "url" => [
27
            "shared" => true,
28
            "callback" => function () {
29
                $obj = new \Anax\Url\Url();
30
                $request = $this->get("request");
31
                $obj->setSiteUrl($request->getSiteUrl());
32
                $obj->setBaseUrl($request->getBaseUrl());
33
                $obj->setStaticSiteUrl($request->getSiteUrl());
34
                $obj->setStaticBaseUrl($request->getBaseUrl());
35
                $obj->setScriptName($request->getScriptName());
36
                $obj->configure("url.php");
37
                $obj->setDefaultsFromConfiguration();
38
                return $obj;
39
            }
40
        ],
41
        "router" => [
42
            "shared" => true,

src/DI/DIServiceSetBaseTrait.php 1 location

@@ 25-36 (lines=12) @@
22
23
        $this->setShared("response", "\Anax\Response\Response");
24
25
        $this->setShared("url", function () {
26
            $url = new \Anax\Url\Url();
27
            $request = $this->get("request");
28
            $url->setSiteUrl($request->getSiteUrl());
29
            $url->setBaseUrl($request->getBaseUrl());
30
            $url->setStaticSiteUrl($request->getSiteUrl());
31
            $url->setStaticBaseUrl($request->getBaseUrl());
32
            $url->setScriptName($request->getScriptName());
33
            $url->configure("url.php");
34
            $url->setDefaultsFromConfiguration();
35
            return $url;
36
        });
37
38
        $this->setShared("router", function () {
39
            $router = new \Anax\Route\Router();