Skip to content

[FrameworkBundle] drop hard dependency on the Stopwatch component #23148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPGRADE-3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Finder
FrameworkBundle
---------------

* The `symfony/stopwatch` dependency has been removed, require it via `composer
require symfony/stopwatch` in your `dev` environment.
* Using the `KERNEL_DIR` environment variable or the automatic guessing based
on the `phpunit.xml` / `phpunit.xml.dist` file location is deprecated since 3.4.
Set the `KERNEL_CLASS` environment variable to the fully-qualified class name
Expand Down
6 changes: 4 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ CHANGELOG
3.4.0
-----

* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.
* The `symfony/stopwatch` dependency has been removed, require it via `composer
require symfony/stopwatch` in your `dev` environment.
* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.

3.3.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Validator\ConstraintValidatorInterface;
use Symfony\Component\Validator\ObjectInitializerInterface;
use Symfony\Component\WebLink\HttpHeaderSerializer;
Expand Down Expand Up @@ -639,9 +640,14 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
{
$loader->load('debug_prod.xml');

if (class_exists(Stopwatch::class)) {
$container->register('debug.stopwatch', Stopwatch::class);
$container->setAlias(Stopwatch::class, 'debug.stopwatch');
}

$debug = $container->getParameter('kernel.debug');

if ($debug) {
if ($debug && class_exists(Stopwatch::class)) {
$loader->load('debug.xml');
}

Expand Down Expand Up @@ -881,7 +887,7 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder

$container->setParameter('templating.helper.form.resources', $config['form']['resources']);

if ($container->getParameter('kernel.debug')) {
if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class)) {
$loader->load('templating_debug.xml');

$container->setDefinition('templating.engine.php', $container->findDefinition('debug.templating.engine.php'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
<argument>true</argument>
</service>

<service id="debug.stopwatch" class="Symfony\Component\Stopwatch\Stopwatch" public="true" />
<service id="Symfony\Component\Stopwatch\Stopwatch" alias="debug.stopwatch" />

<service id="debug.file_link_formatter" class="Symfony\Component\HttpKernel\Debug\FileLinkFormatter">
<argument>%debug.file_link_format%</argument>
</service>
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"symfony/filesystem": "~2.8|~3.0|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0",
"symfony/routing": "~3.4|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0",
"doctrine/cache": "~1.0"
},
"require-dev": {
Expand All @@ -47,6 +46,7 @@
"symfony/security-core": "~3.2|~4.0",
"symfony/security-csrf": "~2.8|~3.0|~4.0",
"symfony/serializer": "~3.3|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0",
"symfony/translation": "~3.2|~4.0",
"symfony/templating": "~2.8|~3.0|~4.0",
"symfony/validator": "~3.3|~4.0",
Expand Down