Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for psr/log 2.0 and 3.0 #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/serve.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct()
$this->log = fopen('phpactor-lsp.log', 'w');
}

public function log($level, $message, array $context = [])
public function log($level, $message, array $context = []): void
{
$message = json_encode(
[
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"dantleech/invoke": "^2.0",
"phpactor/language-server-protocol": "^3.17",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"ramsey/uuid": "^4.0",
"thecodingmachine/safe": "^1.1"
},
"require-dev": {
"amphp/phpunit-util": "^1.3",
"colinodell/psr-testlogger": "^1.0",
"ergebnis/composer-normalize": "^2.0",
"friendsofphp/php-cs-fixer": "^3.0",
"jangregor/phpstan-prophecy": "^1.0",
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ parameters:
- lib
- example
- bin
ignoreErrors:
-
message: '#has parameter \$(context|message) with no (value )?type specified#'
path: 'bin/serve.php'
reportUnmatched: false

includes:
- phpstan-baseline.neon
2 changes: 1 addition & 1 deletion tests/Unit/Core/Service/ServiceManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
use Amp\PHPUnit\AsyncTestCase;
use Amp\Promise;
use Amp\Success;
use ColinODell\PsrTestLogger\TestLogger;
use Exception;
use Generator;
use Phpactor\LanguageServer\Core\Dispatcher\ArgumentResolver;
use Phpactor\LanguageServer\Core\Service\ServiceProvider;
use Phpactor\LanguageServer\Core\Service\ServiceManager;
use Phpactor\LanguageServer\Core\Service\ServiceProviders;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Log\Test\TestLogger;
use RuntimeException;

class ServiceManagerTest extends AsyncTestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Middleware/ErrorHandlingMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Amp\PHPUnit\AsyncTestCase;
use Amp\Success;
use ColinODell\PsrTestLogger\TestLogger;
use Generator;
use Phpactor\LanguageServer\Core\Handler\HandlerNotFound;
use Phpactor\LanguageServer\Core\Middleware\RequestHandler;
Expand All @@ -15,7 +16,6 @@
use Phpactor\LanguageServer\Core\Server\Exception\ExitSession;
use Phpactor\LanguageServer\Middleware\ClosureMiddleware;
use Phpactor\LanguageServer\Middleware\ErrorHandlingMiddleware;
use Psr\Log\Test\TestLogger;
use RuntimeException;

class ErrorHandlingMiddlewareTest extends AsyncTestCase
Expand Down
Loading