Code Duplication    Length = 16-17 lines in 4 locations

src/Domain/Blog/Introduction/MysqlIntroductionRepository.php 1 location

@@ 27-43 (lines=17) @@
24
     *
25
     * @return array|false
26
     */
27
    public function findByType($type, $value = '')
28
    {
29
        $query = "
30
            SELECT `title`, `content`, `image`
31
            FROM `jpemeric_blog`.`introduction`
32
            WHERE `type` = :type AND `value` = :value
33
            LIMIT 1";
34
        $bindings = [
35
            'type'  => $type,
36
            'value' => $value,
37
        ];
38
39
        return $this
40
            ->connections
41
            ->getRead()
42
            ->fetchOne($query, $bindings);
43
    }
44
}
45

src/Domain/Blog/Tag/MysqlTagRepository.php 1 location

@@ 26-41 (lines=16) @@
23
     *
24
     * @return array|false
25
     */
26
    public function findTagByTitle($title)
27
    {
28
        $query = "
29
            SELECT *
30
            FROM `jpemeric_blog`.`tag`
31
            WHERE `tag` = :title
32
            LIMIT 1";
33
        $bindings = [
34
            'title' => $title,
35
        ];
36
37
        return $this
38
            ->connections
39
            ->getRead()
40
            ->fetchOne($query, $bindings);
41
    }
42
43
    public function getAllTags()
44
    {

src/Domain/Stream/Activity/MysqlActivityRepository.php 1 location

@@ 26-41 (lines=16) @@
23
     *
24
     * @return array|false
25
     */
26
    public function getActivityById($id)
27
    {
28
        $query = "
29
            SELECT *
30
            FROM `jpemeric_stream`.`activity`
31
            WHERE `id` = :id
32
            LIMIT 1";
33
        $bindings = [
34
            'id' => $id,
35
        ];
36
37
        return $this
38
            ->connections
39
            ->getRead()
40
            ->fetchOne($query, $bindings);
41
    }
42
43
    /**
44
     * @param integer $limit

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

@@ 50-66 (lines=17) @@
47
     *
48
     * @return array|false
49
     */
50
    public function getChangeByHash($hash)
51
    {
52
        $query = "
53
            SELECT *
54
            FROM `jpemeric_stream`.`changelog`
55
            WHERE `hash` = :hash
56
            LIMIT 1";
57
58
        $bindings = [
59
            'hash' => $hash,
60
        ];
61
62
        return $this
63
            ->connections
64
            ->getRead()
65
            ->fetchOne($query, $bindings);
66
    }
67
68
    /**
69
     * @param string   $hash