Skip to content

Commit

Permalink
bug #11778 Fixed compatibility with newer version of data collectors …
Browse files Browse the repository at this point in the history
…(stloyd)

This PR was merged into the 1.8 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.8
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | related #10928 
| License         | MIT

Error without this change:
```bash
HP Fatal error:  Declaration of Sylius\Bundle\ChannelBundle\Collector\ChannelCollector::collect(Symfony\Component\HttpFoundation\Request $request, Symfony\Component\HttpFoundation\Response $response, ?Exception $exception = NULL): void must be compatible with Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface::collect(Symfony\Component\HttpFoundation\Request $request, Symfony\Component\HttpFoundation\Response $response, ?Throwable $exception = NULL) in /var/www/dimedic-reports/current/vendor/sylius/sylius/src/Sylius/Bundle/ChannelBundle/Collector/ChannelCollector.php on line 61
```

<!--
 - Bug fixes must be submitted against the 1.7 branch (the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

b413575 Fixed compatibility with newer version of data collectors
  • Loading branch information
lchrusciel committed Sep 15, 2020
2 parents 96e2d85 + b413575 commit cd9f00a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function isChannelChangeSupported(): bool
return $this->data['channel_change_support'];
}

public function collect(Request $request, Response $response, \Exception $exception = null): void
public function collect(Request $request, Response $response, \Throwable $exception = null): void
{
try {
$this->data['channel'] = $this->pluckChannel($this->channelContext->getChannel());
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/CoreBundle/Collector/CartCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getStates(): ?array
return $this->data['states'];
}

public function collect(Request $request, Response $response, \Exception $exception = null): void
public function collect(Request $request, Response $response, \Throwable $exception = null): void
{
try {
/** @var OrderInterface $cart */
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/CoreBundle/Collector/SyliusCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getDefaultLocaleCode(): ?string
return $this->data['default_locale_code'];
}

public function collect(Request $request, Response $response, \Exception $exception = null): void
public function collect(Request $request, Response $response, \Throwable $exception = null): void
{
try {
/** @var ChannelInterface $channel */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(TemplateBlockRenderingHistory $templateBlockRenderin
$this->reset();
}

public function collect(Request $request, Response $response): void
public function collect(Request $request, Response $response, \Throwable $exception = null): void
{
$this->data['renderedEvents'] = $this->templateBlockRenderingHistory->getRenderedEvents();
}
Expand Down

0 comments on commit cd9f00a

Please sign in to comment.