Code Duplication    Length = 12-12 lines in 2 locations

src/Context/XMLContext.php 1 location

@@ 396-407 (lines=12) @@
393
            }
394
        }   
395
        // call instance methods
396
        if($config->action){            
397
            foreach($config->action as $action){
398
                $method = (string)$action['method'] != '' ? (string)$action['method'] : NULL;
399
                if($method && self::hasPublicProperty($service, 'Method', $method)){
400
                    $args = array(); 
401
                    foreach($action->children() as $argument){
402
                        $args[] = $this->buildArg($argument);
403
                    } 
404
                    call_user_func_array(array($service, (string)$action['method']), $args);
405
                }
406
            }
407
        }       
408
        // register instance listeners
409
        if($service instanceof \PEIP\INF\Event\Connectable){
410
            if($config->listener){

src/Factory/ServiceFactory.php 1 location

@@ 187-198 (lines=12) @@
184
            }
185
        }
186
        // call instance methods
187
        if(isset($config->action)){
188
            foreach($config->action as $action){
189
                $method = (string)$action['method'] != '' ? (string)$action['method'] : NULL;
190
                if($method && self::hasPublicProperty($service, 'Method', $method)){
191
                    $args = array();
192
                    foreach($action->children() as $argument){
193
                        $args[] = $this->buildArg($argument);
194
                    }
195
                    call_user_func_array(array($service, (string)$action['method']), $args);
196
                }
197
            }
198
        }
199
        // register instance listeners
200
        if($service instanceof \PEIP\INF\Event\Connectable){
201
            if(isset($config->listener)){