Code Duplication    Length = 18-18 lines in 2 locations

src/Annotation/Body.php 1 location

@@ 97-114 (lines=18) @@
94
        $options->setBodyOptional($this->resolveIfBodyIsOptional($reflectionMethod));
95
    }
96
97
    private function resolveDenormalizationType(ReflectionMethodWrapper $reflectionMethod): string
98
    {
99
        if ($this->denormalizationType !== null) {
100
            return $this->denormalizationType;
101
        }
102
103
        try {
104
            $typeName = $reflectionMethod->getNonBuiltInTypeForParameter($this->parameterName);
105
        } catch (ConfigurationException $exception) {
106
            throw new ConfigurationException(sprintf(
107
                'Denormalization type could not be guessed for %s in %s',
108
                '$' . $this->parameterName,
109
                $reflectionMethod->getFriendlyName()
110
            ));
111
        }
112
113
        return $typeName;
114
    }
115
116
    private function resolveIfBodyIsOptional(ReflectionMethodWrapper $reflectionMethod): bool
117
    {

src/Annotation/Query.php 1 location

@@ 103-120 (lines=18) @@
100
        $options->addQueryResolverOptions($resolverOptions);
101
    }
102
103
    private function resolveDenormalizationType(ReflectionMethodWrapper $reflectionMethod): string
104
    {
105
        if ($this->denormalizationType !== null) {
106
            return $this->denormalizationType;
107
        }
108
109
        try {
110
            $typeName = $reflectionMethod->getNonBuiltInTypeForParameter($this->parameterName);
111
        } catch (ConfigurationException $exception) {
112
            throw new ConfigurationException(sprintf(
113
                'Denormalization type could not be guessed for %s in %s',
114
                '$' . $this->parameterName,
115
                $reflectionMethod->getFriendlyName()
116
            ));
117
        }
118
119
        return $typeName;
120
    }
121
122
    private function setValidationOptions(ReflectionMethodWrapper $reflectionMethod, QueryResolverOptions $options)
123
    {