File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed 
rules/TypeDeclaration/Rector/Property Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,11 @@ public function getNodeTypes(): array
9393    public  function  refactor (Node $ nodeNode 
9494    {
9595        $ constructClassMethod$ nodegetMethod (MethodName::CONSTRUCT );
96-         if  (! $ constructClassMethodinstanceof  ClassMethod || $ nodegetProperties () === []) {
96+         if  (! $ constructClassMethodinstanceof  ClassMethod) {
97+             return  null ;
98+         }
99+ 
100+         if  (! $ this hasSomeUntypedProperties ($ node
97101            return  null ;
98102        }
99103
@@ -180,4 +184,17 @@ private function shouldSkipPropertyType(Type $propertyType): bool
180184
181185        return  $ this doctrineTypeAnalyzer ->isInstanceOfCollectionType ($ propertyType
182186    }
187+ 
188+     private  function  hasSomeUntypedProperties (Node Class_ $ nodebool 
189+     {
190+         foreach  ($ nodegetProperties () as  $ property
191+             if  ($ propertytype  instanceof  \PhpParser \Node) {
192+                 continue ;
193+             }
194+ 
195+             return  true ;
196+         }
197+ 
198+         return  false ;
199+     }
183200}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments