Code Duplication    Length = 5-7 lines in 2 locations

src/Prophecy/Doubler/Generator/ClassCodeGenerator.php 2 locations

@@ 85-91 (lines=7) @@
82
     */
83
    private function getReturnType(Node\MethodNode $method)
84
    {
85
        if (version_compare(PHP_VERSION, '7.1', '>=')) {
86
            if ($method->hasReturnType()) {
87
                return $method->hasNullableReturnType()
88
                    ? sprintf(': ?%s', $method->getReturnType())
89
                    : sprintf(': %s', $method->getReturnType());
90
            }
91
        }
92
93
        if (version_compare(PHP_VERSION, '7.0', '>=')) {
94
            return $method->hasReturnType() && $method->getReturnType() !== 'void'
@@ 93-97 (lines=5) @@
90
            }
91
        }
92
93
        if (version_compare(PHP_VERSION, '7.0', '>=')) {
94
            return $method->hasReturnType() && $method->getReturnType() !== 'void'
95
                ? sprintf(': %s', $method->getReturnType())
96
                : '';
97
        }
98
99
        return '';
100
    }