Code Duplication    Length = 14-14 lines in 2 locations

src/Comment/Post.php 1 location

@@ 64-77 (lines=14) @@
61
        return $res;
62
    }
63
64
    public function getAllPosts()
65
    {
66
        $sql = "SELECT * FROM VPost";
67
        $res = $this->findAllSql($sql);
68
        $id = [];
69
        $newRes = [];
70
        foreach ($res as $r) {
71
            if (!in_array($r->postid, $id)) {
72
                array_push($id, $r->postid);
73
                array_push($newRes, $r);
74
            }
75
        }
76
        return $newRes;
77
    }
78
79
    public function getNext()
80
    {

src/Tag/Tag.php 1 location

@@ 19-32 (lines=14) @@
16
{
17
    use InjectionAwareTrait;
18
19
    public function returnAllSpecificTag($tag)
20
    {
21
        $sql = "SELECT * FROM VPost WHERE Category = ?";
22
        $res = $this->findAllSql($sql, $tag);
23
        $id = [];
24
        $newRes = [];
25
        foreach ($res as $r) {
26
            if (!in_array($r->postid, $id)) {
27
                array_push($id, $r->postid);
28
                array_push($newRes, $r);
29
            }
30
        }
31
        return $newRes;
32
    }
33
34
35
    public function returnAllTags()