@@ -9,7 +9,10 @@ import type { Namespace_ } from '../types/node/stmt/namespace';
99import type { Property } from '../types/node/stmt/property' ;
1010import type { Return_ } from '../types/node/stmt/return' ;
1111import type { Use_ } from '../types/node/stmt/use' ;
12- import type { NodeTypeInheritingFromNodeAbstract } from '../types/types' ;
12+ import {
13+ NodeType ,
14+ type NodeTypeInheritingFromNodeAbstract ,
15+ } from '../types/types' ;
1316
1417export type IUseFullQualifiedNameParts = string [ ] ;
1518export type IUses = {
@@ -37,11 +40,14 @@ export class NodeRetrieverHelpers {
3740 ) : Class_ {
3841 const namespaceNode = NodeRetrieverHelpers . findNodeByNodeType < Namespace_ > (
3942 rootNode as INode [ ] ,
40- ' Stmt_Namespace' ,
43+ NodeType . Stmt_Namespace ,
4144 ) ;
4245
4346 if ( namespaceNode ?. stmts ) {
44- return this . findNodeByNodeType < Class_ > ( namespaceNode . stmts , 'Stmt_Class' ) ;
47+ return this . findNodeByNodeType < Class_ > (
48+ namespaceNode . stmts ,
49+ NodeType . Stmt_Class ,
50+ ) ;
4551 }
4652
4753 return undefined ;
@@ -56,7 +62,7 @@ export class NodeRetrieverHelpers {
5662 if ( classNode . stmts ) {
5763 return this . filterNodeByNodeType < Property > (
5864 classNode . stmts ,
59- ' Stmt_Property' ,
65+ NodeType . Stmt_Property ,
6066 )
6167 . filter (
6268 /**
@@ -113,12 +119,12 @@ export class NodeRetrieverHelpers {
113119 ) : IUses {
114120 const namespaceNode = NodeRetrieverHelpers . findNodeByNodeType < Namespace_ > (
115121 rootNode ,
116- ' Stmt_Namespace' ,
122+ NodeType . Stmt_Namespace ,
117123 ) ;
118124
119125 if ( namespaceNode ?. stmts ) {
120126 return Object . fromEntries (
121- this . filterNodeByNodeType < Use_ > ( namespaceNode . stmts , ' Stmt_Use' )
127+ this . filterNodeByNodeType < Use_ > ( namespaceNode . stmts , NodeType . Stmt_Use )
122128 . map ( ( useNode ) => useNode . uses [ 0 ] . name . parts )
123129 . map ( ( parts ) => [ parts . slice ( - 1 ) , parts ] ) ,
124130 ) as IUses ;
@@ -133,7 +139,7 @@ export class NodeRetrieverHelpers {
133139 if ( classNode . stmts ) {
134140 const classMethodNodes = this . filterNodeByNodeType < ClassMethod > (
135141 classNode . stmts ,
136- ' Stmt_ClassMethod' ,
142+ NodeType . Stmt_ClassMethod ,
137143 ) ;
138144
139145 const getTypeMethodNode = classMethodNodes . find (
@@ -143,7 +149,7 @@ export class NodeRetrieverHelpers {
143149 if ( getTypeMethodNode ) {
144150 const returnNode = this . findNodeByNodeType < Return_ > (
145151 getTypeMethodNode . stmts ,
146- ' Stmt_Return' ,
152+ NodeType . Stmt_Return ,
147153 ) ;
148154
149155 if ( returnNode ) {
0 commit comments