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 00e1258

Browse filesBrowse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Bridge][Monolog] Add intruction about 'ResetLoggersWorkerSubscriber deprecation' in main UPGRADE-5.4.md [Security] Move TraceableAuthenticator to security-http [Form] Check the type of the constraints option Fixed default behavior
2 parents b86f88b + 8757fdd commit 00e1258
Copy full SHA for 00e1258

File tree

Expand file treeCollapse file tree

14 files changed

+121
-29
lines changed
Filter options
Expand file treeCollapse file tree

14 files changed

+121
-29
lines changed

‎UPGRADE-5.4.md

Copy file name to clipboardExpand all lines: UPGRADE-5.4.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ Messenger
4848
its default value will change to `true` in 6.0
4949
* Deprecate not setting the `reset_on_message` config option, its default value will change to `true` in 6.0
5050

51+
Monolog
52+
-------
53+
54+
* Deprecate `ResetLoggersWorkerSubscriber` to reset buffered logs in messenger
55+
workers, use "reset_on_message" option in messenger configuration instead.
56+
5157
SecurityBundle
5258
--------------
5359

‎UPGRADE-6.0.md

Copy file name to clipboardExpand all lines: UPGRADE-6.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Monolog
176176

177177
* The `$actionLevel` constructor argument of `Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy` has been replaced by the `$inner` one which expects an ActivationStrategyInterface to decorate instead. `Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy` is now final.
178178
* The `$actionLevel` constructor argument of `Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy` has been replaced by the `$inner` one which expects an ActivationStrategyInterface to decorate instead. `Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy` is now final.
179+
* Remove `ResetLoggersWorkerSubscriber` in favor of "reset_on_message" option in messenger configuration
179180

180181
Notifier
181182
--------

‎src/Symfony/Bundle/SecurityBundle/Debug/TraceableFirewallListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Debug/TraceableFirewallListener.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Debug;
1313

14-
use Symfony\Bundle\SecurityBundle\Debug\Authenticator\TraceableAuthenticatorManagerListener;
1514
use Symfony\Bundle\SecurityBundle\EventListener\FirewallListener;
1615
use Symfony\Bundle\SecurityBundle\Security\FirewallContext;
1716
use Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext;
1817
use Symfony\Component\HttpKernel\Event\RequestEvent;
18+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
1919
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
2020

2121
/**

‎src/Symfony/Bundle/SecurityBundle/Debug/TraceableListenerTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Debug/TraceableListenerTrait.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Debug;
1313

14-
use Symfony\Bundle\SecurityBundle\Debug\Authenticator\TraceableAuthenticatorManagerListener;
14+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
1515
use Symfony\Component\VarDumper\Caster\ClassStub;
1616

1717
/**

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\SecurityBundle\DependencyInjection;
1313

1414
use Symfony\Bridge\Twig\Extension\LogoutUrlExtension;
15-
use Symfony\Bundle\SecurityBundle\Debug\Authenticator\TraceableAuthenticatorManagerListener;
1615
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AuthenticatorFactoryInterface;
1716
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FirewallListenerFactoryInterface;
1817
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
@@ -41,6 +40,7 @@
4140
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
4241
use Symfony\Component\Security\Core\User\ChainUserProvider;
4342
use Symfony\Component\Security\Core\User\UserProviderInterface;
43+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
4444
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
4545

4646
/**

‎src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\Debug;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bundle\SecurityBundle\Debug\Authenticator\TraceableAuthenticatorManagerListener;
1615
use Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener;
1716
use Symfony\Bundle\SecurityBundle\Security\FirewallMap;
1817
use Symfony\Component\EventDispatcher\EventDispatcher;
@@ -23,6 +22,7 @@
2322
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2423
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2524
use Symfony\Component\Security\Http\Authentication\AuthenticatorManager;
25+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
2626
use Symfony\Component\Security\Http\Authenticator\InteractiveAuthenticatorInterface;
2727
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
2828
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;

‎src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Form\FormRendererInterface;
1919
use Symfony\Component\OptionsResolver\Options;
2020
use Symfony\Component\OptionsResolver\OptionsResolver;
21+
use Symfony\Component\Validator\Constraint;
2122
use Symfony\Component\Validator\Validator\ValidatorInterface;
2223
use Symfony\Contracts\Translation\TranslatorInterface;
2324

@@ -64,7 +65,7 @@ public function configureOptions(OptionsResolver $resolver)
6465
'allow_extra_fields' => false,
6566
'extra_fields_message' => 'This form should not contain extra fields.',
6667
]);
67-
68+
$resolver->setAllowedTypes('constraints', [Constraint::class, Constraint::class.'[]']);
6869
$resolver->setNormalizer('constraints', $constraintsNormalizer);
6970
}
7071

‎src/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Form\Tests\Extension\Core\Type\FormTypeTest;
1919
use Symfony\Component\Form\Tests\Extension\Core\Type\TextTypeTest;
2020
use Symfony\Component\Form\Tests\Fixtures\Author;
21+
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
2122
use Symfony\Component\Validator\Constraints\GroupSequence;
2223
use Symfony\Component\Validator\Constraints\Length;
2324
use Symfony\Component\Validator\Constraints\NotBlank;
@@ -59,6 +60,19 @@ public function testValidConstraint()
5960
$this->assertSame([$valid], $form->getConfig()->getOption('constraints'));
6061
}
6162

63+
public function testValidConstraintsArray()
64+
{
65+
$form = $this->createForm(['constraints' => [$valid = new Valid()]]);
66+
67+
$this->assertSame([$valid], $form->getConfig()->getOption('constraints'));
68+
}
69+
70+
public function testInvalidConstraint()
71+
{
72+
$this->expectException(InvalidOptionsException::class);
73+
$this->createForm(['constraints' => ['foo' => 'bar']]);
74+
}
75+
6276
public function testGroupSequenceWithConstraintsOption()
6377
{
6478
$form = Forms::createFormFactoryBuilder()

‎src/Symfony/Bundle/SecurityBundle/Debug/Authenticator/TraceableAuthenticator.php renamed to ‎src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticator.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bundle\SecurityBundle\Debug\Authenticator;
12+
namespace Symfony\Component\Security\Http\Authenticator\Debug;
1313

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
@@ -23,9 +23,9 @@
2323
use Symfony\Component\VarDumper\Caster\ClassStub;
2424

2525
/**
26-
* @author Robin Chalas <robin.chalas@gmail.com>
26+
* Collects info about an authenticator for debugging purposes.
2727
*
28-
* @internal
28+
* @author Robin Chalas <robin.chalas@gmail.com>
2929
*/
3030
final class TraceableAuthenticator implements AuthenticatorInterface, InteractiveAuthenticatorInterface, AuthenticationEntryPointInterface
3131
{
@@ -45,7 +45,7 @@ public function getInfo(): array
4545
'supports' => true,
4646
'passport' => $this->passport,
4747
'duration' => $this->duration,
48-
'stub' => $this->stub ?? $this->stub = new ClassStub(\get_class($this->authenticator)),
48+
'stub' => $this->stub ?? $this->stub = class_exists(ClassStub::class) ? new ClassStub(\get_class($this->authenticator)) : \get_class($this->authenticator),
4949
];
5050
}
5151

‎src/Symfony/Bundle/SecurityBundle/Debug/Authenticator/TraceableAuthenticatorManagerListener.php renamed to ‎src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticatorManagerListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/Debug/TraceableAuthenticatorManagerListener.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bundle\SecurityBundle\Debug\Authenticator;
12+
namespace Symfony\Component\Security\Http\Authenticator\Debug;
1313

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpKernel\Event\RequestEvent;
@@ -21,17 +21,17 @@
2121
* Decorates the AuthenticatorManagerListener to collect information about security authenticators.
2222
*
2323
* @author Robin Chalas <robin.chalas@gmail.com>
24-
*
25-
* @internal
2624
*/
27-
class TraceableAuthenticatorManagerListener extends AbstractListener
25+
final class TraceableAuthenticatorManagerListener extends AbstractListener
2826
{
2927
private $authenticationManagerListener;
3028
private $authenticatorsInfo = [];
29+
private $hasVardumper;
3130

3231
public function __construct(AuthenticatorManagerListener $authenticationManagerListener)
3332
{
3433
$this->authenticationManagerListener = $authenticationManagerListener;
34+
$this->hasVardumper = class_exists(ClassStub::class);
3535
}
3636

3737
public function supports(Request $request): ?bool
@@ -50,7 +50,7 @@ public function authenticate(RequestEvent $event): void
5050
foreach ($request->attributes->get('_security_skipped_authenticators') as $skippedAuthenticator) {
5151
$this->authenticatorsInfo[] = [
5252
'supports' => false,
53-
'stub' => new ClassStub(\get_class($skippedAuthenticator)),
53+
'stub' => $this->hasVardumper ? new ClassStub(\get_class($skippedAuthenticator)) : \get_class($skippedAuthenticator),
5454
'passport' => null,
5555
'duration' => 0,
5656
];
+39Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Security\Http\Tests\Authenticator\Debug;
13+
14+
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\HttpFoundation\Request;
16+
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
17+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator;
18+
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
19+
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
20+
21+
class TraceableAuthenticatorTest extends TestCase
22+
{
23+
public function testGetInfo()
24+
{
25+
$request = new Request();
26+
$passport = new SelfValidatingPassport(new UserBadge('robin', function () {}));
27+
28+
$authenticator = $this->createMock(AuthenticatorInterface::class);
29+
$authenticator
30+
->expects($this->once())
31+
->method('authenticate')
32+
->with($request)
33+
->willReturn($passport);
34+
35+
$traceable = new TraceableAuthenticator($authenticator);
36+
$this->assertSame($passport, $traceable->authenticate($request));
37+
$this->assertSame($passport, $traceable->getInfo()['passport']);
38+
}
39+
}

‎src/Symfony/Component/Validator/Constraints/CssColor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/CssColor.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,22 @@ class CssColor extends Constraint
6565
/**
6666
* @param array|string $formats The types of CSS colors allowed (e.g. hexadecimal only, RGB and HSL only, etc.).
6767
*/
68-
public function __construct($formats, string $message = null, array $groups = null, $payload = null, array $options = null)
68+
public function __construct($formats = [], string $message = null, array $groups = null, $payload = null, array $options = null)
6969
{
70-
$validationModesAsString = array_reduce(self::$validationModes, function ($carry, $value) {
71-
return $carry ? $carry.', '.$value : $value;
72-
}, '');
70+
$validationModesAsString = implode(', ', self::$validationModes);
7371

74-
if (\is_array($formats) && \is_string(key($formats))) {
72+
if (!$formats) {
73+
$options['value'] = self::$validationModes;
74+
} elseif (\is_array($formats) && \is_string(key($formats))) {
7575
$options = array_merge($formats, $options);
7676
} elseif (\is_array($formats)) {
77-
if ([] === array_intersect(static::$validationModes, $formats)) {
77+
if ([] === array_intersect(self::$validationModes, $formats)) {
7878
throw new InvalidArgumentException(sprintf('The "formats" parameter value is not valid. It must contain one or more of the following values: "%s".', $validationModesAsString));
7979
}
8080

8181
$options['value'] = $formats;
8282
} elseif (\is_string($formats)) {
83-
if (!\in_array($formats, static::$validationModes)) {
83+
if (!\in_array($formats, self::$validationModes)) {
8484
throw new InvalidArgumentException(sprintf('The "formats" parameter value is not valid. It must contain one or more of the following values: "%s".', $validationModesAsString));
8585
}
8686

‎src/Symfony/Component/Validator/Constraints/CssColorValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/CssColorValidator.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class CssColorValidator extends ConstraintValidator
3232
// List comes from https://drafts.csswg.org/css-color/#css-system-colors
3333
private const PATTERN_SYSTEM_COLORS = '/^(Canvas|CanvasText|LinkText|VisitedText|ActiveText|ButtonFace|ButtonText|ButtonBorder|Field|FieldText|Highlight|HighlightText|SelectedItem|SelectedItemText|Mark|MarkText|GrayText)$/i';
3434
private const PATTERN_KEYWORDS = '/^(transparent|currentColor)$/i';
35-
private const PATTERN_RGB = '/^rgb\((0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s?(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s?(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\)$/i';
36-
private const PATTERN_RGBA = '/^rgba\((0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s?(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s?(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s?(0|0?\.\d|1(\.0)?)\)$/i';
37-
private const PATTERN_HSL = '/^hsl\((0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s?(0|100|\d{1,2})%,\s?(0|100|\d{1,2})%\)$/i';
38-
private const PATTERN_HSLA = '/^hsla\((0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s?(0|100|\d{1,2})%,\s?(0|100|\d{1,2})%,\s?(0?\.\d|1(\.0)?)\)$/i';
35+
private const PATTERN_RGB = '/^rgb\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\s*\)$/i';
36+
private const PATTERN_RGBA = '/^rgba\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|0?\.\d|1(\.0)?)\s*\)$/i';
37+
private const PATTERN_HSL = '/^hsl\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%\s*\)$/i';
38+
private const PATTERN_HSLA = '/^hsla\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%,\s*(0?\.\d|1(\.0)?)\s*\)$/i';
3939

4040
private const COLOR_PATTERNS = [
4141
CssColor::HEX_LONG => self::PATTERN_HEX_LONG,

‎src/Symfony/Component/Validator/Tests/Constraints/CssColorValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/CssColorValidatorTest.php
+35-4Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,33 @@ public function testExpectsStringCompatibleType()
4343
$this->validator->validate(new \stdClass(), new CssColor(CssColor::HEX_LONG));
4444
}
4545

46+
/**
47+
* @dataProvider getValidAnyColor
48+
*/
49+
public function testValidAnyColor($cssColor)
50+
{
51+
$this->validator->validate($cssColor, new CssColor());
52+
$this->assertNoViolation();
53+
}
54+
55+
public function getValidAnyColor(): array
56+
{
57+
return [
58+
['#ABCDEF'],
59+
['#ABCDEF00'],
60+
['#F4B'],
61+
['#F4B1'],
62+
['black'],
63+
['aliceblue'],
64+
['Canvas'],
65+
['transparent'],
66+
['rgb(255, 255, 255)'],
67+
['rgba(255, 255, 255, 0.3)'],
68+
['hsl(0, 0%, 20%)'],
69+
['hsla(0, 0%, 20%, 0.4)'],
70+
];
71+
}
72+
4673
/**
4774
* @dataProvider getValidHexLongColors
4875
*/
@@ -177,6 +204,7 @@ public function testValidRGB($cssColor)
177204
public function getValidRGB(): array
178205
{
179206
return [
207+
['rgb(0, 255, 243)'],
180208
['rgb(255, 255, 255)'], ['rgb(0, 0, 0)'], ['rgb(0, 0, 255)'], ['rgb(255, 0, 0)'], ['rgb(122, 122, 122)'], ['rgb(66, 66, 66)'],
181209
['rgb(255,255,255)'], ['rgb(0,0,0)'], ['rgb(0,0,255)'], ['rgb(255,0,0)'], ['rgb(122,122,122)'], ['rgb(66,66,66)'],
182210
];
@@ -194,6 +222,7 @@ public function testValidRGBA($cssColor)
194222
public function getValidRGBA(): array
195223
{
196224
return [
225+
['rgba( 255, 255, 255, 0.3 )'], ['rgba(255, 255, 255, 0.3)'], ['rgba(255, 255, 255, .3)'],
197226
['rgba(255, 255, 255, 0.3)'], ['rgba(0, 0, 0, 0.3)'], ['rgba(0, 0, 255, 0.3)'], ['rgba(255, 0, 0, 0.3)'], ['rgba(122, 122, 122, 0.3)'], ['rgba(66, 66, 66, 0.3)'],
198227
['rgba(255,255,255,0.3)'], ['rgba(0,0,0,0.3)'], ['rgba(0,0,255,0.3)'], ['rgba(255,0,0,0.3)'], ['rgba(122,122,122,0.3)'], ['rgba(66,66,66,0.3)'],
199228
];
@@ -211,6 +240,7 @@ public function testValidHSL($cssColor)
211240
public function getValidHSL(): array
212241
{
213242
return [
243+
['hsl(0, 0%, 20%)'], ['hsl( 0, 0%, 20% )'],
214244
['hsl(0, 0%, 20%)'], ['hsl(0, 100%, 50%)'], ['hsl(147, 50%, 47%)'], ['hsl(46, 100%, 0%)'],
215245
['hsl(0,0%,20%)'], ['hsl(0,100%,50%)'], ['hsl(147,50%,47%)'], ['hsl(46,100%,0%)'],
216246
];
@@ -228,6 +258,7 @@ public function testValidHSLA($cssColor)
228258
public function getValidHSLA(): array
229259
{
230260
return [
261+
['hsla( 0, 0%, 20%, 0.4 )'], ['hsla(0, 0%, 20%, 0.4)'], ['hsla(0, 0%, 20%, .4)'],
231262
['hsla(0, 0%, 20%, 0.4)'], ['hsla(0, 100%, 50%, 0.4)'], ['hsla(147, 50%, 47%, 0.4)'], ['hsla(46, 100%, 0%, 0.4)'],
232263
['hsla(0,0%,20%,0.4)'], ['hsla(0,100%,50%,0.4)'], ['hsla(147,50%,47%,0.4)'], ['hsla(46,100%,0%,0.4)'],
233264
];
@@ -313,7 +344,7 @@ public function testInvalidRGB($cssColor)
313344

314345
public function getInvalidRGB(): array
315346
{
316-
return [['rgb(999,999,999)'], ['rgb(-99,-99,-99)'], ['rgb(a,b,c)']];
347+
return [['rgb(999,999,999)'], ['rgb(-99,-99,-99)'], ['rgb(a,b,c)'], ['rgb(99 99, 9 99, 99 9)']];
317348
}
318349

319350
/**
@@ -336,7 +367,7 @@ public function testInvalidRGBA($cssColor)
336367

337368
public function getInvalidRGBA(): array
338369
{
339-
return [['rgba(999,999,999,999)'], ['rgba(-99,-99,-99,-99)'], ['rgba(a,b,c,d)']];
370+
return [['rgba(999,999,999,999)'], ['rgba(-99,-99,-99,-99)'], ['rgba(a,b,c,d)'], ['rgba(99 99, 9 99, 99 9, . 9)']];
340371
}
341372

342373
/**
@@ -359,7 +390,7 @@ public function testInvalidHSL($cssColor)
359390

360391
public function getInvalidHSL(): array
361392
{
362-
return [['hsl(1000, 1000%, 20000%)'], ['hsl(-100, -10%, -2%)'], ['hsl(a, b, c)'], ['hsl(a, b%, c%)']];
393+
return [['hsl(1000, 1000%, 20000%)'], ['hsl(-100, -10%, -2%)'], ['hsl(a, b, c)'], ['hsl(a, b%, c%)'], ['hsl( 99 99% , 9 99% , 99 9%)']];
363394
}
364395

365396
/**
@@ -382,7 +413,7 @@ public function testInvalidHSLA($cssColor)
382413

383414
public function getInvalidHSLA(): array
384415
{
385-
return [['hsla(1000, 1000%, 20000%, 999)'], ['hsla(-100, -10%, -2%, 999)'], ['hsla(a, b, c, d)'], ['hsla(a, b%, c%, d)']];
416+
return [['hsla(1000, 1000%, 20000%, 999)'], ['hsla(-100, -10%, -2%, 999)'], ['hsla(a, b, c, d)'], ['hsla(a, b%, c%, d)'], ['hsla( 9 99% , 99 9% , 9 %']];
386417
}
387418

388419
public function testUnknownFormatsOnValidateTriggerException()

0 commit comments

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