Code Duplication    Length = 11-11 lines in 2 locations

src/Context/XMLContext.php 1 location

@@ 777-787 (lines=11) @@
774
        }else{
775
            throw new \RuntimeException('Could not create Service. no class or reference given.');
776
        }
777
        if($config["ref_property"]){
778
            $service = $service->{(string)$config["ref_property"]}; 
779
        }elseif($config["ref_method"]){
780
                $args = array();
781
            if($config->argument){
782
                        foreach($config->argument as $arg){
783
                            $args[] = $this->buildArg($arg);
784
                        }
785
                }
786
            $service = call_user_func_array(array($service, (string)$config["ref_method"]), $args);
787
        }       
788
        if(!is_object($service)){
789
            throw new \RuntimeException('Could not create Service.'); 
790
        }

src/Factory/ServiceFactory.php 1 location

@@ 135-145 (lines=11) @@
132
        }else{
133
            throw new \RuntimeException('Could not create Service. no class or reference given.');
134
        }
135
        if(isset($config["ref_property"])){
136
            $service = $service->{(string)$config["ref_property"]};
137
        }elseif(isset($config["ref_method"])){
138
                $args = array();
139
            if($config->argument){
140
                        foreach($config->argument as $arg){
141
                            $args[] = $this->buildArg($arg);
142
                        }
143
                }
144
            $service = call_user_func_array(array($service, (string)$config["ref_method"]), $args);
145
        }
146
        if(!is_object($service)){
147
            throw new \RuntimeException('Could not create Service.');
148
        }