10000 Remove BC layers related to new methods and new parameters · symfony/symfony@966fc8c · GitHub
[go: up one dir, main page]

Skip to content

Commit 966fc8c

Browse files
Remove BC layers related to new methods and new parameters
1 parent 06adee2 commit 966fc8c

33 files changed

+202
-134
lines changed

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

+49-46
Large diffs are not rendered by default.

UPGRADE-7.0.md

+49-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Console
1616
* Remove `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead
1717
* Passing null to `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` must be done explicitly
1818
* Remove `StringInput::REGEX_STRING`
19+
* Add method `__toString()` to `InputInterface`
1920

2021
DependencyInjection
2122
-------------------
@@ -28,6 +29,8 @@ DependencyInjection
2829
* Remove `PhpDumper` options `inline_factories_parameter` and `inline_class_loader_parameter`, use options `inline_factories` and `inline_class_loader` instead
2930
* Parameter names of `ParameterBag` cannot be numerics
3031
* Remove `ContainerAwareInterface` and `ContainerAwareTrait`, use dependency injection instead
32+
* Add argument `$id` and `$asGhostObject` to `DumperInterface::isProxyCandidate()` and `getProxyCode()`
33+
* Add argument `$source` to `FileLoader::registerClasses()`
3134

3235
DoctrineBridge
3336
--------------
@@ -42,6 +45,16 @@ DoctrineBridge
4245
* DoctrineBridge now requires `doctrine/event-manager:^2`
4346
* Add parameter `$isSameDatabase` to `DoctrineTokenProvider::configureSchema()`
4447

48+
Filesystem
49+
----------
50+
51+
* Add argument `$lock` to `Filesystem::appendToFile()`
52+
53+
FrameworkBundle
54+
---------------
55+
56+
* Remove command `translation:update`, use `translation:extract` instead
57+
4558
HttpFoundation
4659
--------------
4760

@@ -55,6 +68,11 @@ HttpFoundation
5568
* Remove `Request::getContentType()`, use `Request::getContentTypeFormat()` instead
5669
* Throw an `InvalidArgumentException` when calling `Request::create()` with a malformed URI
5770

71+
HttpKernel
72+
----------
73+
74+
* Add argument `$reflector` to `ArgumentResolverInterface::getArguments()` and `ArgumentMetadataFactoryInterface::createArgumentMetadata()`
75+
5876
Lock
5977
----
6078

@@ -65,11 +83,27 @@ Messenger
6583

6684
* Add parameter `$isSameDatabase` to `DoctrineTransport::configureSchema()`
6785

86+
PropertyAccess
87+
--------------
88+
89+
* Add method `isNullSafe()` to `PropertyPathInterface`
90+
6891
ProxyManagerBridge
6992
------------------
7093

7194
* Remove the bridge, use VarExporter's lazy objects instead
7295

96+
Routing
97+
-------
98+
99+
* Add argument `$routeParameters` to `UrlMatcher::handleRouteRequirements()`
100+
101+
Security
102+
--------
103+
104+
* Add argument `$badgeFqcn` to `Passport::addBadge()`
105+
* Add argument `$lifetime` to `LoginLinkHandlerInterface::createLoginLink()`
106+
73107
SecurityBundle
74108
--------------
75109

@@ -78,11 +112,23 @@ SecurityBundle
78112
Serializer
79113
----------
80114

115+
* Add method `getSupportedTypes()` to `DenormalizerInterface` and `NormalizerInterface`
81116
* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
82117
* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error`
83118
* Remove `ContextAwareDenormalizerInterface`, use `DenormalizerInterface` instead
84119
* Remove `ContextAwareNormalizerInterface`, use `NormalizerInterface` instead
85120
* Remove `CacheableSupportsMethodInterface`, use `NormalizerInterface` and `DenormalizerInterface` instead
86-
* First argument of `ClassMetadata::setSerializedName()` is now required
87-
* Third argument `array $context = []` of the `NormalizerInterface::supportsNormalization()` is now required
88-
* Fourth argument `array $context = []` of the `DenormalizerInterface::supportsDenormalization()` is now required
121+
* First argument of `AttributeMetadata::setSerializedName()` is now required
122+
* Add argument `$context` to `NormalizerInterface::supportsNormalization()` and `DenormalizerInterface::supportsDenormalization()`
123+
124+
Validator
125+
---------
126+
127+
* Add methods `getConstraint()`, `getCause()` and `__toString()` to `ConstraintViolationInterface`
128+
* Add method `__toString()` to `ConstraintViolationListInterface`
129+
* Add method `disableTranslation()` to `ConstraintViolationBuilderInterface`
130+
131+
VarDumper
132+
---------
133+
134+
* Add argument `$label` to `VarDumper::dump()`

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Remove command `translation:update`, use `translation:extract` instead
8+
49
6.3
510
---
611

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

-4
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
127127
$io = new SymfonyStyle($input, $output);
128128
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
129129

130-
if ('translation:update' === $input->getFirstArgument()) {
131-
$errorIo->caution('Command "translation:update" is deprecated since version 5.4 and will be removed in Symfony 6.0. Use "translation:extract" instead.');
132-
}
133-
134130
$io = new SymfonyStyle($input, $output);
135131
$errorIo = $io->getErrorStyle();
136132

src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php

-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ class TranslationUpdateCommandTest extends TestCase
2929
private $fs;
3030
private $translationDir;
3131

32-
public function testDumpMessagesAndCleanWithDeprecatedCommandName()
33-
{
34-
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
35-
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]);
36-
$this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
37-
$this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
38-
}
39-
4032
public function testDumpMessagesAndClean()
4133
{
4234
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);

src/Symfony/Component/Console/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
7.0
55
---
66

7+
* Add method `__toString()` to `InputInterface`
78
* Remove `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead
89
* Passing null to `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` must be done explicitly
910
* Remove `StringInput::REGEX_STRING`

src/Symfony/Component/Console/Input/InputInterface.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
* InputInterface is the interface implemented by all input classes.
1919
*
2020
* @author Fabien Potencier <fabien@symfony.com>
21-
*
22-
* @method string __toString() Returns a stringified representation of the args passed to the command.
23-
* InputArguments MUST be escaped as well as the InputOption values passed to the command.
2421
*/
2522
interface InputInterface
2623
{
@@ -147,4 +144,11 @@ public function isInteractive(): bool;
147144
* @return void
148145
*/
149146
public function setInteractive(bool $interactive);
147+
148+
/**
149+
* Returns a stringified representation of the args passed to the command.
150+
*
151+
* InputArguments MUST be escaped as well as the InputOption values passed to the command.
152+
*/
153+
public function __toString(): string;
150154
}

src/Symfony/Component/DependencyInjection/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ CHANGELOG
1212
* Remove `PhpDumper` options `inline_factories_parameter` and `inline_class_loader_parameter`, use options `inline_factories` and `inline_class_loader` instead
1313
* Parameter names of `ParameterBag` cannot be numerics
1414
* Remove `ContainerAwareInterface` and `ContainerAwareTrait`, use dependency injection instead
15+
* Add argument `$id` and `$asGhostObject` to `DumperInterface::isProxyCandidate()` and `getProxyCode()`
16+
* Add argument `$source` to `FileLoader::registerClasses()`
1517

1618
6.4
1719
---

src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ interface DumperInterface
2323
/**
2424
* Inspects whether the given definitions should produce proxy instantiation logic in the dumped container.
2525
*
26-
* @param bool|null &$asGhostObject Set to true after the call if the proxy is a ghost object
27-
* @param string|null $id
26+
* @param bool|null &$asGhostObject Set to true after the call if the proxy is a ghost object
2827
*/
29-
public function isProxyCandidate(Definition $definition/* , bool &$asGhostObject = null, string $id = null */): bool;
28+
public function isProxyCandidate(Definition $definition, bool &$asGhostObject = null, string $id = null): bool;
3029

3130
/**
3231
* Generates the code to be used to instantiate a proxy in the dumped factory code.
@@ -35,8 +34,6 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
3534

3635
/**
3736
* Generates the code for the lazy proxy.
38-
*
39-
* @param string|null $id
4037
*/
41-
public function getProxyCode(Definition $definition/* , string $id = null */): string;
38+
public function getProxyCode(Definition $definition, string $id = null): string;
4239
}

src/Symfony/Component/DependencyInjection/Loader/FileLoader.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function import(mixed $resource, string $type = null, bool|string $ignore
9898
*
9999
* @return void
100100
*/
101-
public function registerClasses(Definition $prototype, string $namespace, string $resource, string|array $exclude = null/* , string $source = null */)
101+
public function registerClasses(Definition $prototype, string $namespace, string $resource, string|array $exclude = null, string $source = null)
102102
{
103103
if (!str_ends_with($namespace, '\\')) {
104104
throw new InvalidArgumentException(sprintf('Namespace prefix must end with a "\\": "%s".', $namespace));
@@ -115,7 +115,6 @@ public function registerClasses(Definition $prototype, string $namespace, string
115115
throw new InvalidArgumentException('The exclude list must not contain an empty value.');
116116
}
117117

118-
$source = \func_num_args() > 4 ? func_get_arg(4) : null;
119118
$autoconfigureAttributes = new RegisterAutoconfigureAttributesPass();
120119
$autoconfigureAttributes = $autoconfigureAttributes->accept($prototype) ? $autoconfigureAttributes : null;
121120
$classes = $this->findClasses($namespace, $resource, (array) $exclude, $autoconfigureAttributes, $source);

src/Symfony/Component/Filesystem/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Add argument `$lock` to `Filesystem::appendToFile()`
8+
49
5.4
510
---
611

src/Symfony/Component/Filesystem/Filesystem.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ public function dumpFile(string $filename, $content)
703703
*
704704
* @throws IOException If the file is not writable
705705
*/
706-
public function appendToFile(string $filename, $content/* , bool $lock = false */)
706+
public function appendToFile(string $filename, $content, bool $lock = false)
707707
{
708708
if (\is_array($content)) {
709709
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__));
@@ -715,8 +715,6 @@ public function appendToFile(string $filename, $content/* , bool $lock = false *
715715
$this->mkdir($dir);
716716
}
717717

718-
$lock = \func_num_args() > 2 && func_get_arg(2);
719-
720718
if (false === self::box('file_put_contents', $filename, $content, \FILE_APPEND | ($lock ? \LOCK_EX : 0))) {
721719
throw new IOException(sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename);
722720
}

src/Symfony/Component/HttpKernel/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Add argument `$reflector` to `ArgumentResolverInterface::getArguments()` and `ArgumentMetadataFactoryInterface::createArgumentMetadata()`
8+
49
6.4
510
---
611

src/Symfony/Component/HttpKernel/Controller/ArgumentResolverInterface.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ interface ArgumentResolverInterface
2424
/**
2525
* Returns the arguments to pass to the controller.
2626
*
27-
* @param \ReflectionFunctionAbstract|null $reflector
28-
*
2927
* @throws \RuntimeException When no value could be provided for a required argument
3028
*/
31-
public function getArguments(Request $request, callable $controller/* , \ReflectionFunctionAbstract $reflector = null */): array;
29+
public function getArguments(Request $request, callable $controller, \ReflectionFunctionAbstract $reflector = null): array;
3230
}

src/Symfony/Component/HttpKernel/Controller/TraceableArgumentResolver.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ public function __construct(ArgumentResolverInterface $resolver, Stopwatch $stop
2828
$this->stopwatch = $stopwatch;
2929
}
3030

31-
/**
32-
* @param \ReflectionFunctionAbstract|null $reflector
33-
*/
34-
public function getArguments(Request $request, callable $controller/* , \ReflectionFunctionAbstract $reflector = null */): array
31+
public function getArguments(Request $request, callable $controller, \ReflectionFunctionAbstract $reflector = null): array
3532
{
36-
$reflector = 2 < \func_num_args() ? func_get_arg(2) : null;
3733
$e = $this->stopwatch->start('controller.get_arguments');
3834

3935
try {

src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
interface ArgumentMetadataFactoryInterface
2020
{
2121
/**
22-
* @param \ReflectionFunctionAbstract|null $reflector
23-
*
2422
* @return ArgumentMetadata[]
2523
*/
26-
public function createArgumentMetadata(string|object|array $controller/* , \ReflectionFunctionAbstract $reflector = null */): array;
24+
public function createArgumentMetadata(string|object|array $controller, \ReflectionFunctionAbstract $reflector = null): array;
2725
}

src/Symfony/Component/PropertyAccess/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Add method `isNullSafe()` to `PropertyPathInterface`
8+
49
6.3
510
---
611

src/Symfony/Component/PropertyAccess/PropertyPathInterface.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*
1717
* @author Bernhard Schussek <bschussek@gmail.com>
1818
*
19-
* @method bool isNullSafe(int $index) Returns whether the element at the given index is null safe. Not implementing it is deprecated since Symfony 6.2
20-
*
2119
* @extends \Traversable<int, string>
2220
*/
2321
interface PropertyPathInterface extends \Traversable
@@ -85,4 +83,9 @@ public function isProperty(int $index);
8583
* @throws Exception\OutOfBoundsException If the offset is invalid
8684
*/
8785
public function isIndex(int $index);
86+
10000
87+
/**
88+
* Returns whether the element at the given index is null safe.
89+
*/
90+
public function isNullSafe(int $index): bool;
8891
}

src/Symfony/Component/Routing/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Add argument `$routeParameters` to `UrlMatcher::handleRouteRequirements()`
8+
49
6.4
510
---
611

src/Symfony/Component/Routing/Matcher/UrlMatcher.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,8 @@ protected function getAttributes(Route $route, string $name, array $attributes):
216216
*
217217
* @return array The first element represents the status, the second contains additional information
218218
*/
219-
protected function handleRouteRequirements(string $pathinfo, string $name, Route $route/* , array $routeParameters */): array
219+
protected function handleRouteRequirements(string $pathinfo, string $name, Route $route, array $routeParameters): array
220220
{
221-
if (\func_num_args() < 4) {
222-
trigger_deprecation('symfony/routing', '6.1', 'The "%s()" method will have a new "array $routeParameters" argument in version 7.0, not defining it is deprecated.', __METHOD__);
223-
$routeParameters = [];
224-
} else {
225-
$routeParameters = func_get_arg(3);
226-
227-
if (!\is_array($routeParameters)) {
228-
throw new \TypeError(sprintf('"%s": Argument $routeParameters is expected to be an array, got "%s".', __METHOD__, get_debug_type($routeParameters)));
229-
}
230-
}
231-
232221
// expression condition
233222
if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), [
234223
'context' => $this->context,

src/Symfony/Component/Security/Http/Authenticator/Passport/Passport.php

+5-11
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,15 @@ public function getUser(): UserInterface
6666
* This method replaces the current badge if it is already set on this
6767
* passport.
6868
*
69-
* @param string|null $badgeFqcn A FQCN to which the badge should be mapped to.
70-
* This allows replacing a built-in badge by a custom one using
71-
*. e.g. addBadge(new MyCustomUserBadge(), UserBadge::class)
69+
* @param string|null $badgeFqcn A FQCN to which the badge should be mapped to.
70+
* This allows replacing a built-in badge by a custom one using
71+
* e.g. addBadge(new MyCustomUserBadge(), UserBadge::class)
7272
*
7373
* @return $this
7474
*/
75-
public function addBadge(BadgeInterface $badge/* , string $badgeFqcn = null */): static
75+
public function addBadge(BadgeInterface $badge, string $badgeFqcn = null): static
7676
{
77-
$badgeFqcn = $badge::class;
78-
if (2 === \func_num_args()) {
79-
$badgeFqcn = func_get_arg(1);
80-
if (!\is_string($badgeFqcn)) {
81-
throw new \LogicException(sprintf('Second argument of "%s" must be a string.', __METHOD__));
82-
}
83-
}
77+
$badgeFqcn ??= $badge::class;
8478

8579
$this->badges[$badgeFqcn] = $badge;
8680

src/Symfony/Component/Security/Http/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Add argument `$badgeFqcn` to `Passport::addBadge()`
8+
* Add argument `$lifetime` to `LoginLinkHandlerInterface::createLoginLink()`
9+
410
6.3
511
---
612

0 commit comments

Comments
 (0)
0