Skip to content
Merged
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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"moneyphp/money": "^4.8.0",
"nesbot/carbon": "^3.11.0",
"php-standard-library/phpstan-extension": "^2.0.2",
"phpstan/phpstan": "<=2.1.12",
"phpstan/phpstan": "^2.1.12",
"phpstan/phpstan-phpunit": "^2.0.6",
"phpstan/phpstan-strict-rules": "^2.0.6",
"phpstan/phpstan-symfony": "^2.0.4",
Expand Down
18 changes: 18 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ parameters:
-
identifier: trait.unused

-
identifier: staticMethod.internalClass

-
identifier: method.internal

-
identifier: method.internalClass

-
identifier: classConstant.internalClass

-
message: '#^Call to method scalarNode\(\) on an unknown class Symfony\\Component\\Config\\Definition\\Builder\\NodeBuilder\<Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition\>\.$#'
identifier: class.notFound
Expand Down Expand Up @@ -93,6 +105,12 @@ parameters:
count: 1
path: src/Test/bootstrap.php

-
message: '#^Call to function method_exists\(\) with Doctrine\\ORM\\Configuration and ''enableNativeLazyObj…'' will always evaluate to false\.$#'
identifier: function.impossibleType
count: 1
path: src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php

-
message: '#^Call to function method_exists\(\) with Doctrine\\ORM\\Configuration and ''enableNativeLazyObj…'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
Expand Down
5 changes: 3 additions & 2 deletions src/Test/KernelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

use function assert;
use function class_exists;
use function file_exists;
use function str_starts_with;

abstract class KernelTestCase extends SymfonyKernelTestCase
Expand Down Expand Up @@ -249,7 +250,7 @@ protected function loadTestFixtures(): void
);

$fixturesFile = $this->getFixturesFileForTest();
if (! Filesystem\exists($fixturesFile)) {
if (! file_exists($fixturesFile)) {
return;
}

Expand Down Expand Up @@ -413,7 +414,7 @@ protected function getPayloadContentFile(string $type): string
}

$payloadFile = $this->getCurrentPayloadContentFile($type, true);
if (Filesystem\exists($payloadFile)) {
if (file_exists($payloadFile)) {
return $payloadFile;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Test/RestControllerWebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use PHPUnit\Framework\ExpectationFailedException;
use Psl\File;
use Psl\Filesystem;
use Psl\Json;
use Psl\Type;
use Speicher210\FunctionalTestBundle\Constraint\JsonContentMatches;
Expand All @@ -19,6 +18,7 @@
use Symfony\Component\Security\Core\User\UserInterface;

use function array_replace_recursive;
use function file_exists;
use function parse_str;
use function parse_url;

Expand Down Expand Up @@ -233,7 +233,7 @@ protected function assertRestRequest(Request $request, int $expectedStatusCode =
$expected = null;
if ($expectedStatusCode !== Response::HTTP_NO_CONTENT) {
$expectedFile = $this->getExpectedResponseContentFile('json');
if (Filesystem\exists($expectedFile)) {
if (file_exists($expectedFile)) {
$expected = $this->prettifyJson(File\read($expectedFile));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Twig/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final public function testLegacyIntegration(
*/
public static function dataProviderTestIntegration(): iterable
{
return (new static('test'))->getTests('test');
return (new static('test'))->getTests('test'); // @phpstan-ignore-line
}

#[DataProvider('dataProviderTestIntegration')]
Expand Down
4 changes: 2 additions & 2 deletions tests/Constraint/ResponseStatusCodeSameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class ResponseStatusCodeSameTest extends TestCase
public function testEvaluateReturnsNullForTheSameStatusCode(): void
{
$response = $this->createMock(Response::class);
$response->expects(self::once())->method('getStatusCode')->willReturn(200);
$response->expects($this->once())->method('getStatusCode')->willReturn(200);

$constraint = new ResponseStatusCodeSame(200);

Expand All @@ -24,7 +24,7 @@ public function testEvaluateReturnsNullForTheSameStatusCode(): void
public function testEvaluateThrowsExceptionForDifferentStatusCode(): void
{
$response = $this->createMock(Response::class);
$response->expects(self::exactly(2))->method('getStatusCode')->willReturn(201);
$response->expects($this->exactly(2))->method('getStatusCode')->willReturn(201);

$constraint = new ResponseStatusCodeSame(200);

Expand Down