Code Duplication    Length = 12-12 lines in 2 locations

Classes/Service/DataService.php 2 locations

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