Code Duplication    Length = 10-10 lines in 2 locations

src/Entity/CredentialRepository.php 1 location

@@ 33-42 (lines=10) @@
30
     *
31
     * @return Credential
32
     */
33
    public function find($id)
34
    {
35
        $sql = 'SELECT * FROM credential WHERE idCred= :idCred';
36
        $row = $this->db->prepare($sql);
37
        $row->bindValue(':idCred', $id, SQLITE3_TEXT);
38
        $row->execute();
39
        $row = $this->db->fetchAssoc($sql, array($id));
40
41
        return $this->buildDomainObject($row);
42
    }
43
44
    /**
45
     * Save credential into db

src/Entity/ProjectRepository.php 1 location

@@ 31-40 (lines=10) @@
28
     *
29
     * @return Project
30
     */
31
    public function find($id)
32
    {
33
        $sql = 'SELECT p.*,c.idCred FROM project AS p, credential AS c WHERE p.id= :id';
34
        $row = $this->db->prepare($sql);
35
        $row->bindValue(':id', $id, SQLITE3_TEXT);
36
        $row->execute();
37
        $row = $this->db->fetchAssoc($sql, array($id));
38
39
        return $this->buildDomainObject($row);
40
    }
41
42
    /**
43
     * @param Project $project