Skip to content

Commit

Permalink
Merge branch 'next-16272/cherry-pick-fixes-4' into '6.4.3.0'
Browse files Browse the repository at this point in the history
NEXT-16426 - Fix symfony compatibility for symfony < 5.3.4

See merge request shopware/6/product/platform!5973
  • Loading branch information
pweyck committed Jul 28, 2021
2 parents b653fe7 + 915a79d commit d121925
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/Core/Framework/Event/BusinessEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public function addSubscriber(EventSubscriberInterface $subscriber): void
$this->dispatcher->addSubscriber($subscriber);
}

public function removeListener(string $eventName, callable $listener): void
/**
* @param callable $listener can not use native type hint as it is incompatible with symfony <5.3.4
*/
public function removeListener(string $eventName, $listener): void
{
$this->dispatcher->removeListener($eventName, $listener);
}
Expand All @@ -86,7 +89,10 @@ public function getListeners(?string $eventName = null): array
return $this->dispatcher->getListeners($eventName);
}

public function getListenerPriority(string $eventName, callable $listener): ?int
/**
* @param callable $listener can not use native type hint as it is incompatible with symfony <5.3.4
*/
public function getListenerPriority(string $eventName, $listener): ?int
{
return $this->dispatcher->getListenerPriority($eventName, $listener);
}
Expand Down
10 changes: 8 additions & 2 deletions src/Core/Framework/Event/NestedEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public function addSubscriber(EventSubscriberInterface $subscriber): void
$this->dispatcher->addSubscriber($subscriber);
}

public function removeListener(string $eventName, callable $listener): void
/**
* @param callable $listener can not use native type hint as it is incompatible with symfony <5.3.4
*/
public function removeListener(string $eventName, $listener): void
{
$this->dispatcher->removeListener($eventName, $listener);
}
Expand All @@ -60,7 +63,10 @@ public function getListeners(?string $eventName = null): array
return $this->dispatcher->getListeners($eventName);
}

public function getListenerPriority(string $eventName, callable $listener): ?int
/**
* @param callable $listener can not use native type hint as it is incompatible with symfony <5.3.4
*/
public function getListenerPriority(string $eventName, $listener): ?int
{
return $this->dispatcher->getListenerPriority($eventName, $listener);
}
Expand Down
5 changes: 4 additions & 1 deletion src/Core/Framework/Validation/HappyPathValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public function hasMetadataFor($value)
return $this->inner->hasMetadataFor($value);
}

public function validateProperty(object $object, $propertyName, $groups = null)
/**
* @param object $object can not use native type hint as it is incompatible with symfony <5.3.4
*/
public function validateProperty($object, $propertyName, $groups = null)
{
return $this->inner->validateProperty($object, $propertyName, $groups);
}
Expand Down

0 comments on commit d121925

Please sign in to comment.