Skip to content

Commit

Permalink
fix exception, remove outdated code
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Jan 3, 2025
1 parent 7665f09 commit b785058
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions src/Command/EntityFinderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,19 +271,10 @@ private function createText(string $table, $id): string

private function runExtendEntityFinderEvent(string $table, $id, array $parents, bool $onlyText = false): ExtendEntityFinderEvent
{
/* @var ExtendEntityFinderEvent $event */
if (is_subclass_of($this->eventDispatcher, 'Symfony\Contracts\EventDispatcher\EventDispatcherInterface')) {
$event = $this->eventDispatcher->dispatch(
new ExtendEntityFinderEvent($table, $id, $parents, [], $this->entityFinderHelper, $onlyText),
ExtendEntityFinderEvent::class
);
} else {
/** @noinspection PhpParamsInspection */
$event = $this->eventDispatcher->dispatch(
ExtendEntityFinderEvent::class,
new ExtendEntityFinderEvent($table, $id, $parents, [], $this->entityFinderHelper, $onlyText)
);
}
$event = $this->eventDispatcher->dispatch(
new ExtendEntityFinderEvent($table, $id, $parents, [], $this->entityFinderHelper, $onlyText),
ExtendEntityFinderEvent::class
);

return $event;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Event/EntityFinderFindEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class EntityFinderFindEvent extends Event
{
private string $table;
private int $id;
private ?Element $element;
private ?Element $element = null;

public function __construct(string $table, int $id)
{
Expand Down

0 comments on commit b785058

Please sign in to comment.