Code Duplication    Length = 11-11 lines in 2 locations

src/Core/Variables/StandardVariableProvider.php 1 location

@@ 255-265 (lines=11) @@
252
     * @param string $propertyPath
253
     * @return string
254
     */
255
    protected function resolveSubVariableReferences($propertyPath)
256
    {
257
        if (strpos($propertyPath, '{') !== false) {
258
            preg_match_all('/(\{.*\})/', $propertyPath, $matches);
259
            foreach ($matches[1] as $match) {
260
                $subPropertyPath = substr($match, 1, -1);
261
                $propertyPath = str_replace($match, $this->getByPath($subPropertyPath), $propertyPath);
262
            }
263
        }
264
        return $propertyPath;
265
    }
266
267
    /**
268
     * Extracts a single value from an array or object.

src/Core/Variables/VariableExtractor.php 1 location

@@ 120-130 (lines=11) @@
117
     * @param string $propertyPath
118
     * @return string
119
     */
120
    protected function resolveSubVariableReferences($subject, $propertyPath)
121
    {
122
        if (strpos($propertyPath, '{') !== false) {
123
            preg_match_all('/(\{.*\})/', $propertyPath, $matches);
124
            foreach ($matches[1] as $match) {
125
                $subPropertyPath = substr($match, 1, -1);
126
                $propertyPath = str_replace($match, $this->getByPath($subject, $subPropertyPath), $propertyPath);
127
            }
128
        }
129
        return $propertyPath;
130
    }
131
132
    /**
133
     * Extracts a single value from an array or object.