Code Duplication    Length = 11-11 lines in 2 locations

auth/Rbac.php 1 location

@@ 150-160 (lines=11) @@
147
     * @return mixed
148
     * @throws \Micro\Base\Exception
149
     */
150
    public function assigned($userId)
151
    {
152
        $query = new Query($this->container->db);
153
        $query->distinct = true;
154
        $query->select = '`role` AS `name`';
155
        $query->table = '`rbac_user`';
156
        $query->addWhere('`user`='.$userId);
157
        $query->single = false;
158
159
        return $query->run(\PDO::FETCH_ASSOC);
160
    }
161
162
    /**
163
     * Recursive search in roles array

cache/driver/DbDriver.php 1 location

@@ 87-97 (lines=11) @@
84
     * @inheritdoc
85
     * @throws \Micro\Base\Exception
86
     */
87
    protected function getElement($name)
88
    {
89
        $query = new Query($this->driver);
90
        $query->table = $this->table;
91
        $query->addWhere('`name`=:name');
92
        $query->params = ['name' => $name];
93
        $query->limit = 1;
94
        $query->single = true;
95
96
        return $query->run(\PDO::FETCH_ASSOC);
97
    }
98
99
    /**
100
     * @inheritdoc