Code Duplication    Length = 7-7 lines in 2 locations

src/delivery/web/fields/ObjectField.php 1 location

@@ 129-135 (lines=7) @@
126
        return $this->fields->getField($param);
127
    }
128
129
    private function getClass(Parameter $parameter) {
130
        $type = $parameter->getType();
131
        if (!($type instanceof ClassType)) {
132
            throw new \InvalidArgumentException("[$type] is not a ClassType");
133
        }
134
        return $type->getClass();
135
    }
136
137
    private function makePropertyParameter(Parameter $parameter, Property $property) {
138
        return new Parameter($parameter->getName() . '[' . $property->name() . ']', $property->type(), $property->isRequired());

src/delivery/cli/fields/ObjectField.php 1 location

@@ 68-74 (lines=7) @@
65
        return $instance;
66
    }
67
68
    private function getClass(Parameter $parameter) {
69
        $type = $parameter->getType();
70
        if (!($type instanceof ClassType)) {
71
            throw new \InvalidArgumentException("[$type] is not a ClassType");
72
        }
73
        return $type->getClass();
74
    }
75
76
    /**
77
     * @param Parameter $param