Code Duplication    Length = 21-21 lines in 2 locations

src/allejo/stakx/Document/DataItem.php 1 location

@@ 168-188 (lines=21) @@
165
    /**
166
     * {@inheritdoc}
167
     */
168
    public function offsetGet($offset)
169
    {
170
        $fxnCall = 'get' . ucfirst($offset);
171
172
        if (in_array($fxnCall, FrontMatterDocument::$whiteListedFunctions) && method_exists($this, $fxnCall))
173
        {
174
            return call_user_func_array([$this, $fxnCall], []);
175
        }
176
177
        if (isset($this->data[$offset]))
178
        {
179
            return $this->data[$offset];
180
        }
181
182
        if (isset($this->frontMatter[$offset]))
183
        {
184
            return $this->frontMatter[$offset];
185
        }
186
187
        return null;
188
    }
189
190
    /**
191
     * {@inheritdoc}

src/allejo/stakx/Document/FrontMatterDocument.php 1 location

@@ 303-323 (lines=21) @@
300
    /**
301
     * {@inheritdoc}
302
     */
303
    public function offsetGet($offset)
304
    {
305
        if (isset($this->specialFrontMatter[$offset]))
306
        {
307
            return $this->specialFrontMatter[$offset];
308
        }
309
310
        $fxnCall = 'get' . ucfirst($offset);
311
312
        if (in_array($fxnCall, self::$whiteListedFunctions) && method_exists($this, $fxnCall))
313
        {
314
            return call_user_func_array([$this, $fxnCall], []);
315
        }
316
317
        if (isset($this->frontMatter[$offset]))
318
        {
319
            return $this->frontMatter[$offset];
320
        }
321
322
        return null;
323
    }
324
}
325