File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ class ClassType extends Nette\Object
66
66
public $ methods = array ();
67
67
68
68
69
- /** @return Class */
69
+ /** @return ClassType */
70
70
public static function from ($ from )
71
71
{
72
72
$ from = $ from instanceof \ReflectionClass ? $ from : new \ReflectionClass ($ from );
@@ -90,11 +90,11 @@ public static function from($from)
90
90
}
91
91
}
92
92
foreach ($ from ->getProperties () as $ prop ) {
93
- $ class ->properties [] = Property::from ($ prop );
93
+ $ class ->properties [$ prop -> getName () ] = Property::from ($ prop );
94
94
}
95
95
foreach ($ from ->getMethods () as $ method ) {
96
96
if ($ method ->getDeclaringClass () == $ from ) { // intentionally ==
97
- $ class ->methods [] = Method::from ($ method );
97
+ $ class ->methods [$ method -> getName () ] = Method::from ($ method );
98
98
}
99
99
}
100
100
return $ class ;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public static function from($from)
69
69
$ method = new static ;
70
70
$ method ->name = $ from ->getName ();
71
71
foreach ($ from ->getParameters () as $ param ) {
72
- $ method ->parameters [] = Parameter::from ($ param );
72
+ $ method ->parameters [$ param -> getName () ] = Parameter::from ($ param );
73
73
}
74
74
$ method ->static = $ from ->isStatic ();
75
75
$ method ->visibility = $ from ->isPrivate () ? 'private ' : ($ from ->isProtected () ? 'protected ' : '' );
@@ -90,7 +90,7 @@ public function addParameter($name, $defaultValue = NULL)
90
90
if (func_num_args () > 1 ) {
91
91
$ param ->setOptional (TRUE )->setDefaultValue ($ defaultValue );
92
92
}
93
- return $ this ->parameters [] = $ param ->setName ($ name );
93
+ return $ this ->parameters [$ name ] = $ param ->setName ($ name );
94
94
}
95
95
96
96
You can’t perform that action at this time.
0 commit comments