Code Duplication    Length = 9-9 lines in 2 locations

src/Attachments/AttachmentsRepository.php 1 location

@@ 15-23 (lines=9) @@
12
{
13
    public function __construct(PDO $connection)
14
    {
15
        switch ($connection->getAttribute(PDO::ATTR_DRIVER_NAME)) {
16
            case 'mysql':
17
                $this->driver = new MySQL($connection);
18
                break;
19
            default:
20
                throw new \Exception(
21
                    'Driver ' . $connection->getAttribute(PDO::ATTR_DRIVER_NAME) . ' not yet implemented'
22
                );
23
        }
24
25
        if (!$this->driver->checkTable('emails')) {
26
            $this->driver->createEmailsTable();

src/Emails/EmailsRepository.php 1 location

@@ 20-28 (lines=9) @@
17
    {
18
        $this->connection = $connection;
19
20
        switch ($connection->getAttribute(PDO::ATTR_DRIVER_NAME)) {
21
            case 'mysql':
22
                $this->driver = new MySQL($connection);
23
                break;
24
            default:
25
                throw new \Exception(
26
                    'Driver ' . $connection->getAttribute(PDO::ATTR_DRIVER_NAME) . ' not yet implemented'
27
                );
28
        }
29
30
        if (!$this->driver->checkTable('emails')) {
31
            $this->driver->createEmailsTable();