1. Go to this page and download the library: Download phpactor/completion library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$completor = new ChainCompletor([
new MyCompletor1(),
new MyCompletor2(),
]);
$suggestions = $completor->complete($sourceCode, $byteOffset);
use Phpactor\WorseReflection\ReflectorBuilder;
use Phpactor\Completion\Bridge\TolerantParser\ChainTolerantCompletor;
use Phpactor\Completion\Bridge\TolerantParser\WorseReflection\WorseLocalVariableCompletor;
use Phpactor\Completion\Bridge\TolerantParser\WorseReflection\WorseClassMemberCompletor;
$reflector = ReflectorBuilder::create()->addSource($sourceCode)->build();
$formatter = new ObjectFormatter([
// ... instances of ObjectFormatter
]);
$completor = new ChainTolerantCompletor([
new WorseLocalVariableCompletor($reflector, $formatter),
new WorseClassMemberCompletor($reflector, $formatter),
]);
$completor->complete($sourceCode, $byteOffset);
$formatter = new ObjectFormatter([
new TypeFormatter(),
new TypesFormatter(),
new FunctionFormatter(),
new MethodFormatter(),
new ParameterFormatter(),
new ParametersFormatter(),
new PropertyFormatter(),
new VariableFormatter(),
]);
$reflectionMethod = $reflector->reflectClass(Foobar::class)->methods()->get('barfoo');
$formatter->format($reflectionMethod);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.