Skip to content

Commit

Permalink
Fix deprecation notices in CommandLogger (#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
IonBazan authored Nov 30, 2022
1 parent f5c1679 commit eeedec2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function unregister(): void
$this->registered = false;
}

public function commandStarted(CommandStartedEvent $event)
public function commandStarted(CommandStartedEvent $event): void
{
$this->startedCommands[$event->getRequestId()] = $event;
}

public function commandSucceeded(CommandSucceededEvent $event)
public function commandSucceeded(CommandSucceededEvent $event): void
{
$commandStartedEvent = $this->findAndRemoveCommandStartedEvent($event->getRequestId());
if (! $commandStartedEvent) {
Expand All @@ -59,7 +59,7 @@ public function commandSucceeded(CommandSucceededEvent $event)
$this->logCommand(Command::createForSucceededCommand($commandStartedEvent, $event));
}

public function commandFailed(CommandFailedEvent $event)
public function commandFailed(CommandFailedEvent $event): void
{
$commandStartedEvent = $this->findAndRemoveCommandStartedEvent($event->getRequestId());
if (! $commandStartedEvent) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @internal
*
* @method ClassMetadata[] getAllMetadata()
* @method list<ClassMetadata> getAllMetadata()
* @method ClassMetadata[] getLoadedMetadata()
* @method ClassMetadata getMetadataFor($className)
*/
Expand Down
8 changes: 1 addition & 7 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ parameters:
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php

# 'strategy' offset is defined as nullable, but here there is no check here
-
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, \\.\\.\\.\\}\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/UnitOfWork.php

# When iterating over SimpleXMLElement, we cannot know the key values
-
message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array#"
Expand Down Expand Up @@ -177,7 +171,7 @@ parameters:
# compatibility layer for doctrine/persistence ^2.4 || ^3.0
-
message: "#.*#"
count: 3
count: 1
path: lib/Doctrine/ODM/MongoDB/Event/OnClearEventArgs

-
Expand Down

0 comments on commit eeedec2

Please sign in to comment.