diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a625464..d877591 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -80,21 +80,11 @@ parameters: count: 1 path: src/Altair/Cookie/Collection/CookieCollection.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Altair/Cookie/Collection/CookieCollection.php - - message: "#^Class Altair\\\\Cookie\\\\Collection\\\\SetCookieCollection extends generic class Altair\\\\Structure\\\\Map but does not specify its types\\: TKey, TValue$#" count: 1 path: src/Altair/Cookie/Collection/SetCookieCollection.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Altair/Cookie/Collection/SetCookieCollection.php - - message: "#^Method Altair\\\\Courier\\\\Contracts\\\\CommandMiddlewareInterface\\:\\:handle\\(\\) has no return type specified\\.$#" count: 1 @@ -105,11 +95,6 @@ parameters: count: 1 path: src/Altair/Courier/Middleware/CommandLockerMiddleware.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Altair/Courier/Service/InMemoryCommandLocatorService.php - - message: "#^Method Altair\\\\Courier\\\\Strategy\\\\CommandRunnerMiddlewareStrategy\\:\\:__construct\\(\\) has parameter \\$middlewares with no value type specified in iterable type array\\.$#" count: 1 @@ -125,11 +110,6 @@ parameters: count: 1 path: src/Altair/Courier/Strategy/CommandRunnerMiddlewareStrategy.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Altair/Courier/Strategy/CommandRunnerMiddlewareStrategy.php - - message: "#^PHPDoc tag @var for property Altair\\\\Http\\\\Base\\\\Payload\\:\\:\\$settingsCollection with type Altair\\\\Structure\\\\Map\\|null is not subtype of native type Altair\\\\Http\\\\Collection\\\\SettingsCollection\\.$#" count: 1 @@ -295,16 +275,6 @@ parameters: count: 1 path: src/Altair/Session/Handler/PdoSessionHandler.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 10 - path: src/Altair/Structure/Map.php - - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Altair/Structure/Pair.php - - message: "#^Property Altair\\\\Structure\\\\PriorityNode\\\\:\\:\\$priority \\(int\\) does not accept null\\.$#" count: 1 @@ -315,26 +285,6 @@ parameters: count: 1 path: src/Altair/Structure/PriorityNode.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Altair/Structure/PriorityQueue.php - - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 2 - path: src/Altair/Structure/Queue.php - - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 7 - path: src/Altair/Structure/Set.php - - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 2 - path: src/Altair/Structure/Stack.php - - message: "#^Binary operation \"\\*\\=\" between non\\-empty\\-string and 2 results in an error\\.$#" count: 1 diff --git a/src/Altair/Courier/Service/InMemoryCommandLocatorService.php b/src/Altair/Courier/Service/InMemoryCommandLocatorService.php index 9f6167d..6441537 100644 --- a/src/Altair/Courier/Service/InMemoryCommandLocatorService.php +++ b/src/Altair/Courier/Service/InMemoryCommandLocatorService.php @@ -17,6 +17,9 @@ use Altair\Courier\Support\MessageCommandMap; use Override; +/** + * @phpstan-consistent-constructor + */ class InMemoryCommandLocatorService implements InMemoryCommandLocatorServiceInterface { protected MessageCommandMap $map; diff --git a/src/Altair/Courier/Strategy/CommandRunnerMiddlewareStrategy.php b/src/Altair/Courier/Strategy/CommandRunnerMiddlewareStrategy.php index 9f2227d..a40c983 100644 --- a/src/Altair/Courier/Strategy/CommandRunnerMiddlewareStrategy.php +++ b/src/Altair/Courier/Strategy/CommandRunnerMiddlewareStrategy.php @@ -19,6 +19,9 @@ use Closure; use Override; +/** + * @phpstan-consistent-constructor + */ class CommandRunnerMiddlewareStrategy implements CommandRunnerStrategyInterface { /** diff --git a/src/Altair/Structure/Map.php b/src/Altair/Structure/Map.php index 380bcc0..ef4e210 100644 --- a/src/Altair/Structure/Map.php +++ b/src/Altair/Structure/Map.php @@ -43,6 +43,8 @@ * @implements MapInterface * @implements IteratorAggregate * @implements ArrayAccess + * + * @phpstan-consistent-constructor */ class Map implements IteratorAggregate, ArrayAccess, MapInterface, CapacityInterface { diff --git a/src/Altair/Structure/Pair.php b/src/Altair/Structure/Pair.php index abf3821..836e877 100644 --- a/src/Altair/Structure/Pair.php +++ b/src/Altair/Structure/Pair.php @@ -26,6 +26,8 @@ * @template TValue * * @implements PairInterface + * + * @phpstan-consistent-constructor */ class Pair implements PairInterface, JsonSerializable, Stringable { diff --git a/src/Altair/Structure/PriorityQueue.php b/src/Altair/Structure/PriorityQueue.php index 330822a..87b7a00 100644 --- a/src/Altair/Structure/PriorityQueue.php +++ b/src/Altair/Structure/PriorityQueue.php @@ -35,6 +35,8 @@ * * @implements CollectionInterface * @implements IteratorAggregate + * + * @phpstan-consistent-constructor */ class PriorityQueue implements IteratorAggregate, CollectionInterface { diff --git a/src/Altair/Structure/Queue.php b/src/Altair/Structure/Queue.php index dc2274f..1960b43 100644 --- a/src/Altair/Structure/Queue.php +++ b/src/Altair/Structure/Queue.php @@ -36,6 +36,8 @@ * @implements QueueInterface * @implements IteratorAggregate * @implements ArrayAccess + * + * @phpstan-consistent-constructor */ class Queue implements IteratorAggregate, ArrayAccess, QueueInterface, CapacityInterface { diff --git a/src/Altair/Structure/Set.php b/src/Altair/Structure/Set.php index 81357cb..15c6fd7 100644 --- a/src/Altair/Structure/Set.php +++ b/src/Altair/Structure/Set.php @@ -42,6 +42,8 @@ * @implements SetInterface * @implements IteratorAggregate * @implements ArrayAccess + * + * @phpstan-consistent-constructor */ class Set implements IteratorAggregate, ArrayAccess, SetInterface, CapacityInterface { diff --git a/src/Altair/Structure/Stack.php b/src/Altair/Structure/Stack.php index 9de306b..6732f13 100644 --- a/src/Altair/Structure/Stack.php +++ b/src/Altair/Structure/Stack.php @@ -37,6 +37,8 @@ * @implements StackInterface * @implements IteratorAggregate * @implements ArrayAccess + * + * @phpstan-consistent-constructor */ class Stack implements IteratorAggregate, ArrayAccess, StackInterface, CapacityInterface {