src/Sismo/Storage/PdoStorage.php
public function getCommit(Project $project, $sha)
    {
        $stmt = $this->db->prepare('SELECT slug, sha, author, date, build_date, message, status, output FROM `commit` WHERE slug = :slug AND sha = :sha');
        $stmt->bindValue(':slug', $project->getSlug(), \PDO::PARAM_STR);
        $stmt->bindValue(':sha', $sha, \PDO::PARAM_STR);

        if ($stmt->execute()) {
            if (false !== $result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
                return $this->createCommit($project, $result);
            }
        } else {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException(sprintf('Unable to retrieve commit "%s" from project "%s".', $sha, $project), 1);
            // @codeCoverageIgnoreEnd
        }

        return false;
    }
public function getCommit(Project $project, $sha)
    {
        $stmt = $this->db->prepare('SELECT slug, sha, author, date, build_date, message, status, output FROM `commit` WHERE slug = :slug AND sha = :sha');
        $stmt->bindValue(':slug', $project->getSlug(), \PDO::PARAM_STR);
        $stmt->bindValue(':sha', $sha, \PDO::PARAM_STR);

        if ($stmt->execute()) {
            if (false !== $result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
                return $this->createCommit($project, $result);
            }
        } else {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException(sprintf('Unable to retrieve commit "%s" from project "%s".', $sha, $project), 1);
            // @codeCoverageIgnoreEnd
        }

        return false;
    }
public function getCommit ( Project $ project , $ sha ) { $ stmt = $ this -> db -> prepare ( 'SELECT slug, sha, author, date, build_date, message, status, output FROM `commit` WHERE slug = :slug AND sha = :sha' ) ; $ stmt -> bindValue ( ':slug' , $ project -> getSlug ( ) , \ PDO :: PARAM_STR ) ; $ stmt -> bindValue ( ':sha' , $ sha , \ PDO :: PARAM_STR ) ; if ( $ stmt -> execute ( ) ) { if ( false !== $ result = $ stmt -> fetch ( \ PDO :: FETCH_ASSOC ) ) { return $ this -> createCommit ( $ project , $ result ) ; } } else { // @codeCoverageIgnoreStart throw new \ RuntimeException ( sprintf ( 'Unable to retrieve commit "%s" from project "%s".' , $ sha , $ project ) , 1 ) ; // @codeCoverageIgnoreEnd } return false ; }
Retrieves a commit out of a project.

@param Project $project The project this commit is part of.
@param string  $sha     The hash of the commit to retrieve.

@return Commit
Retrieves a commit out of a project .