From 0a2a0feaf233df92253e8b3725825a5b3309091e Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 23 Jul 2023 02:16:44 +0200 Subject: [PATCH] CS fix --- src/Psalm/Internal/Cli/LanguageServer.php | 2 ++ src/Psalm/Internal/LanguageServer/PathMapper.php | 4 ++++ tests/LanguageServer/DiagnosticTest.php | 1 + tests/LanguageServer/PathMapperTest.php | 8 ++++---- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Psalm/Internal/Cli/LanguageServer.php b/src/Psalm/Internal/Cli/LanguageServer.php index 026d67efd..07d5e6f93 100644 --- a/src/Psalm/Internal/Cli/LanguageServer.php +++ b/src/Psalm/Internal/Cli/LanguageServer.php @@ -19,6 +19,7 @@ use function array_search; use function array_slice; use function chdir; use function error_log; +use function explode; use function fwrite; use function gc_disable; use function getcwd; @@ -32,6 +33,7 @@ use function is_string; use function preg_replace; use function realpath; use function setlocale; +use function strlen; use function strpos; use function strtolower; use function substr; diff --git a/src/Psalm/Internal/LanguageServer/PathMapper.php b/src/Psalm/Internal/LanguageServer/PathMapper.php index 88ff1661d..bd4b815bc 100644 --- a/src/Psalm/Internal/LanguageServer/PathMapper.php +++ b/src/Psalm/Internal/LanguageServer/PathMapper.php @@ -2,6 +2,10 @@ namespace Psalm\Internal\LanguageServer; +use function rtrim; +use function strlen; +use function substr; + /** @internal */ final class PathMapper { diff --git a/tests/LanguageServer/DiagnosticTest.php b/tests/LanguageServer/DiagnosticTest.php index 470bc6819..b40ef38ac 100644 --- a/tests/LanguageServer/DiagnosticTest.php +++ b/tests/LanguageServer/DiagnosticTest.php @@ -23,6 +23,7 @@ use Psalm\Tests\LanguageServer\MockProtocolStream; use Psalm\Tests\TestConfig; use function Amp\Promise\wait; +use function getcwd; use function rand; class DiagnosticTest extends AsyncTestCase diff --git a/tests/LanguageServer/PathMapperTest.php b/tests/LanguageServer/PathMapperTest.php index ac6e1fd5c..2e64b3563 100644 --- a/tests/LanguageServer/PathMapperTest.php +++ b/tests/LanguageServer/PathMapperTest.php @@ -13,7 +13,7 @@ final class PathMapperTest extends TestCase $mapper->configureClientRoot('/home/user/src/project'); $this->assertSame( '/home/user/src/project/filename.php', - $mapper->mapServerToClient('/var/www/filename.php') + $mapper->mapServerToClient('/var/www/filename.php'), ); } @@ -25,7 +25,7 @@ final class PathMapperTest extends TestCase $this->assertSame( '/home/user/src/project/filename.php', - $mapper->mapServerToClient('/var/www/filename.php') + $mapper->mapServerToClient('/var/www/filename.php'), ); } @@ -43,7 +43,7 @@ final class PathMapperTest extends TestCase $mapper->configureClientRoot($client_root_provided_later); $this->assertSame( $server_ath, - $mapper->mapClientToServer($client_path) + $mapper->mapClientToServer($client_path), ); } @@ -59,7 +59,7 @@ final class PathMapperTest extends TestCase $mapper->configureClientRoot($client_root_provided_later); $this->assertSame( $client_path, - $mapper->mapServerToClient($server_path) + $mapper->mapServerToClient($server_path), ); }