Skip to content

Commit 000a56a

Browse files
authored
Merge pull request #3790 from stephanvierkant/mercure-method-false
Allow method/property to return false
2 parents 9b6fd22 + 274d032 commit 000a56a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ private function storeEntityToPublish($entity, string $property): void
136136
}
137137

138138
$options = $this->resourceMetadataFactory->create($resourceClass)->getAttribute('mercure', false);
139-
if (false === $options) {
140-
return;
141-
}
142139

143140
if (\is_string($options)) {
144141
if (null === $this->expressionLanguage) {
@@ -148,6 +145,10 @@ private function storeEntityToPublish($entity, string $property): void
148145
$options = $this->expressionLanguage->evaluate($options, ['object' => $entity]);
149146
}
150147

148+
if (false === $options) {
149+
return;
150+
}
151+
151152
if (true === $options) {
152153
$options = [];
153154
}

0 commit comments

Comments
 (0)