Code Duplication    Length = 19-19 lines in 2 locations

src/Graviton/DocumentBundle/DependencyInjection/Compiler/ExtRefFieldsCompilerPass.php 1 location

@@ 83-101 (lines=19) @@
80
     * @param string     $doc     Document name
81
     * @return string
82
     */
83
    private function getServiceDocument(Definition $service, $ns, $bundle, $doc)
84
    {
85
        $tags = $service->getTag('graviton.rest');
86
        if (!empty($tags[0]['collection'])) {
87
            $doc = $tags[0]['collection'];
88
            $bundle = $tags[0]['collection'];
89
        }
90
91
        if (strtolower($ns) === 'gravitondyn') {
92
            $ns = 'GravitonDyn';
93
        }
94
95
        return sprintf(
96
            '%s\\%s\\Document\\%s',
97
            ucfirst($ns),
98
            ucfirst($bundle).'Bundle',
99
            ucfirst($doc)
100
        );
101
    }
102
103
    /**
104
     * Recursive doctrine document processing

src/Graviton/DocumentBundle/DependencyInjection/Compiler/RqlFieldsCompilerPass.php 1 location

@@ 69-87 (lines=19) @@
66
     * @param string     $doc     Document name
67
     * @return string
68
     */
69
    private function getServiceDocument(Definition $service, $ns, $bundle, $doc)
70
    {
71
        $tags = $service->getTag('graviton.rest');
72
        if (!empty($tags[0]['collection'])) {
73
            $doc = $tags[0]['collection'];
74
            $bundle = $tags[0]['collection'];
75
        }
76
77
        if (strtolower($ns) === 'gravitondyn') {
78
            $ns = 'GravitonDyn';
79
        }
80
81
        return sprintf(
82
            '%s\\%s\\Document\\%s',
83
            ucfirst($ns),
84
            ucfirst($bundle).'Bundle',
85
            ucfirst($doc)
86
        );
87
    }
88
}
89