Code Duplication    Length = 11-11 lines in 2 locations

src/ApaiIO/ResponseTransformer/ObjectToItem.php 1 location

@@ 262-272 (lines=11) @@
259
        }
260
    }
261
262
    private function get_ancestor($node)
263
    {
264
        if( isset( $node['Ancestors'] ) AND is_array( $node['Ancestors'] ) )
265
        {
266
            return $this->get_ancestor( $node['Ancestors']['BrowseNode'] );
267
        }
268
        else
269
        {
270
            return isset( $node['Name'] ) ? $node['Name'] : 'Uncategorized';
271
        }
272
    }
273
274
}
275

src/ApaiIO/ResponseTransformer/ObjectToItems.php 1 location

@@ 199-209 (lines=11) @@
196
        }
197
    }
198
199
    private function get_ancestor($node)
200
    {
201
        if(isset($node['Ancestors']) AND is_array( $node['Ancestors'] ))
202
        {
203
            return $this->get_ancestor($node['Ancestors']['BrowseNode']);
204
        }
205
        else
206
        {
207
            return $node['Name'];
208
        }
209
    }
210
}