Completed
Push — master ( 12e90d...d3ba5d )
by Freek
06:17
created

TableDropperFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 2
1
<?php
2
3
namespace Spatie\MigrateFresh;
4
5
use Spatie\MigrateFresh\TableDroppers\TableDropper;
6
7
class TableDropperFactory
8
{
9
    public static function create($driverName): TableDropper
10
    {
11
        $dropperClass = '\\Spatie\\MigrateFresh\\TableDroppers\\'.ucfirst($driverName);
12
13
        if (! class_exists($dropperClass)) {
14
            throw CannotDropTables::unsupportedDbDriver($driverName);
15
        }
16
17
        return new $dropperClass;
18
    }
19
}