Completed
Push — feature/implement-state-handli... ( bd5ae0 )
by Michiel
01:52
created

Connection::prepare()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Surfnet\StepupGateway\Behat\Repository;
4
5
use PDO;
6
use PDOStatement;
7
8
class Connection
9
{
10
    /**
11
     * @var PDO
12
     */
13
    private $connection;
14
15
    public function __construct($dbUser, $dbPassword, $dbName, $hostName)
16
    {
17
        $dsn = 'mysql:host=%s;dbname=%s';
18
        // Open a PDO connection
19
        $this->connection = new PDO(sprintf($dsn, $hostName, $dbName), $dbUser, $dbPassword);
20
    }
21
22
    /**
23
     * @return bool|PDOStatement
24
     */
25
    public function prepare($statement)
26
    {
27
        return $this->connection->prepare($statement);
28
    }
29
}
30