File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,14 @@ public function __construct(
6767     */ 
6868    public  function  __invoke (ContainerInterface   $ container ): mixed 
6969    {
70-         $ class  = $ container ->has ($ this  ->class ) ? $ container ->get ($ this  ->class ) : $ this  ->class ;
71- 
7270        $ arguments  = array_map (
7371            static  fn  ($ argument ) => \is_string ($ argument ) && $ container ->has ($ argument )
7472                ? $ container ->get ($ argument )
7573                : $ argument ,
7674            $ this  ->arguments 
7775        );
7876
79-         $ reflectionMethod  = new  \ReflectionMethod ($ class , $ this  ->method );
77+         $ reflectionMethod  = new  \ReflectionMethod ($ this -> class , $ this  ->method );
8078
8179        if  (!$ reflectionMethod ->isPublic ()) {
8280            throw  RuntimeException::forNonPublicMethod ($ this  ->class , $ this  ->method );
@@ -86,6 +84,6 @@ public function __invoke(ContainerInterface $container): mixed
8684            return  $ reflectionMethod ->invokeArgs (null , $ arguments );
8785        }
8886
89-         return  $ reflectionMethod ->invokeArgs ($ class , $ arguments );
87+         return  $ reflectionMethod ->invokeArgs (new  ( $ this -> class )() , $ arguments );
9088    }
9189}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments