Code Duplication    Length = 14-15 lines in 2 locations

src/Comment/Post.php 1 location

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

src/Tag/Tag.php 1 location

@@ 19-32 (lines=14) @@
16
{
17
    use InjectionAwareTrait;
18
19
    public function returnAllSpecificTag($tag)
20
    {
21
        $sql = "Call VPost(false, 1, 'true', ? , null)";
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()