Code Duplication    Length = 5-5 lines in 3 locations

module/UIComponents/src/UIComponents/View/Helper/Components/Element.php 1 location

@@ 36-40 (lines=5) @@
33
     */
34
    public function __invoke($options = array())
35
    {
36
        if ( is_object($options) && method_exists($options, 'toArray') ) {
37
            $options = $options->toArray();
38
        } else if ( is_object($options) ) {
39
            $options = (array)$options;
40
        }
41
        
42
        if (isset($options['container']) && (null !== $options['container'])) {
43
            $this->setContainer($options['container']);

module/UIComponents/src/UIComponents/View/Helper/Components/Table.php 2 locations

@@ 54-58 (lines=5) @@
51
     */
52
    public function __invoke($config = array(), $options = array())
53
    {
54
        if ( is_object($options) && method_exists($options, 'toArray') ) {
55
            $options = $options->toArray();
56
        } else if ( is_object($options) ) {
57
            $options = (array)$options;
58
        }
59
        
60
        if ( is_object($config) && method_exists($config, 'toArray') ) {
61
            $config = $config->toArray();
@@ 60-64 (lines=5) @@
57
            $options = (array)$options;
58
        }
59
        
60
        if ( is_object($config) && method_exists($config, 'toArray') ) {
61
            $config = $config->toArray();
62
        } else if ( is_object($options) ) {
63
            $config = (array)$config;
64
        }
65
        
66
        $this->setOptions($config);
67