Code Duplication    Length = 14-14 lines in 3 locations

src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php 3 locations

@@ 109-122 (lines=14) @@
106
     *
107
     * @return string
108
     */
109
    public static function getJoinRelationship(Join $join): string
110
    {
111
        static $relationshipProperty = null;
112
        static $initialized = false;
113
114
        if (!$initialized && !method_exists(Join::class, 'getJoin')) {
115
            $relationshipProperty = new \ReflectionProperty(Join::class, '_join');
116
            $relationshipProperty->setAccessible(true);
117
118
            $initialized = true;
119
        }
120
121
        return (null === $relationshipProperty) ? $join->getJoin() : $relationshipProperty->getValue($join);
122
    }
123
124
    /**
125
     * Gets the alias from a Join expression.
@@ 131-144 (lines=14) @@
128
     *
129
     * @return string
130
     */
131
    public static function getJoinAlias(Join $join): string
132
    {
133
        static $aliasProperty = null;
134
        static $initialized = false;
135
136
        if (!$initialized && !method_exists(Join::class, 'getAlias')) {
137
            $aliasProperty = new \ReflectionProperty(Join::class, '_alias');
138
            $aliasProperty->setAccessible(true);
139
140
            $initialized = true;
141
        }
142
143
        return (null === $aliasProperty) ? $join->getAlias() : $aliasProperty->getValue($join);
144
    }
145
146
    /**
147
     * Gets the parts from an OrderBy expression.
@@ 153-166 (lines=14) @@
150
     *
151
     * @return string[]
152
     */
153
    public static function getOrderByParts(OrderBy $orderBy): array
154
    {
155
        static $partsProperty = null;
156
        static $initialized = false;
157
158
        if (!$initialized && !method_exists(OrderBy::class, 'getParts')) {
159
            $partsProperty = new \ReflectionProperty(OrderBy::class, '_parts');
160
            $partsProperty->setAccessible(true);
161
162
            $initialized = true;
163
        }
164
165
        return (null === $partsProperty) ? $orderBy->getParts() : $partsProperty->getValue($orderBy);
166
    }
167
}
168