Code Duplication    Length = 16-16 lines in 3 locations

src/Domain/Stream/Changelog/MysqlChangelogRepository.php 1 location

@@ 28-43 (lines=16) @@
25
     *
26
     * @return array|false
27
     */
28
    public function getChanges($limit = null, $offset = 0)
29
    {
30
        $query = "
31
            SELECT `message`, `message_short`, `datetime`, `commit_link`
32
            FROM `jpemeric_stream`.`changelog`
33
            ORDER BY `datetime` DESC";
34
        if (!is_null($limit)) {
35
          $query .= "
36
          LIMIT {$offset}, {$limit}";
37
        }
38
39
        return $this
40
            ->connections
41
            ->getRead()
42
            ->fetchAll($query);
43
    }
44
45
    /**
46
     * @param string $hash

src/Domain/Stream/Post/MysqlPostRepository.php 1 location

@@ 73-88 (lines=16) @@
70
     *
71
     * @return array|false
72
     */
73
    public function getPosts($limit = null, $offset = 0)
74
    {
75
        $query = "
76
            SELECT *
77
            FROM `jpemeric_stream`.`post`
78
            ORDER BY `date` DESC";
79
        if (!is_null($limit)) {
80
            $query .= "
81
            LIMIT {$offset}, {$limit}";
82
        }
83
84
        return $this
85
            ->connections
86
            ->getRead()
87
            ->fetchAll($query);
88
    }
89
90
    public function getPostsCount()
91
    {

src/Domain/Stream/Github/MysqlGithubRepository.php 1 location

@@ 28-43 (lines=16) @@
25
     *
26
     * @return array|false
27
     */
28
    public function getEvents($limit = null, $offset = 0)
29
    {
30
        $query = "
31
            SELECT `id`, `event_id`, `datetime`
32
            FROM `jpemeric_stream`.`github`
33
            ORDER BY `datetime` DESC";
34
        if (!is_null($limit)) {
35
          $query .= "
36
          LIMIT {$offset}, {$limit}";
37
        }
38
39
        return $this
40
            ->connections
41
            ->getRead()
42
            ->fetchAll($query);
43
    }
44
45
    /**
46
     * @param integer $eventId