Automatic fixes
parent
c8244f138a
commit
5285aea1f4
|
@ -85,5 +85,4 @@ abstract class Formatter
|
|||
$standard = PHP_CodeSniffer::getConfigData('default_standard') ?? 'PSR2';
|
||||
return explode(',', $standard);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -178,7 +178,8 @@ class Project
|
|||
* @param string $fqn The fully qualified name of the symbol
|
||||
* @return void
|
||||
*/
|
||||
public function removeSymbol(string $fqn) {
|
||||
public function removeSymbol(string $fqn)
|
||||
{
|
||||
unset($this->symbols[$fqn]);
|
||||
unset($this->references[$fqn]);
|
||||
}
|
||||
|
@ -207,7 +208,8 @@ class Project
|
|||
* @param string $uri The URI
|
||||
* @return void
|
||||
*/
|
||||
public function removeReferenceUri(string $fqn, string $uri) {
|
||||
public function removeReferenceUri(string $fqn, string $uri)
|
||||
{
|
||||
if (!isset($this->references[$fqn])) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@ namespace LanguageServer\Protocol;
|
|||
/**
|
||||
* The kind of a completion entry.
|
||||
*/
|
||||
abstract class CompletionItemKind {
|
||||
abstract class CompletionItemKind
|
||||
{
|
||||
const TEXT = 1;
|
||||
const METHOD = 2;
|
||||
const FUNCTION = 3;
|
||||
|
|
|
@ -12,7 +12,8 @@ use InvalidArgumentException;
|
|||
* @param string $pattern
|
||||
* @return array
|
||||
*/
|
||||
function findFilesRecursive(string $path, string $pattern): array {
|
||||
function findFilesRecursive(string $path, string $pattern): array
|
||||
{
|
||||
$dir = new \RecursiveDirectoryIterator($path);
|
||||
$ite = new \RecursiveIteratorIterator($dir);
|
||||
$files = new \RegexIterator($ite, $pattern, \RegexIterator::GET_MATCH);
|
||||
|
@ -29,7 +30,8 @@ function findFilesRecursive(string $path, string $pattern): array {
|
|||
* @param string $filepath
|
||||
* @return string
|
||||
*/
|
||||
function pathToUri(string $filepath): string {
|
||||
function pathToUri(string $filepath): string
|
||||
{
|
||||
$filepath = trim(str_replace('\\', '/', $filepath), '/');
|
||||
$parts = explode('/', $filepath);
|
||||
// Don't %-encode the colon after a Windows drive letter
|
||||
|
|
|
@ -36,4 +36,3 @@ class MockProtocolStream implements ProtocolReader, ProtocolWriter
|
|||
$this->listener = $listener;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,15 @@ use function LanguageServer\pathToUri;
|
|||
|
||||
class GlobalTest extends ServerTestCase
|
||||
{
|
||||
public function testDefinitionFileBeginning() {
|
||||
public function testDefinitionFileBeginning()
|
||||
{
|
||||
// |<?php
|
||||
$result = $this->textDocument->definition(new TextDocumentIdentifier(pathToUri(realpath(__DIR__ . '/../../../../fixtures/references.php'))), new Position(0, 0));
|
||||
$this->assertEquals([], $result);
|
||||
}
|
||||
|
||||
public function testDefinitionEmptyResult() {
|
||||
public function testDefinitionEmptyResult()
|
||||
{
|
||||
// namespace keyword
|
||||
$result = $this->textDocument->definition(new TextDocumentIdentifier(pathToUri(realpath(__DIR__ . '/../../../../fixtures/references.php'))), new Position(2, 4));
|
||||
$this->assertEquals([], $result);
|
||||
|
|
|
@ -36,7 +36,8 @@ class ParseErrorsTest extends TestCase
|
|||
$this->textDocument = new Server\TextDocument($project, $client);
|
||||
}
|
||||
|
||||
private function openFile($file) {
|
||||
private function openFile($file)
|
||||
{
|
||||
$textDocumentItem = new TextDocumentItem();
|
||||
$textDocumentItem->uri = 'whatever';
|
||||
$textDocumentItem->languageId = 'php';
|
||||
|
|
Loading…
Reference in New Issue