Code Duplication    Length = 12-12 lines in 2 locations

src/Plugins/BasePlugin.php 1 location

@@ 270-281 (lines=12) @@
267
     * @param object $config configuration object to return channel from.
268
     * @return \PEIP\INF\Channel\Channel reply-channel
269
     */
270
    public function doGetChannel($type, $config){
271
        $channelName = isset($config[$type."_channel"])
272
            ? $config[$type."_channel"]
273
            : $config["default_".$type."_channel"];
274
        return $this->context->getServiceProvider()->provideService(trim((string)$channelName));
275
        $channel =  $this->services[trim((string)$channelName)];
276
        if($channel instanceof \PEIP\INF\Channel\Channel){
277
            return $channel;
278
        }else{
279
            return NULL;
280
        }
281
    }
282
283
    
284
}

src/Context/XMLContext.php 1 location

@@ 689-700 (lines=12) @@
686
     * @param object $config configuration object to return channel from. 
687
     * @return \PEIP\INF\Channel\Channel reply-channel
688
     */
689
    public function doGetChannel($type, $config){
690
        $channelName = $config[$type."_channel"] 
691
            ? $config[$type."_channel"] 
692
            : $config["default_".$type."_channel"];
693
        return $this->serviceProvider->provideService(trim((string)$channelName));
694
        $channel =  $this->services[trim((string)$channelName)];
695
        if($channel instanceof \PEIP\INF\Channel\Channel){
696
            return $channel;    
697
        }else{
698
            return NULL;
699
        }       
700
    }
701
702
703