Skip to content

Commit 72a2b90

Browse files
committed
fixed methods sorting
1 parent ba08896 commit 72a2b90

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/Complete/Completer/ObjectCompleter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,18 @@ public function getEntries(Project $project, Context $context){
3838
if($class->methods !== null){
3939
foreach($class->methods->all($spec) AS $method){
4040
$entry = $this->createEntryForMethod($method);
41-
$entries[] = $entry;
41+
$entries[$method->name] = $entry;
4242
}
4343
}
4444
if($class instanceof InterfaceData){
4545
return $entries;
4646
}
4747
if($class->properties !== null){
4848
foreach($class->properties->all($spec) AS $property){
49-
$entries[] = $this->createEntryForProperty($property);
49+
$entries[$property->name] = $this->createEntryForProperty($property);
5050
}
5151
}
52+
ksort($entries);
5253
return $entries;
5354
}
5455

src/Entity/Collection/MethodsCollection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ public function all(Specification $spec = null){
5757
if($this->class instanceof ClassData){
5858
$parent = $this->class->getParent();
5959
if($parent instanceof ClassData){
60-
$methods = array_merge(
61-
$parent->methods->all(new Specification(
60+
$parentM = $parent->methods->all(new Specification(
6261
$spec->getParentMode(),
6362
$spec->isStatic(),
6463
$spec->isMagic()
65-
)),
64+
));
65+
$methods = array_merge(
66+
$parentM,
6667
$methods
6768
);
6869
}
6970
}
70-
sort($methods);
7171
return $methods;
7272
}
7373
}

0 commit comments

Comments
 (0)