Code Duplication    Length = 16-16 lines in 2 locations

src/framework/Database.php 1 location

@@ 41-56 (lines=16) @@
38
     *
39
     * @return Schema
40
     */
41
    public function getSchema($schema)
42
    {
43
        if (! $this->container->has($schema)) {
44
            $this->container->register($schema); // auto-wiring (for Schema with no special constructor dependencies)
45
        }
46
47
        $schema = $this->container->get($schema);
48
49
        if (! $schema instanceof Schema) {
50
            $class_name = get_class($schema);
51
52
            throw new UnexpectedValueException("{$class_name} does not extend the Schema class");
53
        }
54
55
        return $schema;
56
    }
57
    
58
    /**
59
     * @param string $sql

src/framework/DatabaseContainer.php 1 location

@@ 27-42 (lines=16) @@
24
    /**
25
     * @inheritdoc
26
     */
27
    public function getType($type)
28
    {
29
        if (! $this->has($type)) {
30
            $this->register($type); // auto-wiring (for Types with no special constructor dependencies)
31
        }
32
33
        $type = $this->get($type);
34
35
        if (! $type instanceof Type) {
36
            $class_name = get_class($type);
37
38
            throw new UnexpectedValueException("{$class_name} does not implement the Type interface");
39
        }
40
41
        return $type;
42
    }
43
44
    /**
45
     * @inheritdoc