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

Skip to content

Commit 1077649

Browse files
committed
Removed legacy code and cleanup
1 parent 18793b7 commit 1077649

File tree

13 files changed

+10
-113
lines changed

13 files changed

+10
-113
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Form\Extension\Core\Type\PercentType;
1515
use Symfony\Component\Form\FormError;
16-
use Symfony\Component\Form\FormTypeExtensionInterface;
1716
use Symfony\Component\Form\Tests\AbstractLayoutTest;
1817

1918
abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
@@ -1689,34 +1688,6 @@ public function testDateTimeWithWidgetSingleText()
16891688
);
16901689
}
16911690

1692-
/**
1693-
* @group legacy
1694-
*/
1695-
public function testDateTimeWithWidgetSingleTextIgnoreDateAndTimeWidgets()
1696-
{
1697-
if (method_exists(FormTypeExtensionInterface::class, 'getExtendedTypes')) {
1698-
$this->markTestSkipped('The test requires symfony/form 4.x.');
1699-
}
1700-
1701-
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateTimeType', '2011-02-03 04:05:06', [
1702-
'input' => 'string',
1703-
'date_widget' => 'choice',
1704-
'time_widget' => 'choice',
1705-
'widget' => 'single_text',
1706-
'model_timezone' => 'UTC',
1707-
'view_timezone' => 'UTC',
1708-
]);
1709-
1710-
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
1711-
'/input
1712-
[@type="datetime-local"]
1713-
[@name="name"]
1714-
[@class="my&class form-control"]
1715-
[@value="2011-02-03T04:05:06"]
1716-
'
1717-
);
1718-
}
1719-
17201691
public function testDateChoice()
17211692
{
17221693
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', date('Y').'-02-03', [

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ CHANGELOG
1212
* Removed `LogoutUrlHelper` and `SecurityHelper` templating helpers, use Twig instead
1313
* Removed the `logout_on_user_change` firewall option
1414
* Removed the `threads` encoder option
15+
* Removed the `security.authentication.trust_resolver.anonymous_class` parameter
16+
* Removed the `security.authentication.trust_resolver.rememberme_class` parameter
1517

1618
4.3.0
1719
-----

src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
66

77
<parameters>
8-
<parameter key="security.authentication.trust_resolver.anonymous_class">null</parameter>
9-
<parameter key="security.authentication.trust_resolver.rememberme_class">null</parameter>
108
<parameter key="security.role_hierarchy.roles" type="collection" />
119
</parameters>
1210

@@ -49,10 +47,7 @@
4947
</service>
5048
<service id="Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface" alias="security.authentication.manager" />
5149

52-
<service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver">
53-
<argument>%security.authentication.trust_resolver.anonymous_class%</argument>
54-
<argument>%security.authentication.trust_resolver.rememberme_class%</argument>
55-
</service>
50+
<service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" />
5651

5752
<service id="security.authentication.session_strategy" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy">
5853
<argument>%security.authentication.session_strategy.strategy%</argument>

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CHANGELOG
1616
* removed the `regions` option of the `TimezoneType`
1717
* removed the `$scale` argument of the `IntegerToLocalizedStringTransformer`
1818
* removed `TemplatingExtension` and `TemplatingRendererEngine` classes, use Twig instead
19+
* passing a null message when instantiating a `Symfony\Component\Form\FormError` is not allowed
1920

2021
4.3.0
2122
-----

src/Symfony/Component/Form/FormError.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@ class FormError
4747
*
4848
* @see \Symfony\Component\Translation\Translator
4949
*/
50-
public function __construct(?string $message, string $messageTemplate = null, array $messageParameters = [], int $messagePluralization = null, $cause = null)
50+
public function __construct(string $message, string $messageTemplate = null, array $messageParameters = [], int $messagePluralization = null, $cause = null)
5151
{
52-
if (null === $message) {
53-
@trigger_error(sprintf('Passing a null message when instantiating a "%s" is deprecated since Symfony 4.4.', __CLASS__), E_USER_DEPRECATED);
54-
$message = '';
55-
}
56-
5752
$this->message = $message;
5853
$this->messageTemplate = $messageTemplate ?: $message;
5954
$this->messageParameters = $messageParameters;

src/Symfony/Component/HttpFoundation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* removed method `UploadedFile::getClientSize()` and the related constructor argument
1010
* made `Request::getSession()` throw if the session has not been set before
1111
* removed `Response::HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL`
12+
* passing a null url when instantiating a `egygfeggeewghgfewg` is not allowed
1213

1314
4.4.0
1415
-----

src/Symfony/Component/HttpFoundation/RedirectResponse.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ class RedirectResponse extends Response
3232
*
3333
* @see http://tools.ietf.org/html/rfc2616#section-10.3
3434
*/
35-
public function __construct(?string $url, int $status = 302, array $headers = [])
35+
public function __construct(string $url, int $status = 302, array $headers = [])
3636
{
37-
if (null === $url) {
38-
@trigger_error(sprintf('Passing a null url when instantiating a "%s" is deprecated since Symfony 4.4.', __CLASS__), E_USER_DEPRECATED);
39-
$url = '';
40-
}
41-
4237
parent::__construct('', $status, $headers);
4338

4439
$this->setTargetUrl($url);

src/Symfony/Component/OptionsResolver/OptionsResolver.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,6 @@ public function offsetGet($option, bool $triggerDeprecation = true)
846846
throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
847847
}
848848

849-
$triggerDeprecation = 1 === \func_num_args() || func_get_arg(1);
850-
851849
// Shortcut for resolved options
852850
if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) {
853851
if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option])) {

src/Symfony/Component/Security/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ CHANGELOG
2727
* Removed `ExpressionVoter::addExpressionLanguageProvider()`
2828
* Made `Security::getUser()` return null when the user is not an instanceof `UserInterface`,
2929
use `getToken()->getUser()` instead
30+
* Removed the `AuthenticationTrustResolver` constructor arguments
3031

3132
4.4.0
3233
-----

src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolver.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@
2222
*/
2323
class AuthenticationTrustResolver implements AuthenticationTrustResolverInterface
2424
{
25-
private $anonymousClass;
26-
private $rememberMeClass;
27-
28-
public function __construct(?string $anonymousClass = null, ?string $rememberMeClass = null)
29-
{
30-
$this->anonymousClass = $anonymousClass;
31-
$this->rememberMeClass = $rememberMeClass;
32-
33-
if (null !== $anonymousClass && !is_a($anonymousClass, AnonymousToken::class, true)) {
34-
@trigger_error(sprintf('Configuring a custom anonymous token class is deprecated since Symfony 4.2; have the "%s" class extend the "%s" class instead, and remove the "%s" constructor argument.', $anonymousClass, AnonymousToken::class, self::class), E_USER_DEPRECATED);
35-
}
36-
37-
if (null !== $rememberMeClass && !is_a($rememberMeClass, RememberMeToken::class, true)) {
38-
@trigger_error(sprintf('Configuring a custom remember me token class is deprecated since Symfony 4.2; have the "%s" class extend the "%s" class instead, and remove the "%s" constructor argument.', $rememberMeClass, RememberMeToken::class, self::class), E_USER_DEPRECATED);
39-
}
40-
}
41-
4225
/**
4326
* {@inheritdoc}
4427
*/
@@ -48,10 +31,6 @@ public function isAnonymous(TokenInterface $token = null)
4831
return false;
4932
}
5033

51-
if (null !== $this->anonymousClass) {
52-
return $token instanceof $this->anonymousClass;
53-
}
54-
5534
return $token instanceof AnonymousToken;
5635
}
5736

@@ -64,10 +43,6 @@ public function isRememberMe(TokenInterface $token = null)
6443
return false;
6544
}
6645

67-
if (null !== $this->rememberMeClass) {
68-
return $token instanceof $this->rememberMeClass;
69-
}
70-
7146
return $token instanceof RememberMeToken;
7247
}
7348

src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationTrustResolverTest.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -55,39 +55,6 @@ public function testisFullFledged()
5555
$this->assertTrue($resolver->isFullFledged(new FakeCustomToken()));
5656
}
5757

58-
/**
59-
* @group legacy
60-
* @expectedDeprecation Configuring a custom anonymous token class is deprecated since Symfony 4.2; have the "Symfony\Component\Security\Core\Tests\Authentication\FakeCustomToken" class extend the "Symfony\Component\Security\Core\Authentication\Token\AnonymousToken" class instead, and remove the "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" constructor argument.
61-
*/
62-
public function testsAnonymousDeprecationWithCustomClasses()
63-
{
64-
$resolver = new AuthenticationTrustResolver(FakeCustomToken::class);
65-
66-
$this->assertTrue($resolver->isAnonymous(new FakeCustomToken()));
67-
}
68-
69-
/**
70-
* @group legacy
71-
* @expectedDeprecation Configuring a custom remember me token class is deprecated since Symfony 4.2; have the "Symfony\Component\Security\Core\Tests\Authentication\FakeCustomToken" class extend the "Symfony\Component\Security\Core\Authentication\Token\RememberMeToken" class instead, and remove the "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" constructor argument.
72-
*/
73-
public function testIsRememberMeDeprecationWithCustomClasses()
74-
{
75-
$resolver = new AuthenticationTrustResolver(null, FakeCustomToken::class);
76-
77-
$this->assertTrue($resolver->isRememberMe(new FakeCustomToken()));
78-
}
79-
80-
/**
81-
* @group legacy
82-
* @expectedDeprecation Configuring a custom remember me token class is deprecated since Symfony 4.2; have the "Symfony\Component\Security\Core\Tests\Authentication\FakeCustomToken" class extend the "Symfony\Component\Security\Core\Authentication\Token\RememberMeToken" class instead, and remove the "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" constructor argument.
83-
*/
84-
public function testIsFullFledgedDeprecationWithCustomClasses()
85-
{
86-
$resolver = new AuthenticationTrustResolver(FakeCustomToken::class, FakeCustomToken::class);
87-
88-
$this->assertFalse($resolver->isFullFledged(new FakeCustomToken()));
89-
}
90-
9158
public function testIsAnonymousWithClassAsConstructorButStillExtending()
9259
{
9360
$resolver = $this->getResolver();

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CHANGELOG
1313
* removed support for using the `Expression` constraint without `symfony/expression-language`
1414
* changed default value of `canonicalize` option of `Locale` constraint to `true`
1515
* removed `ValidatorBuilderInterface`
16+
* passing a null message when instantiating a `ConstraintViolation` is not allowed
1617

1718
4.4.0
1819
-----

src/Symfony/Component/Validator/ConstraintViolation.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,8 @@ class ConstraintViolation implements ConstraintViolationInterface
4949
* caused the violation
5050
* @param mixed $cause The cause of the violation
5151
*/
52-
public function __construct(?string $message, ?string $messageTemplate, array $parameters, $root, ?string $propertyPath, $invalidValue, int $plural = null, $code = null, Constraint $constraint = null, $cause = null)
52+
public function __construct(string $message, ?string $messageTemplate, array $parameters, $root, ?string $propertyPath, $invalidValue, int $plural = null, $code = null, Constraint $constraint = null, $cause = null)
5353
{
54-
if (null === $message) {
55-
@trigger_error(sprintf('Passing a null message when instantiating a "%s" is deprecated since Symfony 4.4.', __CLASS__), E_USER_DEPRECATED);
56-
$message = '';
57-
}
58-
5954
$this->message = $message;
6055
$this->messageTemplate = $messageTemplate;
6156
$this->parameters = $parameters;

0 commit comments

Comments
 (0)