Commit Graph

21956 Commits

Author SHA1 Message Date
Tobias Schultze
8a8a929d5c minor #15198 [HttpFoundation] Remove unused var (Dave Hulbert)
This PR was submitted for the 2.6 branch but it was merged into the 2.3 branch instead (closes #15198).

Discussion
----------

[HttpFoundation] Remove unused var

Minor. Looks like the var `$content` got introduced in aa5e6165, then in 8982c324 the early return meant it wasn't needed.

| Q             | A
| ------------- | ---
| Fixed tickets | N/A
| License       | MIT

Commits
-------

da5218f Remove var not used due to returning early (introduced in 8982c32)
2015-07-04 00:45:57 +02:00
Dave Hulbert
da5218f2ae Remove var not used due to returning early (introduced in 8982c32) 2015-07-04 00:45:56 +02:00
Kévin Dunglas
3233c2fc14 [Serializer] Fix Groups PHPDoc 2015-07-03 14:45:08 +02:00
Fabien Potencier
9fcad381be minor #15187 Enhance hhvm test skip message (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Enhance hhvm test skip message

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Reading our blog about hhvm (http://symfony.com/blog/symfony-2-3-achieves-100-hhvm-compatibility)
I'd like to improve the only single test skip in our code base that exists for hhvm.

HHVM does not trigger strict notices. This is a missing feature of the HHVM parser (https://github.com/facebook/hhvm/issues/5583). But this does not affect in any way the behavior of any PHP app. Strict notices are only for the dev stage.

There is some FUD-friendliness in the article and in the comments (no offence @javiereguiluz ☮):
100% hhvm compat is 100% honest. We did not skip any single tests because of errors, issues nor bugs. And the single missing "feature" of hhvm is this one: strict notices. Kudos to hhvm for what they did: parity is close enough so that the delta can be handled in exactly the same way as we handle deltas between PHP versions.

Commits
-------

5f4015c Enhance hhvm test skip message
2015-07-03 08:43:12 +02:00
Nicolas Grekas
5f4015c3cd Enhance hhvm test skip message 2015-07-03 07:54:45 +02:00
Diego Saint Esteben
f2fef91463 Removed deprecated code 2015-07-02 18:13:35 -03:00
Christian Flothmann
cf86a03b98 fix for legacy asset() with EmptyVersionStrategy 2015-07-02 23:04:32 +02:00
Fabien Potencier
2217c1faec minor #15174 [Form] Added upgrade notes for #15061 (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Added upgrade notes for #15061

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR contains the upgrade notes for #15061.

Commits
-------

6325b4c [Form] Added upgrade notes for #15061
2015-07-02 20:02:46 +02:00
Nicolas Grekas
8279d11ba9 Merge branch '2.8'
* 2.8:
  [VarDumper] Ingore PHPUnit and Prophecy object when they are nested
  [2.8] Fix lowest deps

Conflicts:
	.travis.yml
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
2015-07-02 17:20:21 +02:00
Nicolas Grekas
86e77eb36b feature #15175 [VarDumper] Ingore PHPUnit and Prophecy object when they are nested (lyrixx)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Ingore PHPUnit and Prophecy object when they are nested

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The purpose of this PR is to ignore nested PHPUnit/Prophecy object when `dump`ing.

Reproducer:

```php
$a = $this->getMock('Datetime');
$b = $this->prophesize('Datetime')->reveal();
$std = new \stdClass;
$std->my = 'property';
$std->a = $a;
$std->b = $b;

die(dump($a, $b, $std));
```

=>

```
{#86
  +"my": "property"
  +"a": Mock_Datetime_8ba7f351 {#22 …5}
  +"b": Double\DateTime\P1 {#90 …1}
}
```

Commits
-------

2bea373 [VarDumper] Ingore PHPUnit and Prophecy object when they are nested
2015-07-02 17:16:00 +02:00
Nicolas Grekas
60e1eed4e5 minor #15173 [2.8] Fix lowest deps (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8] Fix lowest deps

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Looks like that by testing the lowest deps on 5.3, we missed some constraints in our test suite.

Commits
-------

a036a77 [2.8] Fix lowest deps
2015-07-02 17:15:24 +02:00
Grégoire Pineau
2bea3731f9 [VarDumper] Ingore PHPUnit and Prophecy object when they are nested 2015-07-02 16:25:26 +02:00
Bernhard Schussek
6325b4caf6 [Form] Added upgrade notes for #15061 2015-07-02 11:55:36 +02:00
Nicolas Grekas
a036a77299 [2.8] Fix lowest deps 2015-07-02 10:26:24 +02:00
Nicolas Grekas
75cfef5a31 Merge branch '2.8'
* 2.8:
  [travis] start hhvm first
  [DX] [Security] Renamed Token#getKey() to getSecret()
  [Validator] always evaluate binary format when changed

Conflicts:
	.travis.yml
	src/Symfony/Component/Security/Http/composer.json
2015-07-02 08:18:34 +02:00
Nicolas Grekas
564c8e1ebe Merge branch '2.7' into 2.8
* 2.7:
  [travis] start hhvm first
  [Validator] always evaluate binary format when changed
2015-07-02 08:17:21 +02:00
Nicolas Grekas
8c999b5c55 Merge branch '2.6' into 2.7
* 2.6:
  [travis] start hhvm first
  [Validator] always evaluate binary format when changed

Conflicts:
	.travis.yml
2015-07-02 08:17:05 +02:00
Nicolas Grekas
213cd6ac60 Merge branch '2.3' into 2.6
* 2.3:
  [travis] start hhvm first
2015-07-02 08:16:16 +02:00
Nicolas Grekas
7c36f0b9a0 [travis] start hhvm first 2015-07-02 08:16:05 +02:00
Fabien Potencier
fc6ed5bee3 feature #15141 [DX] [Security] Renamed Token#getKey() to getSecret() (WouterJ)
This PR was squashed before being merged into the 2.8 branch (closes #15141).

Discussion
----------

[DX] [Security] Renamed Token#getKey() to getSecret()

There are 2 very vague parameter names in the authentication process: `$providerKey` and `$key`. Some tokens/providers have the first one, some tokens/providers the second one and some both. An overview:

| Token | `providerKey` | `key`
| --- | --- | ---
| `AnonymousToken` | - | yes
| `PreAuth...Token` | yes | -
| `RememberMeToken` | yes | yes
| `UsernamePasswordToken` | yes | -

Both names are extremely general and their PHPdocs contains pure no-shit-sherlock-descriptions :squirrel: (like "The key."). This made me and @iltar think it's just an inconsistency and they have the same meaning.
...until we dived deeper into the code and came to the conclusion that `$key` has a Security task (while `$providerKey` doesn't really). If it takes people connected to Symfony internals 30+ minutes to find this out, it should be considered for an improvement imo.

So here is our suggestion: **Rename `$key` to `$secret`**. This explains much better what the value of the string has to be (for instance, it's important that the string is not easily guessable and cannot be found out, according to the Spring docs). It also explains the usage better (it's used as a replacement for credentials and to hash the RememberMeToken).

**Tl;dr**: `$key` and `$providerKey` are too general names, let's improve DX by renaming them. This PR tackles `$key` by renaming it to `$secret`.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

*My excuse for the completely unrelated branch name*

Commits
-------

24e0eb6 [DX] [Security] Renamed Token#getKey() to getSecret()
2015-07-02 01:04:20 +02:00
WouterJ
24e0eb6453 [DX] [Security] Renamed Token#getKey() to getSecret() 2015-07-02 01:04:13 +02:00
Nicolas Grekas
9d67841a9e Fix merge 2015-07-01 22:57:44 +02:00
Nicolas Grekas
d994a748dc Merge branch '2.8'
* 2.8: (65 commits)
  [VarDumper] Fix tests for HHVM
  Update DateTimeToArrayTransformer.php
  Mock microtime() and time() in transient tests
  Azerbaijani language pluralization rule
  Move HHVM tests out of the allowed failures
  Fix merge
  [2.6] Towards 100% HHVM compat
  [Security/Http] Fix test
  [Stopwatch] Fix test
  Minor fixes
  [Validator] Added missing error codes and turned codes into UUIDs
  Towards 100% HHVM compat
  Warmup twig templates in non-standard paths (closes #12507)
  [Bridge/PhpUnit] Enforce a consistent locale
  Fix param order of assertEquals (expected, actual) in test for Finder\Glob
  Fix choice translation domain for expanded choice widget
  unify default AccessDeniedExeption message
  trigger event with right user (add test)
  [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser
  fixed CS
  ...

Conflicts:
	UPGRADE-2.8.md
	src/Symfony/Bridge/ProxyManager/composer.json
	src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
	src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
	src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
	src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
	src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
	src/Symfony/Bundle/FrameworkBundle/Resources/config/old_assets.xml
	src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml
	src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.txt
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.txt
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_1.xml
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.json
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.txt
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/legacy_synchronized_service_definition_2.xml
	src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php
	src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/Debug/ErrorHandler.php
	src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php
	src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
	src/Symfony/Component/DependencyInjection/Definition.php
	src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
	src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php
	src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
	src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
	src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/legacy-container9.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/legacy-services9.dot
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/legacy-services6.xml
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/legacy-services9.xml
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/legacy-services6.yml
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/legacy-services9.yml
	src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
	src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
	src/Symfony/Component/Form/ResolvedFormType.php
	src/Symfony/Component/Form/Tests/CompoundFormTest.php
	src/Symfony/Component/Process/Tests/AbstractProcessTest.php
	src/Symfony/Component/VarDumper/Tests/CliDumperTest.php
	src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php
2015-07-01 22:40:29 +02:00
Fabien Potencier
c6d9af374f bug #15115 [Validator] always evaluate binary format when changed (xabbuh)
This PR was merged into the 2.6 branch.

Discussion
----------

[Validator] always evaluate binary format when changed

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13891
| License       | MIT
| Doc PR        |

Commits
-------

2ad7e67 [Validator] always evaluate binary format when changed
2015-07-01 21:58:06 +02:00
Christian Flothmann
2ad7e679cd [Validator] always evaluate binary format when changed 2015-07-01 20:29:17 +02:00
Nicolas Grekas
f59a0baa95 Merge branch '2.7' into 2.8
* 2.7:
  Update DateTimeToArrayTransformer.php
  Mock microtime() and time() in transient tests
  Azerbaijani language pluralization rule
  Move HHVM tests out of the allowed failures
2015-07-01 20:24:26 +02:00
Nicolas Grekas
734fdbe702 [VarDumper] Fix tests for HHVM 2015-07-01 20:24:23 +02:00
Nicolas Grekas
4b9446edf8 Merge branch '2.6' into 2.7
* 2.6:
  Update DateTimeToArrayTransformer.php
  Mock microtime() and time() in transient tests
  Azerbaijani language pluralization rule
  Move HHVM tests out of the allowed failures
2015-07-01 20:23:16 +02:00
Nicolas Grekas
d5cbc46cd9 Merge branch '2.3' into 2.6
* 2.3:
  Update DateTimeToArrayTransformer.php
  Mock microtime() and time() in transient tests
  Azerbaijani language pluralization rule
  Move HHVM tests out of the allowed failures
2015-07-01 20:23:01 +02:00
Fabien Potencier
6bcdee057e minor #15166 Mock microtime() and time() in transient tests (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Mock microtime() and time() in transient tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

8319ca3 Mock microtime() and time() in transient tests
2015-07-01 19:11:21 +02:00
Fabien Potencier
f082cd323b minor #15164 Move HHVM tests out of the allowed failures (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Move HHVM tests out of the allowed failures

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

2.3, 2.6 and 2.7 are now green on HHVM, let's ensure this remains always true!

Commits
-------

ff2ead1 Move HHVM tests out of the allowed failures
2015-07-01 19:07:52 +02:00
Fabien Potencier
bace7aeb0b bug #15163 Update DateTimeToArrayTransformer.php (zhil)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15163).

Discussion
----------

Update DateTimeToArrayTransformer.php

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

php have annoying bug with timezone handling. Some timezones (like US/Eastern, US/Central, US/Mountain) are considered "not standard" and not parsed in some cases.
For example, code
```
php -r '$d = new \DateTime("2015-07-01 16:11", new \DateTimeZone("US/Eastern")); print $d->format("r");'
```
return output
```
Wed, 01 Jul 2015 16:11:00 -0400
```

However, code
```
php -r '$d = new \DateTime("2015-07-01 16:11 US/Eastern"); print $d->format("r");'
```
throw exception
```
Exception' with message 'DateTime::__construct(): Failed to parse time string (2015-07-01 16:11 US/Eastern) at position 17 (U): The timezone could not be found in the database'
```

Thats why timezone US/Eastern works in some cases and didnt work in other cases.
This PR fix usage of US/Eastern in code like

```
$formBuilder->add("createdTimestamp", "datetime", ['view_timezone'=$user->timezone])
```

Commits
-------

27b824a Update DateTimeToArrayTransformer.php
2015-07-01 19:05:18 +02:00
zhil
27b824a6b7 Update DateTimeToArrayTransformer.php 2015-07-01 19:05:17 +02:00
Nicolas Grekas
8319ca3b05 Mock microtime() and time() in transient tests 2015-07-01 18:07:08 +02:00
Fabien Potencier
2c0c232f21 bug #15150 [Translation] Azerbaijani language pluralization rule is wrong (shehi)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15150).

Discussion
----------

[Translation] Azerbaijani language pluralization rule is wrong

In AZ, as in TR, pluralization is always 0:

0 kitab (zero books)
1 kitab (1 book)
3 kitab (3 books)
104 kitab (104 books)

Apparently ZF ruleset was wrong in the first place :)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15152
| License       | MIT
| Doc PR        | -

Commits
-------

efd927a Azerbaijani language pluralization rule
2015-07-01 16:29:21 +02:00
Şəhriyar İmanov
efd927a660 Azerbaijani language pluralization rule
In AZ, as in TR, pluralization is always 0: 

0 kitab (zero books)
1 kitab (1 book)
3 kitab (3 books)
104 kitab (104 books)

Apparently ZF ruleset was wrong in the first place :)
2015-07-01 16:29:20 +02:00
Abdellatif Ait boudad
05f3c3db7b Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
	src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php
2015-07-01 14:16:54 +00:00
Nicolas Grekas
ff2ead17f9 Move HHVM tests out of the allowed failures 2015-07-01 15:03:16 +02:00
Nicolas Grekas
b4fc321912 Fix merge 2015-07-01 14:07:40 +02:00
Nicolas Grekas
eb179f9032 Merge branch '2.6' into 2.7
* 2.6:
  [2.6] Towards 100% HHVM compat
  [Security/Http] Fix test
  [Stopwatch] Fix test
  Minor fixes
  Towards 100% HHVM compat
  unify default AccessDeniedExeption message
  trigger event with right user (add test)
  [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser
  [Form] Fixed: Data mappers always receive forms indexed by their names

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
	src/Symfony/Component/VarDumper/Tests/CliDumperTest.php
	src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php
2015-07-01 13:25:50 +02:00
Fabien Potencier
bfa28d6e41 feature #15154 [Validator] Added missing error codes and turned codes into UUIDs (webmozart)
This PR was merged into the 2.8 branch.

Discussion
----------

[Validator] Added missing error codes and turned codes into UUIDs

Reopened #12388 on the 2.8 branch.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

With the current implementation of error codes, checking which error occurred is unnecessarily complex:

```php
if ($violation->getConstraint() instanceof Length && Length::TOO_SHORT_ERROR === $violation->getCode()) {
    // ...
}
```

Also, the code is completely missing for some constraints. This is fixed now. By using UUIDs, the check is reduced to:

```php
if (Length::TOO_SHORT_ERROR === $violation->getCode()) {
    // ...
}
```

Also, APIs can simply output the error code and the name of the error without needing to point to the constraint as well.

Before:

```json
[
    {
        "code": "1",
        "name": "TOO_SHORT_ERROR",
        "message": "This value is too short. ...",
        "constraint": "Symfony\\Component\\Validator\\Constraints\\Length"
    }
]
```

After:

```json
[
    {
        "code": "9ff3fdc4-b214-49db-8718-39c315e33d45",
        "name": "TOO_SHORT_ERROR",
        "message": "This value is too short. ..."
    }
]
```

This makes it possible to implement a service on symfony.com which looks up error codes, e.g.

symfony.com/error?code=9ff3fdc4-b214-49db-8718-39c315e33d45

Such a URL could redirect directly to the documentation of the appropriate constraint. We could even support user-submitted error codes which redirect to the documentation of that constraint.

Commits
-------

8874e88 [Validator] Added missing error codes and turned codes into UUIDs
2015-07-01 13:21:15 +02:00
Fabien Potencier
a83487821f bug #15159 [2.6] Towards 100% HHVM compat (nicolas-grekas)
This PR was merged into the 2.6 branch.

Discussion
----------

[2.6] Towards 100% HHVM compat

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9917, #11418
| License       | MIT
| Doc PR        | -

Failing components:
- [x] HttpFoundation
- [x] HttpKernel
- [x] VarDumper

Related HHVM issues:
- https://github.com/facebook/hhvm/issues/5563

Commits
-------

8a78255 [2.6] Towards 100% HHVM compat
2015-07-01 13:18:19 +02:00
Nicolas Grekas
8a782556eb [2.6] Towards 100% HHVM compat 2015-07-01 12:03:42 +02:00
Nicolas Grekas
6a45129b41 [Security/Http] Fix test 2015-06-30 18:51:15 +02:00
Nicolas Grekas
700487002f Merge branch '2.3' into 2.6
* 2.3:
  [Stopwatch] Fix test
2015-06-30 18:49:57 +02:00
Nicolas Grekas
9de0d60b2c [Stopwatch] Fix test 2015-06-30 18:34:54 +02:00
Nicolas Grekas
c53ee35a2e Merge branch '2.3' into 2.6
* 2.3:
  Minor fixes
  Towards 100% HHVM compat
  trigger event with right user (add test)
  [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser
  [Form] Fixed: Data mappers always receive forms indexed by their names

Conflicts:
	src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
	src/Symfony/Component/Filesystem/Filesystem.php
	src/Symfony/Component/Process/Tests/AbstractProcessTest.php
2015-06-30 18:10:16 +02:00
Nicolas Grekas
6e1ae53fea Minor fixes 2015-06-30 18:05:31 +02:00
Fabien Potencier
0020680d92 bug #15146 Towards 100% HHVM compat (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Towards 100% HHVM compat

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Failing components:
- [x] Debug
- [x] DependencyInjection
- [x] Filesystem
- [x] Form
- [x] HttpFoundation
- [x] Process
- [x] Routing

Related HHVM issues:
- https://github.com/facebook/hhvm/issues/5562
- https://github.com/facebook/hhvm/issues/5561
- https://github.com/facebook/hhvm/issues/5330
- https://github.com/facebook/hhvm/issues/3558
- https://github.com/facebook/hhvm/issues/4901

Commits
-------

b9a76ba Towards 100% HHVM compat
2015-06-30 17:31:35 +02:00
Bernhard Schussek
8874e88384 [Validator] Added missing error codes and turned codes into UUIDs 2015-06-30 16:06:42 +02:00