Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3306b31

Browse files
[7.0] Remove remaining deprecated code paths
1 parent 2b1eea4 commit 3306b31

File tree

125 files changed

+361
-3130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+361
-3130
lines changed

.github/expected-missing-return-types.diff

Lines changed: 87 additions & 133 deletions
Large diffs are not rendered by default.

UPGRADE-7.0.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,23 @@ Filesystem
5555

5656
* Add argument `$lock` to `Filesystem::appendToFile()`
5757

58+
Form
59+
----
60+
61+
* Throw when using `DateTime` or `DateTimeImmutable` model data with a different timezone than configured with the
62+
`model_timezone` option in `DateType`, `DateTimeType`, and `TimeType`
63+
* Make the "widget" option of date/time form types default to "single_text"
64+
5865
FrameworkBundle
5966
---------------
6067

6168
* Remove command `translation:update`, use `translation:extract` instead
69+
* Make the `http_method_override` config option default to `false`
70+
* Remove `AbstractController::renderForm()`, use `render()` instead
71+
* Remove the `Symfony\Component\Serializer\Normalizer\ObjectNormalizer` and
72+
`Symfony\Component\Serializer\Normalizer\PropertyNormalizer` autowiring aliases, type-hint against
73+
`Symfony\Component\Serializer\Normalizer\NormalizerInterface` or implement `NormalizerAwareInterface` instead
74+
* Remove the `Http\Client\HttpClient` service, use `Psr\Http\Client\ClientInterface` instead
6275

6376
HttpFoundation
6477
--------------
@@ -93,10 +106,22 @@ Lock
93106

94107
* Add parameter `$isSameDatabase` to `DoctrineDbalStore::configureSchema()`
95108

109+
Mailer
110+
------
111+
112+
* Remove the OhMySmtp bridge in favor of the MailPace bridge
113+
96114
Messenger
97115
---------
98116

99117
* Add parameter `$isSameDatabase` to `DoctrineTransport::configureSchema()`
118+
* Remove `MessageHandlerInterface` and `MessageSubscriberInterface`, use `#[AsMessageHandler]` instead
119+
* Remove `StopWorkerOnSigtermSignalListener` in favor of
120+
`StopWorkerOnSignalsListener` and make it configurable with SIGINT and
121+
* Remove `Symfony\Component\Messenger\Transport\InMemoryTransport` and
122+
`Symfony\Component\Messenger\Transport\InMemoryTransportFactory` in favor of
123+
`Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport` and
124+
`Symfony\Component\Messenger\Transport\InMemory\InMemoryTransportFactory`
100125

101126
PropertyAccess
102127
--------------
@@ -136,6 +161,18 @@ Serializer
136161
* First argument of `AttributeMetadata::setSerializedName()` is now required
137162
* Add argument `$context` to `NormalizerInterface::supportsNormalization()` and `DenormalizerInterface::supportsDenormalization()`
138163

164+
Translation
165+
-----------
166+
167+
* Remove `PhpStringTokenParser`
168+
* Remove `PhpExtractor` in favor of `PhpAstExtractor`
169+
170+
TwigBundle
171+
----------
172+
173+
* Remove option `twig.autoescape`, use `twig.autoescape_service[_method]` instead
174+
* Remove the `Twig_Environment` autowiring alias, use `Twig\Environment` instead
175+
139176
Validator
140177
---------
141178

@@ -150,3 +187,8 @@ VarDumper
150187
---------
151188

152189
* Add argument `$label` to `VarDumper::dump()`
190+
191+
Yaml
192+
----
193+
194+
* Remove the `!php/const:` tag, use `!php/const` instead (without the colon)

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
"pda/pheanstalk": "^4.0",
142142
"php-http/discovery": "^1.15",
143143
"php-http/httplug": "^1.0|^2.0",
144-
"php-http/message-factory": "^1.0",
145144
"phpdocumentor/reflection-docblock": "^5.2",
146145
"phpstan/phpdoc-parser": "^1.0",
147146
"predis/predis": "^1.1|^2.0",

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use Symfony\Component\DependencyInjection\Reference;
2323

2424
/**
25-
* Registers event listeners and subscribers to the available doctrine connections.
25+
* Registers event listeners to the available doctrine connections.
2626
*
2727
* @author Jeremy Mikola <[email protected]>
2828
* @author Alexander <[email protected]>
@@ -44,7 +44,7 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
4444
/**
4545
* @param string $managerTemplate sprintf() template for generating the event
4646
* manager's service ID for a connection name
47-
* @param string $tagPrefix Tag prefix for listeners and subscribers
47+
* @param string $tagPrefix Tag prefix for listeners
4848
*/
4949
public function __construct(string $connectionsParameter, string $managerTemplate, string $tagPrefix)
5050
{
@@ -72,18 +72,13 @@ public function process(ContainerBuilder $container): void
7272

7373
private function addTaggedServices(ContainerBuilder $container): array
7474
{
75-
$listenerTag = $this->tagPrefix.'.event_listener';
76-
$subscriberTag = $this->tagPrefix.'.event_subscriber';
7775
$listenerRefs = [];
78-
$taggedServices = $this->findAndSortTags($subscriberTag, $listenerTag, $container);
79-
8076
$managerDefs = [];
81-
foreach ($taggedServices as $taggedSubscriber) {
82-
[$tagName, $id, $tag] = $taggedSubscriber;
77+
foreach ($this->findAndSortTags($container) as [$id, $tag]) {
8378
$connections = isset($tag['connection'])
8479
? [$container->getParameterBag()->resolveValue($tag['connection'])]
8580
: array_keys($this->connections);
86-
if ($listenerTag === $tagName && !isset($tag['event'])) {
81+
if (!isset($tag['event'])) {
8782
throw new InvalidArgumentException(sprintf('Doctrine event listener "%s" must specify the "event" attribute.', $id));
8883
}
8984
foreach ($connections as $con) {
@@ -105,19 +100,10 @@ private function addTaggedServices(ContainerBuilder $container): array
105100
if (ContainerAwareEventManager::class === $managerClass) {
106101
$refs = $managerDef->getArguments()[1] ?? [];
107102
$listenerRefs[$con][$id] = new Reference($id);
108-
if ($subscriberTag === $tagName) {
109-
trigger_deprecation('symfony/doctrine-bridge', '6.3', 'Using Doctrine subscribers as services is deprecated, declare listeners instead');
110-
$refs[] = $id;
111-
} else {
112-
$refs[] = [[$tag['event']], $id];
113-
}
103+
$refs[] = [[$tag['event']], $id];
114104
$managerDef->setArgument(1, $refs);
115105
} else {
116-
if ($subscriberTag === $tagName) {
117-
$managerDef->addMethodCall('addEventSubscriber', [new Reference($id)]);
118-
} else {
119-
$managerDef->addMethodCall('addEventListener', [[$tag['event']], new Reference($id)]);
120-
}
106+
$managerDef->addMethodCall('addEventListener', [[$tag['event']], new Reference($id)]);
121107
}
122108
}
123109
}
@@ -144,21 +130,14 @@ private function getEventManagerDef(ContainerBuilder $container, string $name):
144130
* @see https://bugs.php.net/53710
145131
* @see https://bugs.php.net/60926
146132
*/
147-
private function findAndSortTags(string $subscriberTag, string $listenerTag, ContainerBuilder $container): array
133+
private function findAndSortTags(ContainerBuilder $container): array
148134
{
149135
$sortedTags = [];
150-
$taggedIds = [
151-
$subscriberTag => $container->findTaggedServiceIds($subscriberTag, true),
152-
$listenerTag => $container->findTaggedServiceIds($listenerTag, true),
153-
];
154-
$taggedIds[$subscriberTag] = array_diff_key($taggedIds[$subscriberTag], $taggedIds[$listenerTag]);
155-
156-
foreach ($taggedIds as $tagName => $serviceIds) {
157-
foreach ($serviceIds as $serviceId => $tags) {
158-
foreach ($tags as $attributes) {
159-
$priority = $attributes['priority'] ?? 0;
160-
$sortedTags[$priority][] = [$tagName, $serviceId, $attributes];
161-
}
136+
137+
foreach ($container->findTaggedServiceIds($this->tagPrefix.'.event_listener', true) as $serviceId => $tags) {
138+
foreach ($tags as $attributes) {
139+
$priority = $attributes['priority'] ?? 0;
140+
$sortedTags[$priority][] = [$serviceId, $attributes];
162141
}
163142
}
164143

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ protected function loadChoices(): iterable
5757
: $this->manager->getRepository($this->class)->findAll();
5858
}
5959

60-
/**
61-
* @internal to be remove in Symfony 6
62-
*/
6360
protected function doLoadValuesForChoices(array $choices): array
6461
{
6562
// Optimize performance for single-field identifiers. We already

0 commit comments

Comments
 (0)