Code Duplication    Length = 13-13 lines in 2 locations

src/Flagbit/Plantuml/TokenReflection/MethodWriter.php 1 location

@@ 92-104 (lines=13) @@
89
     * @param \TokenReflection\IReflectionMethod $method
90
     * @return string
91
     */
92
    private function writeReturnType(IReflectionMethod $method)
93
    {
94
        $returnType = '';
95
        preg_match('/\*\h+@return\h+([^\h]+)/', (string) $method->getDocComment(), $matches);
96
        if (isset($matches[1])) {
97
            $returnType = $matches[1];
98
            if ($method->getDeclaringClass()) {
99
                $returnType = $this->expandNamespaceAlias($method->getDeclaringClass(), $returnType);
100
            }
101
            $returnType = ' : ' . $this->formatClassName($returnType);
102
        }
103
        return $returnType;
104
    }
105
}
106

src/Flagbit/Plantuml/TokenReflection/PropertyWriter.php 1 location

@@ 55-67 (lines=13) @@
52
     *
53
     * @return string
54
     */
55
    public function writeType(IReflectionProperty $property)
56
    {
57
        $type = '';
58
        preg_match('/\*\h+@var\h+([^\h]+)/', (string) $property->getDocComment(), $matches);
59
        if (isset($matches[1])) {
60
            $type = $matches[1];
61
            if ($property->getDeclaringClass()) {
62
                $type = $this->expandNamespaceAlias($property->getDeclaringClass(), $type);
63
            }
64
            $type = ' : ' . $this->formatClassName($type);
65
        }
66
        return $type;
67
    }
68
69
    /**
70
     * @param IReflectionProperty $property