Code Duplication    Length = 13-13 lines in 2 locations

src/Context/XMLContext.php 1 location

@@ 382-394 (lines=13) @@
379
    protected function modifyService($service, $config){ 
380
        $reflection = GenericBuilder::getInstance(get_class($service))->getReflectionClass();
381
        // set instance properties
382
        if($config->property){          
383
            foreach($config->property as $property){                          
384
                $arg = $this->buildArg($property);
385
                if($arg){
386
                    $setter = self::getSetter($property);               
387
                    if($setter &&  self::hasPublicProperty($service, 'Method', $setter)){
388
                        $service->{$setter}($arg);  
389
                    }elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){
390
                        $service->$setter = $arg;
391
                    }                   
392
                }
393
            }
394
        }   
395
        // call instance methods
396
        if($config->action){            
397
            foreach($config->action as $action){

src/Factory/ServiceFactory.php 1 location

@@ 171-183 (lines=13) @@
168
    protected function modifyService($service, $config){        
169
        $config = is_array($config) ? new \ArrayObject($config) : $config;
170
        // set instance properties
171
        if(isset($config->property)){
172
            foreach($config->property as $property){
173
                $arg = $this->buildArg($property);
174
                if($arg){
175
                    $setter = self::getSetter($property);
176
                    if($setter &&  self::hasPublicProperty($service, 'Method', $setter)){
177
                        $service->{$setter}($arg);
178
                    }elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){
179
                        $service->$setter = $arg;
180
                    }
181
                }
182
            }
183
        }
184
        // call instance methods
185
        if(isset($config->action)){
186
            foreach($config->action as $action){