TagController::getSpecificTag()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 19
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 19
loc 19
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 12
nc 1
nop 1
1
<?php
2
3
namespace Radchasay\Tag;
4
5
use \Anax\Configure\ConfigureInterface;
6
use \Anax\Configure\ConfigureTrait;
7
use \Anax\DI\InjectionAwareInterface;
8
use \Anax\Di\InjectionAwareTrait;
9
use \Radchasay\Tag\Tag;
10
11
/**
12
 * A controller class.
13
 */
14
class TagController implements
15
    ConfigureInterface,
16
    InjectionAwareInterface
17
{
18
    use ConfigureTrait,
19
        InjectionAwareTrait;
20
21
22
    /**
23
     * @var $data description
24
     */
25
    //private $data;
26
27 View Code Duplication
    public function getSpecificTag($tag)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
    {
29
        $title = "Specific Tag";
30
        $view = $this->di->get("view");
31
        $pageRender = $this->di->get("pageRender");
32
        $db = $this->di->get("db");
33
34
        $tags = new Tag();
35
        $tags->setDb($db);
36
        $res = $tags->returnAllSpecificTag([$tag]);
37
38
        $data = [
39
            "content" => $res,
40
        ];
41
42
        $view->add("tag/oneTag", $data);
43
44
        $pageRender->renderPage(["title" => $title]);
45
    }
46
47 View Code Duplication
    public function getAllTags()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
48
    {
49
        $title = "All Tags";
50
        $view = $this->di->get("view");
51
        $pageRender = $this->di->get("pageRender");
52
        $db = $this->di->get("db");
53
54
        $tags = new Tag();
55
        $tags->setDb($db);
56
        $res = $tags->returnAllTags();
57
58
        $data = [
59
            "tags" => $res,
60
        ];
61
62
        $view->add("tag/viewAllTags", $data);
63
64
        $pageRender->renderPage(["title" => $title]);
65
    }
66
}
67