Skip to content

Commit eeedec2

Browse files
authored
Fix deprecation notices in CommandLogger (#2485)
1 parent f5c1679 commit eeedec2

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public function unregister(): void
4444
$this->registered = false;
4545
}
4646

47-
public function commandStarted(CommandStartedEvent $event)
47+
public function commandStarted(CommandStartedEvent $event): void
4848
{
4949
$this->startedCommands[$event->getRequestId()] = $event;
5050
}
5151

52-
public function commandSucceeded(CommandSucceededEvent $event)
52+
public function commandSucceeded(CommandSucceededEvent $event): void
5353
{
5454
$commandStartedEvent = $this->findAndRemoveCommandStartedEvent($event->getRequestId());
5555
if (! $commandStartedEvent) {
@@ -59,7 +59,7 @@ public function commandSucceeded(CommandSucceededEvent $event)
5959
$this->logCommand(Command::createForSucceededCommand($commandStartedEvent, $event));
6060
}
6161

62-
public function commandFailed(CommandFailedEvent $event)
62+
public function commandFailed(CommandFailedEvent $event): void
6363
{
6464
$commandStartedEvent = $this->findAndRemoveCommandStartedEvent($event->getRequestId());
6565
if (! $commandStartedEvent) {

lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
* @internal
3939
*
40-
* @method ClassMetadata[] getAllMetadata()
40+
* @method list<ClassMetadata> getAllMetadata()
4141
* @method ClassMetadata[] getLoadedMetadata()
4242
* @method ClassMetadata getMetadataFor($className)
4343
*/

phpstan-baseline.neon

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ parameters:
137137
count: 1
138138
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
139139

140-
# 'strategy' offset is defined as nullable, but here there is no check here
141-
-
142-
message: "#^Offset 'strategy' does not exist on array\\{\\}\\|array\\{type\\?\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\}\\.$#"
143-
count: 1
144-
path: lib/Doctrine/ODM/MongoDB/UnitOfWork.php
145-
146140
# When iterating over SimpleXMLElement, we cannot know the key values
147141
-
148142
message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array#"
@@ -177,7 +171,7 @@ parameters:
177171
# compatibility layer for doctrine/persistence ^2.4 || ^3.0
178172
-
179173
message: "#.*#"
180-
count: 3
174+
count: 1
181175
path: lib/Doctrine/ODM/MongoDB/Event/OnClearEventArgs
182176

183177
-

0 commit comments

Comments
 (0)