Skip to content

Commit

Permalink
Upgrade (and pin) PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 committed Mar 14, 2024
1 parent 61c7f7e commit 972a27a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"facile-it/facile-coding-standard": "^0.4.1",
"facile-it/symfony-functional-testcase": "^1.0",
"infection/infection": "^0.18",
"jangregor/phpstan-prophecy": "^0.8.0",
"jangregor/phpstan-prophecy": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.25",
"phpstan/phpstan-phpunit": "^0.12.8",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "1.10.62",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^9.5.2",
"symfony/browser-kit": "^4.4 || ^5.0 || ^6.0",
"symfony/flex": "^1.12",
Expand Down
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,26 @@ parameters:
count: 1
path: src/Transport/Connection.php

-
message: "#^Method Facile\\\\MongoDbMessenger\\\\Transport\\\\Connection\\:\\:send\\(\\) should return MongoDB\\\\BSON\\\\ObjectId but returns mixed\\.$#"
count: 1
path: src/Transport/Connection.php

-
message: "#^Method Facile\\\\MongoDbMessenger\\\\Transport\\\\TransportFactory\\:\\:buildConfiguration\\(\\) should return array\\{connection_name\\: string, collection_name\\: string, queue_name\\: string, redeliver_timeout\\: int, document_enhancers\\: array\\<string\\>, resettable\\: 0\\|1\\|bool\\} but returns non\\-empty\\-array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: src/Transport/TransportFactory.php

-
message: "#^Parameter \\#1 \\$enhancer of method Facile\\\\MongoDbMessenger\\\\Transport\\\\Connection\\:\\:addDocumentEnhancer\\(\\) expects Facile\\\\MongoDbMessenger\\\\Extension\\\\DocumentEnhancer, object\\|null given\\.$#"
count: 1
path: src/Transport/TransportFactory.php

-
message: "#^Parameter \\#1 \\$enhancers of method Facile\\\\MongoDbMessenger\\\\Transport\\\\TransportFactory\\:\\:validateDocumentEnhancers\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 1
path: src/Transport/TransportFactory.php

-
message: "#^Constructor of class Facile\\\\MongoDbMessenger\\\\Tests\\\\Stubs\\\\NotInstantiableDocumentEnhancer has an unused parameter \\$bar\\.$#"
count: 1
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
dynamicConstantNames:
- Symfony\Component\HttpKernel\Kernel::VERSION_ID
ignoreErrors:
- /no value type specified in iterable type MongoDB\\Model\\BSONDocument\./
- /^Access to an undefined property MongoDB\\Model\\BSONDocument::\$\w+\.$/
includes:
- phpstan-baseline.neon
5 changes: 5 additions & 0 deletions tests/Stubs/InstantiableDocumentEnhancer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ public function __construct(\DateTime $foo = null)
public function enhance(BSONDocument $document, Envelope $envelope): void
{
}

public function getFoo(): ?\DateTime
{
return $this->foo;
}
}

0 comments on commit 972a27a

Please sign in to comment.