8000 Fixed ater Wouter's review · symfony/symfony-docs@47a224a · GitHub
[go: up one dir, main page]

Skip to content

Commit 47a224a

Browse files
committed
Fixed ater Wouter's review
1 parent 597b75b commit 47a224a

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

bundles/override.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
How to Override any Part of a Bundle
55
====================================
66

7-
This document is a quick reference for how to override different parts of
8-
third-party bundles without using :doc:`/bundles/inheritance`, which was
9-
removed in Symfony 4.0.
7+
When using a third-party bundle, you might want to customize or override some of
8+
its features. This document describes ways of overriding the most common
9+
features of a bundle.
1010

1111
.. tip::
1212

components/console/events.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ thrown by the application.
9797
Listeners receive a
9898
:class:`Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent` event::
9999

100-
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
100+
use Symfony\Component\Console\Event\ConsoleErrorEvent;
101101
use Symfony\Component\Console\ConsoleEvents;
102102

103-
$dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleExceptionEvent $event) {
103+
$dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) {
104104
$output = $event->getOutput();
105105

106106
$command = $event->getCommand();
@@ -111,7 +111,7 @@ Listeners receive a
111111
$exitCode = $event->getExitCode();
112112

113113
// change the exception to another one
114-
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getException()));
114+
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getError()));
115115
});
116116

117117
The ``ConsoleEvents::TERMINATE`` Event

profiler/matchers.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,24 @@ How to Use Matchers to Enable the Profiler Conditionally
88

99
The possibility to use a matcher to enable the profiler conditionally was
1010
removed in Symfony 4.0.
11+
12+
Symfony Profiler cannot be enabled/disabled conditionally using matchers, because
13+
that feature was removed in Symfony 4.0. However, you can use the ``enable()``
14+
and ``disable()`` methods of the :class:`Symfony\\Component\\HttpKernel\\Profiler\\Profiler`
15+
class in your controllers to manage the profiler programmatically::
16+
17+
use Symfony\Component\HttpKernel\Profiler\Profiler;
18+
// ...
19+
20+
class DefaultController
21+
{
22+
// ...
23+
24+
public function someMethod(Profiler $profiler)
25+
{
26+
// for this particular controller action, the profiler is disabled
27+
$profiler->disable();
28+
29+
// ...
30+
}
31+
}

0 commit comments

Comments
 (0)
0