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

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