Code Duplication    Length = 12-12 lines in 2 locations

Classes/Service/DataService.php 2 locations

@@ 48-59 (lines=12) @@
45
     * @param array $demand
46
     * @return array
47
     */
48
    public function getRecords(string $tableName, array $demand = []): array
49
    {
50
        /** @var QueryBuilder $queryBuilder */
51
        $queryBuilder = $this->getQueryBuilder($tableName);
52
        $queryBuilder
53
            ->select('*')
54
            ->from($tableName);
55
56
        $this->addDemandConstraints($demand, $queryBuilder);
57
58
        return $queryBuilder->execute()->fetchAll();
59
    }
60
61
    /**
62
     * @param string $tableName
@@ 66-77 (lines=12) @@
63
     * @param array $demand
64
     * @return int
65
     */
66
    public function count(string $tableName, array $demand = []): int
67
    {
68
        /** @var QueryBuilder $queryBuilder */
69
        $queryBuilder = $this->getQueryBuilder($tableName);
70
        $queryBuilder
71
            ->count('*')
72
            ->from($tableName);
73
74
        $this->addDemandConstraints($demand, $queryBuilder);
75
76
        return (int)$queryBuilder->execute()->fetchColumn(0);
77
    }
78
79
    /**
80
     * @param string $tableName