Code Duplication    Length = 13-14 lines in 2 locations

src/Rocket/ORM/Generator/Schema/Column.php 1 location

@@ 120-132 (lines=13) @@
117
    /**
118
     * @return string
119
     */
120
    public function getTypeConstantName()
121
    {
122
        $reflection = new \ReflectionClass('\\Rocket\\ORM\\Model\\Map\\TableMap');
123
        foreach ($reflection->getConstants() as $name => $value) {
124
            if ($this->type == $value) {
125
                return $name;
126
            }
127
        }
128
129
        throw new \LogicException(
130
            'Unknown value "' . $this->type . '" for constant TableMap::COLUMN_TYPE_* for column "' . $this->name . '"'
131
        );
132
    }
133
134
    /**
135
     * @param bool $raw

src/Rocket/ORM/Generator/Schema/Relation.php 1 location

@@ 125-138 (lines=14) @@
122
     *
123
     * @codeCoverageIgnore LogicException cannot be reached by a test
124
     */
125
    public function getTypeConstantName()
126
    {
127
        $reflection = new \ReflectionClass('\\Rocket\\ORM\\Model\\Map\\TableMap');
128
        foreach ($reflection->getConstants() as $name => $value) {
129
            if ($this->type == $value) {
130
                return $name;
131
            }
132
        }
133
134
        throw new \LogicException(
135
            'Unknown value "' . $this->type . '" for constant TableMap::RELATION_TYPE_* '
136
            . 'for relation "' . $this->phpName . '"'
137
        );
138
    }
139
140
    /**
141
     * @return Table