Code Duplication    Length = 9-10 lines in 2 locations

src/Context/XMLContext.php 1 location

@@ 467-475 (lines=9) @@
464
     * @param $additionalArguments additional arguments for the channel constructor (without first arg = id)
465
     * @return \PEIP\INF\Channel\Channel the created channel instance
466
     */
467
    public function doCreateChannel($config, $defaultChannelClass, array $additionalArguments = array()){
468
        $id = (string)$config['id'];
469
        if($id != ''){ 
470
            array_unshift($additionalArguments, $id);
471
            $channel = $this->buildAndModify($config, $additionalArguments, $defaultChannelClass);
472
            $this->channelRegistry->register($channel);
473
            return $channel;
474
        }
475
    }
476
       
477
    /**
478
     * Creates and registers gateway from a configuration object.

src/Plugins/BasePlugin.php 1 location

@@ 70-79 (lines=10) @@
67
     * @param $additionalArguments additional arguments for the channel constructor (without first arg = id)
68
     * @return \PEIP\INF\Channel\Channel the created channel instance
69
     */
70
    public function doCreateChannel($config, $defaultChannelClass, array $additionalArguments = array()){
71
        $id = (string)$config['id'];
72
        if($id != ''){
73
            array_unshift($additionalArguments, $id);
74
            $channel = $this->buildAndModify($config, $additionalArguments, $defaultChannelClass);
75
            //$this->channelRegistry->register($channel);
76
           
77
            return $channel;
78
        }
79
    }
80
81
    /**
82
     * Creates and registers gateway from a configuration object.