-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompleter.php
More file actions
37 lines (32 loc) · 881 Bytes
/
Completer.php
File metadata and controls
37 lines (32 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace Mkusher\PadawanDi;
use Complete\Completer\CompleterInterface;
use Complete\Completer\ClassNameCompleter;
use Entity\Completion\Entry;
use Entity\Project;
use Entity\Completion\Context;
use Entity\FQCN;
class Completer implements CompleterInterface
{
public function __construct(ClassNameCompleter $completer)
{
$this->classNameCompleter = $completer;
}
public function getEntries(Project $project, Context $context)
{
return array_map(
[$this, 'wrapEntry'],
$this->classNameCompleter->getEntries($project, $context)
);
}
public function wrapEntry($entry)
{
return new Entry(
sprintf('"%s"', $entry->getName()),
$entry->getSignature(),
$entry->getDesc(),
$entry->getMenu()
);
}
private $classNameCompleter;
}