style: apply php-cs-fixer and PHPStan fixes (#289)

* style: apply php-cs-fixer to test files

Addresses drift flagged by the default PHP-CS-Fixer config — mostly
adds missing `: void` return types on pre-existing test methods.

No behavioural changes.

* fix: resolve phpstan errors surfaced by qa

- Drop the obsolete `Method ::test*() has no return type specified`
  ignore rule — every test method now declares a return type, so
  the pattern never matches and phpstan reports it as unmatched.
- Remove `?? []` from two reads of `CallToolRequest::$arguments`;
  the property is typed `array` (non-nullable), so the coalesce is
  a no-op that phpstan flags.

---------

Co-authored-by: DDEV User <nobody@example.com>
This commit is contained in:
Mateu Aguiló Bosch 2026-04-20 20:49:15 +02:00 • committed by GitHub
commit 73e4cc2456
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,7 @@ class DocBlockParserTest extends TestCase
$this->parser = new DocBlockParser();
}
public function testGetDescriptionReturnsCorrectDescription()
public function testGetDescriptionReturnsCorrectDescription(): void
{
$method = new \ReflectionMethod(DocBlockTestFixture::class, 'methodWithSummaryAndDescription');
$docComment = $method->getDocComment() ?: null;
@ -43,7 +43,7 @@ class DocBlockParserTest extends TestCase
$this->assertEquals('Simple summary line.', $this->parser->getDescription($docBlock2));
}
public function testGetParamTagsReturnsStructuredParamInfo()
public function testGetParamTagsReturnsStructuredParamInfo(): void
{
$method = new \ReflectionMethod(DocBlockTestFixture::class, 'methodWithParams');
$docComment = $method->getDocComment() ?: null;
@ -94,7 +94,7 @@ class DocBlockParserTest extends TestCase
$this->assertEquals('object param', $this->parser->getParamDescription($params['$param6']));
}
public function testGetTagsByNameReturnsSpecificTags()
public function testGetTagsByNameReturnsSpecificTags(): void
{
$method = new \ReflectionMethod(DocBlockTestFixture::class, 'methodWithMultipleTags');
$docComment = $method->getDocComment() ?: null;
@ -116,7 +116,7 @@ class DocBlockParserTest extends TestCase
$this->assertEmpty($nonExistentTags);
}
public function testHandlesMethodWithNoDocblockGracefully()
public function testHandlesMethodWithNoDocblockGracefully(): void
{
$method = new \ReflectionMethod(DocBlockTestFixture::class, 'methodWithNoDocBlock');
$docComment = $method->getDocComment() ?: null;