Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8b33d15

Browse filesBrowse files
[DI] Remove remaining deprecated features
1 parent a55cbf8 commit 8b33d15
Copy full SHA for 8b33d15

24 files changed

+40
-928
lines changed

‎src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CHANGELOG
1919
* Removed absolute template paths support in the template name parser
2020
* Removed support of the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
2121
* Removed the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.
22+
* Removed the "framework.validation.cache" configuration option. Configure the "cache.validator" service under "framework.cache.pools" instead.
2223

2324
3.4.0
2425
-----

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-10Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,16 +1050,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
10501050
}
10511051
}
10521052

1053-
if (isset($config['cache']) && $config['cache']) {
1054-
@trigger_error('The "framework.validation.cache" option is deprecated since Symfony 3.2 and will be removed in 4.0. Configure the "cache.validator" service under "framework.cache.pools" instead.', E_USER_DEPRECATED);
1055-
1056-
$container->setParameter(
1057-
'validator.mapping.cache.prefix',
1058-
'validator_'.$this->getKernelRootHash($container)
1059-
);
1060-
1061-
$validatorBuilder->addMethodCall('setMetadataCache', array(new Reference($config['cache'])));
1062-
} elseif (!$container->getParameter('kernel.debug')) {
1053+
if (!$container->getParameter('kernel.debug')) {
10631054
$validatorBuilder->addMethodCall('setMetadataCache', array(new Reference('validator.mapping.cache.symfony')));
10641055
}
10651056
}

‎src/Symfony/Component/DependencyInjection/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ CHANGELOG
44
4.0.0
55
-----
66

7+
* removed autowiring services based on the types they implement
78
* added a third `$methodName` argument to the `getProxyFactoryCode()` method
89
of the `DumperInterface`
910
* removed support for autowiring types
1011
* removed `Container::isFrozen`
1112
* removed support for dumping an ucompiled container in `PhpDumper`
1213
* removed support for generating a dumped `Container` without populating the method map
1314
* removed support for case insensitive service identifiers
15+
* removed the `DefinitionDecorator` class, replaced by `ChildDefinition`
16+
* removed the `AutowireServiceResource` class and related `AutowirePass::createResourceForClass()` method
17+
* removed `LoggingFormatter`, `Compiler::getLoggingFormatter()` and `addLogMessage()` class and methods, use the `ContainerBuilder::log()` method instead
18+
* removed `FactoryReturnTypePass`
19+
* removed `ContainerBuilder::addClassResource()`, use the `addObjectResource()` or the `getReflectionClass()` method instead.
20+
* removed support for top-level anonymous services
21+
* removed silent behavior for unused attributes and elements
1422

1523
3.4.0
1624
-----

‎src/Symfony/Component/DependencyInjection/ChildDefinition.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ChildDefinition.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,3 @@ public function setInstanceofConditionals(array $instanceof)
121121
throw new BadMethodCallException('A ChildDefinition cannot have instanceof conditionals set on it.');
122122
}
123123
}
124-
125-
class_alias(ChildDefinition::class, DefinitionDecorator::class);

‎src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
+5-63Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Compiler;
1313

14-
use Symfony\Component\DependencyInjection\Config\AutowireServiceResource;
1514
use Symfony\Component\DependencyInjection\ContainerBuilder;
1615
use Symfony\Component\DependencyInjection\Definition;
1716
use Symfony\Component\DependencyInjection\Exception\AutowiringFailedException;
@@ -67,30 +66,6 @@ public function process(ContainerBuilder $container)
6766
}
6867
}
6968

70-
/**
71-
* Creates a resource to help know if this service has changed.
72-
*
73-
* @param \ReflectionClass $reflectionClass
74-
*
75-
* @return AutowireServiceResource
76-
*
77-
* @deprecated since version 3.3, to be removed in 4.0. Use ContainerBuilder::getReflectionClass() instead.
78-
*/
79-
public static function createResourceForClass(\ReflectionClass $reflectionClass)
80-
{
81-
@trigger_error('The '.__METHOD__.'() method is deprecated since version 3.3 and will be removed in 4.0. Use ContainerBuilder::getReflectionClass() instead.', E_USER_DEPRECATED);
82-
83-
$metadata = array();
84-
85-
foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
86-
if (!$reflectionMethod->isStatic()) {
87-
$metadata[$reflectionMethod->name] = self::getResourceMetadataForMethod($reflectionMethod);
88-
}
89-
}
90-
91-
return new AutowireServiceResource($reflectionClass->name, $reflectionClass->getFileName(), $metadata);
92-
}
93-
9469
/**
9570
* {@inheritdoc}
9671
*/
@@ -323,24 +298,15 @@ private function getAutowiredReference(TypedReference $reference, $deprecationMe
323298
return $reference;
324299
}
325300

326-
if (null === $this->types) {
327-
$this->populateAvailableTypes();
301+
if (!$reference->canBeAutoregistered()) {
302+
return;
328303
}
329304

330-
if (isset($this->types[$type])) {
331-
$message = 'Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won\'t be supported in version 4.0.';
332-
if ($aliasSuggestion = $this->getAliasesSuggestionForType($type = $reference->getType(), $deprecationMessage)) {
333-
$message .= ' '.$aliasSuggestion;
334-
} else {
335-
$message .= sprintf(' You should %s the "%s" service to "%s" instead.', isset($this->types[$this->types[$type]]) ? 'alias' : 'rename (or alias)', $this->types[$type], $type);
336-
}
337-
338-
@trigger_error($message, E_USER_DEPRECATED);
339-
340-
return new TypedReference($this->types[$type], $type);
305+
if (null === $this->types) {
306+
$this->populateAvailableTypes();
341307
}
342308

343-
if (!$reference->canBeAutoregistered() || isset($this->types[$type]) || isset($this->ambiguousServiceTypes[$type])) {
309+
if (isset($this->types[$type]) || isset($this->ambiguousServiceTypes[$type])) {
344310
return;
345311
}
346312

@@ -499,30 +465,6 @@ private function createTypeAlternatives(TypedReference $reference)
499465
return sprintf(' You should maybe alias this %s to %s.', class_exists($type, false) ? 'class' : 'interface', $message);
500466
}
501467

502-
/**
503-
* @deprecated since version 3.3, to be removed in 4.0.
504-
*/
505-
private static function getResourceMetadataForMethod(\ReflectionMethod $method)
506-
{
507-
$methodArgumentsMetadata = array();
508-
foreach ($method->getParameters() as $parameter) {
509-
try {
510-
$class = $parameter->getClass();
511-
} catch (\ReflectionException $e) {
512-
// type-hint is against a non-existent class
513-
$class = false;
514-
}
515-
516-
$methodArgumentsMetadata[] = array(
517-
'class' => $class,
518-
'isOptional' => $parameter->isOptional(),
519-
'defaultValue' => ($parameter->isOptional() && !$parameter->isVariadic()) ? $parameter->getDefaultValue() : null,
520-
);
521-
}
522-
523-
return $methodArgumentsMetadata;
524-
}
525-
526468
private function getAliasesSuggestionForType($type, $extraContext = null)
527469
{
528470
$aliases = array();

‎src/Symfony/Component/DependencyInjection/Compiler/Compiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/Compiler.php
-32Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,6 @@ public function getServiceReferenceGraph()
5252
return $this->serviceReferenceGraph;
5353
}
5454

55-
/**
56-
* Returns the logging formatter which can be used by compilation passes.
57-
*
58-
* @return LoggingFormatter
59-
*
60-
* @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.
61-
*/
62-
public function getLoggingFormatter()
63-
{
64-
if (null === $this->loggingFormatter) {
65-
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), E_USER_DEPRECATED);
66-
67-
$this->loggingFormatter = new LoggingFormatter();
68-
}
69-
70-
return $this->loggingFormatter;
71-
}
72-
7355
/**
7456
* Adds a pass to the PassConfig.
7557
*
@@ -82,20 +64,6 @@ public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BE
8264
$this->passConfig->addPass($pass, $type, $priority);
8365
}
8466

85-
/**
86-
* Adds a log message.
87-
*
88-
* @param string $string The log message
89-
*
90-
* @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.
91-
*/
92-
public function addLogMessage($string)
93-
{
94-
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), E_USER_DEPRECATED);
95-
96-
$this->log[] = $string;
97-
}
98-
9967
/**
10068
* @final
10169
*/

‎src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php
-108Lines changed: 0 additions & 108 deletions
This file was deleted.

‎src/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php
-54Lines changed: 0 additions & 54 deletions
This file was deleted.

‎src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct()
4141

4242
$this->beforeOptimizationPasses = array(
4343
100 => array(
44-
$resolveClassPass = new ResolveClassPass(),
44+
new ResolveClassPass(),
4545
new ResolveInstanceofConditionalsPass(),
4646
),
4747
);
@@ -53,7 +53,6 @@ public function __construct()
5353
new DecoratorServicePass(),
5454
new ResolveParameterPlaceHoldersPass(false),
5555
new ResolveFactoryClassPass(),
56-
new FactoryReturnTypePass($resolveClassPass),
5756
new CheckDefinitionValidityPass(),
5857
new RegisterServiceSubscribersPass(),
5958
new ResolveNamedArgumentsPass(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.