@@ -38,18 +38,18 @@ public function fromClassReflection(\ReflectionClass $from): ClassType
38
38
39
39
$ class ->setComment (Helpers::unformatDocComment ((string ) $ from ->getDocComment ()));
40
40
if ($ from ->getParentClass ()) {
41
- $ class ->setExtends ($ from ->getParentClass ()->getName () );
41
+ $ class ->setExtends ($ from ->getParentClass ()->name );
42
42
$ class ->setImplements (array_diff ($ class ->getImplements (), $ from ->getParentClass ()->getInterfaceNames ()));
43
43
}
44
44
$ props = $ methods = $ consts = [];
45
45
foreach ($ from ->getProperties () as $ prop ) {
46
- if ($ prop ->isDefault () && $ prop ->getDeclaringClass ()->getName () === $ from ->getName () ) {
46
+ if ($ prop ->isDefault () && $ prop ->getDeclaringClass ()->name === $ from ->name ) {
47
47
$ props [] = $ this ->fromPropertyReflection ($ prop );
48
48
}
49
49
}
50
50
$ class ->setProperties ($ props );
51
51
foreach ($ from ->getMethods () as $ method ) {
52
- if ($ method ->getDeclaringClass ()->getName () === $ from ->getName () ) {
52
+ if ($ method ->getDeclaringClass ()->name === $ from ->name ) {
53
53
$ methods [] = $ this ->fromMethodReflection ($ method );
54
54
}
55
55
}
@@ -68,7 +68,7 @@ public function fromClassReflection(\ReflectionClass $from): ClassType
68
68
69
69
public function fromMethodReflection (\ReflectionMethod $ from ): Method
70
70
{
71
- $ method = new Method ($ from ->getName () );
71
+ $ method = new Method ($ from ->name );
72
72
$ method ->setParameters (array_map ([$ this , 'fromParameterReflection ' ], $ from ->getParameters ()));
73
73
$ method ->setStatic ($ from ->isStatic ());
74
74
$ isInterface = $ from ->getDeclaringClass ()->isInterface ();
@@ -93,7 +93,7 @@ public function fromMethodReflection(\ReflectionMethod $from): Method
93
93
/** @return GlobalFunction|Closure */
94
94
public function fromFunctionReflection (\ReflectionFunction $ from )
95
95
{
96
- $ function = $ from ->isClosure () ? new Closure : new GlobalFunction ($ from ->getName () );
96
+ $ function = $ from ->isClosure () ? new Closure : new GlobalFunction ($ from ->name );
97
97
$ function ->setParameters (array_map ([$ this , 'fromParameterReflection ' ], $ from ->getParameters ()));
98
98
$ function ->setReturnReference ($ from ->returnsReference ());
99
99
$ function ->setVariadic ($ from ->isVariadic ());
@@ -120,7 +120,7 @@ public function fromCallable(callable $from)
120
120
121
121
public function fromParameterReflection (\ReflectionParameter $ from ): Parameter
122
122
{
123
- $ param = new Parameter ($ from ->getName () );
123
+ $ param = new Parameter ($ from ->name );
124
124
$ param ->setReference ($ from ->isPassedByReference ());
125
125
$ param ->setType ($ from ->getType () instanceof \ReflectionNamedType ? $ from ->getType ()->getName () : null );
126
126
$ param ->setNullable ($ from ->hasType () && $ from ->getType ()->allowsNull ());
@@ -150,7 +150,7 @@ public function fromConstantReflection(\ReflectionClassConstant $from): Constant
150
150
public function fromPropertyReflection (\ReflectionProperty $ from ): Property
151
151
{
152
152
$ defaults = $ from ->getDeclaringClass ()->getDefaultProperties ();
153
- $ prop = new Property ($ from ->getName () );
153
+ $ prop = new Property ($ from ->name );
154
154
$ prop ->setValue ($ defaults [$ prop ->getName ()] ?? null );
155
155
$ prop ->setStatic ($ from ->isStatic ());
156
156
$ prop ->setVisibility ($ from ->isPrivate ()
0 commit comments