for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TonicHealthCheck\Check\DB;
use PDO;
/**
* Class PDOFactory.
*/
class PDOFactory implements PDOFactoryInterface
{
* @var string
protected $dsn;
protected $user;
protected $password;
* PDOFactoryInterface constructor.
*
* @param string $dsn
* @param string $user
* @param string $password
public function __construct($dsn, $user, $password)
$this->setDsn($dsn);
$this->setUser($user);
$this->setPassword($password);
}
* @return PDO
public function createPDO()
return new PDO($this->getDsn(), $this->getUser(), $this->getPassword());
* @return string
public function getDsn()
return $this->dsn;
public function getUser()
return $this->user;
public function getPassword()
return $this->password;
protected function setDsn($dsn)
$this->dsn = $dsn;
protected function setUser($user)
$this->user = $user;
protected function setPassword($password)
$this->password = $password;