Code Duplication    Length = 12-12 lines in 2 locations

src/Context/XMLContext.php 1 location

@@ 737-748 (lines=12) @@
734
     * @param object $config configuration object to return channel from. 
735
     * @return \PEIP\INF\Channel\Channel reply-channel
736
     */
737
    public function doGetChannel($type, $config){
738
        $channelName = $config[$type."_channel"] 
739
            ? $config[$type."_channel"] 
740
            : $config["default_".$type."_channel"];
741
        return $this->serviceProvider->provideService(trim((string)$channelName));
742
        $channel =  $this->services[trim((string)$channelName)];
743
        if($channel instanceof \PEIP\INF\Channel\Channel){
744
            return $channel;    
745
        }else{
746
            return NULL;
747
        }       
748
    }
749
750
    
751
    /**

src/Plugins/BasePlugin.php 1 location

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