Code Duplication    Length = 29-29 lines in 2 locations

src/Definition/InputUnionDefinition.php 1 location

@@ 23-51 (lines=29) @@
20
/**
21
 * Class InputUnionDefinition
22
 */
23
class InputUnionDefinition extends AbstractTypeDefinition implements InputUnionDefinitionInterface
24
{
25
    use HasDefinitions {
26
        withDefinition as private __withDefinition;
27
    }
28
29
    /**
30
     * @return TypeInterface
31
     * @throws \Railt\Io\Exception\ExternalFileException
32
     */
33
    public static function getType(): TypeInterface
34
    {
35
        return Type::of(Type::INPUT_UNION);
36
    }
37
38
    /**
39
     * @param string|TypeDefinition $type
40
     * @return ProvidesTypeDefinitions
41
     * @throws \Railt\Io\Exception\ExternalFileException
42
     */
43
    public function withDefinition($type): ProvidesTypeDefinitions
44
    {
45
        $instance = $this->fetch($type);
46
47
        $this->verifyInputType($instance);
48
49
        return $this->__withDefinition($instance);
50
    }
51
}
52

src/Definition/UnionDefinition.php 1 location

@@ 23-51 (lines=29) @@
20
/**
21
 * Class UnionDefinition
22
 */
23
class UnionDefinition extends AbstractTypeDefinition implements InputUnionDefinitionInterface
24
{
25
    use HasDefinitions {
26
        withDefinition as private __withDefinition;
27
    }
28
29
    /**
30
     * @return TypeInterface
31
     * @throws \Railt\Io\Exception\ExternalFileException
32
     */
33
    public static function getType(): TypeInterface
34
    {
35
        return Type::of(Type::UNION);
36
    }
37
38
    /**
39
     * @param string|TypeDefinition $type
40
     * @return ProvidesTypeDefinitions
41
     * @throws \Railt\Io\Exception\ExternalFileException
42
     */
43
    public function withDefinition($type): ProvidesTypeDefinitions
44
    {
45
        $instance = $this->fetch($type);
46
47
        $this->verifyOutputType($instance);
48
49
        return $this->__withDefinition($instance);
50
    }
51
}
52