Commit Graph

17762 Commits

Author SHA1 Message Date
Fabien Potencier
7283483185 bug #11625 [FrameworkBundle] resolve parameters before the configs are processed in the config:debug command (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] resolve parameters before the configs are processed in the config:debug command

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

If the raw values are passed to the processor, config values don't necessarily have the expected data type. For example, the value of the kernel.debug parameter is a boolean type. But when passed as the raw parameter name, it is a string.

@lyrixx Do you have any objections?

Commits
-------

19f3b47 resolve parameters before the configs are processed
2014-08-11 11:13:50 +02:00
Fabien Potencier
2cf1205ef5 minor #11623 add symfony/yaml suggestion to composer.json (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

add symfony/yaml suggestion to composer.json

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

Commits
-------

dcce035 add symfony/yaml suggestion to composer.json
2014-08-09 12:38:44 +02:00
Christian Flothmann
19f3b47236 resolve parameters before the configs are processed
If the raw values are passed to the processor, config values don't
necessarily have the expected data type. For example, the value of
the kernel.debug parameter is a boolean type. But when passed as the
raw parameter name, it is a string.
2014-08-09 12:16:37 +02:00
Christian Flothmann
dcce0357df add symfony/yaml suggestion to composer.json
The config:debug and yaml:lint commands use classes from the Yaml
component. Therefore, the installation of these packages should be
suggested to the user.
2014-08-08 22:59:22 +02:00
Fabien Potencier
5ca28c0d71 Merge branch '2.4' into 2.5
* 2.4:
  [HttpKernel] added an analyze of environment parameters for built-in server.
  change command to which available under most unix systems
  add way to test command under windows
  fix shell command injection
  [Form] allowed CallbackTransformer to use callable
  [Process] Added process synchronization to the incremental output tests
2014-08-08 17:50:54 +02:00
Fabien Potencier
05c3314a06 Merge branch '2.3' into 2.4
* 2.3:
  [HttpKernel] added an analyze of environment parameters for built-in server.
  change command to which available under most unix systems
  add way to test command under windows
  fix shell command injection
  [Form] allowed CallbackTransformer to use callable
  [Process] Added process synchronization to the incremental output tests
2014-08-08 17:50:44 +02:00
Fabien Potencier
61763452b7 bug #10914 [HttpKernel] added an analyze of environment parameters for built-in server (mauchede)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #10914).

Discussion
----------

[HttpKernel] added an analyze of environment parameters for built-in server

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

With the built-in server, it is not possible to use the external parameters: environment variables are only in `$_ENV`.

Commits
-------

696b978 [HttpKernel] added an analyze of environment parameters for built-in server.
2014-08-08 17:50:03 +02:00
Morgan Auchede
696b978742 [HttpKernel] added an analyze of environment parameters for built-in server. 2014-08-08 17:50:03 +02:00
Fabien Potencier
6b8fe14f3c minor #11587 [Validator] Removed legacy validator classes (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Removed legacy validator classes

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

This PR removes the legacy validator classes again and adds the API checks inside the constraint validators instead.

Commits
-------

e844ed0 [Validator] Removed legacy validator classes
2014-08-07 15:09:54 +02:00
Fabien Potencier
56a75179d1 minor #11565 [Process] Added process synchronization to the incremental output tests (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Added process synchronization to the incremental output tests

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

The tests currently fail from time to time if the executing machine is under
heavy load. This leads to false negatives on Travis CI.

A side effect of the change is that the tests are much faster now.

Commits
-------

6dd3946 [Process] Added process synchronization to the incremental output tests
2014-08-07 15:08:01 +02:00
Fabien Potencier
976a1cc11c bug #11598 [Finder] Shell escape and windows support (Gordon Franke, gimler)
This PR was merged into the 2.3 branch.

Discussion
----------

[Finder] Shell escape and windows support

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

Add escaping of command passed to Shell::testCommand().
Fix todo add support for windows.

Commits
-------

c70a226 change command to which available under most unix systems
85e77b1 add way to test command under windows
4fa9288 fix shell command injection
2014-08-07 15:06:53 +02:00
Gordon Franke
c70a226121 change command to which available under most unix systems
agree i will change it which is available under suse, ubuntu, debian, fedora, bsd
2014-08-07 14:55:21 +02:00
Bernhard Schussek
8bedf86f31 bug #11582 [DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API

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

Commits
-------

f45f1ab [DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API
2014-08-07 09:58:17 +02:00
Gordon Franke
85e77b14f7 add way to test command under windows 2014-08-07 09:02:32 +02:00
Gordon Franke
4fa9288fda fix shell command injection 2014-08-07 09:01:16 +02:00
Bernhard Schussek
72b70636ba minor #11576 [Form] allowed CallbackTransformer to use callable (issei-m)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11576).

Discussion
----------

[Form] allowed CallbackTransformer to use callable

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

I want to use the callable(i.e. inner class methods) in CallbackTransformer, but its current constructor is defined argument type hinting for \Closure so i can't.

Commits
-------

e77022b [Form] allowed CallbackTransformer to use callable
2014-08-06 15:53:52 +02:00
Issei.M
e77022ba6d [Form] allowed CallbackTransformer to use callable 2014-08-06 15:53:52 +02:00
Bernhard Schussek
6dd3946a7e [Process] Added process synchronization to the incremental output tests
The tests currently fail from time to time if the executing machine is under
heavy load. This leads to false negatives on Travis CI.

A side effect of the change is that the tests are much faster now.
2014-08-06 15:45:25 +02:00
Bernhard Schussek
e844ed0fb5 [Validator] Removed legacy validator classes 2014-08-06 15:23:29 +02:00
Bernhard Schussek
f45f1ab20c [DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API 2014-08-06 15:02:45 +02:00
Bernhard Schussek
fba2393297 minor #11585 [SecurityBundle] Added UserPasswordValidator tests for the different Validation APIs (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[SecurityBundle] Added UserPasswordValidator tests for the different Validation APIs

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

Commits
-------

0653426 [SecurityBundle] Added UserPasswordValidator tests for the different Validation APIs
2014-08-06 15:00:40 +02:00
Bernhard Schussek
06534265ad [SecurityBundle] Added UserPasswordValidator tests for the different Validation APIs 2014-08-06 14:45:51 +02:00
Fabien Potencier
0c13296d30 bumped Symfony version to 2.5.4 2014-08-06 10:24:10 +02:00
Fabien Potencier
f077a238c7 updated VERSION for 2.5.3 2014-08-06 09:03:01 +02:00
Fabien Potencier
b8f6995025 updated CHANGELOG for 2.5.3 2014-08-06 09:02:47 +02:00
Fabien Potencier
6f07919307 Merge branch '2.4' into 2.5
* 2.4:
  Fixed relative redirects for ambiguous paths
  [BrowserKit] Fix browser kit redirect with ports
  [TwigBridge] [Form] Fixed some extra empty spaces
  Plural fix
  removed some .gitattributes that should have been removed a lot time ago
  [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
  fixed whitespace in Twig form template
  built-in server: exit when docroot does not exist

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml
2014-08-06 08:44:37 +02:00
Fabien Potencier
6f56ea423d Merge branch '2.3' into 2.4
* 2.3:
  Fixed relative redirects for ambiguous paths
  [BrowserKit] Fix browser kit redirect with ports
  [TwigBridge] [Form] Fixed some extra empty spaces
  Plural fix
  removed some .gitattributes that should have been removed a lot time ago
  [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
  fixed whitespace in Twig form template
  built-in server: exit when docroot does not exist

Conflicts:
	src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
2014-08-06 08:41:27 +02:00
Fabien Potencier
cd322c42a8 bug #11571 [Form] Fixed FormValidator compatibility with the non-BC 2.5 Validation API (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Form] Fixed FormValidator compatibility with the non-BC 2.5 Validation API

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

Commits
-------

6ac130e [Form] Fixed FormValidator compatibility with the non-BC 2.5 Validation API
2014-08-06 08:10:28 +02:00
Bernhard Schussek
6ac130e331 [Form] Fixed FormValidator compatibility with the non-BC 2.5 Validation API 2014-08-05 17:39:31 +02:00
Bernhard Schussek
98c0621d21 Merge branch '2.4' into 2.5
* 2.4: (24 commits)
  [Validator] Added Swedish translations
  Fix incorrect romanian plural translations
  fix axes handling in Crawler::filterXPath()
  fix some docblocks
  Fixed self-reference in 'service_container' service breaks garbage collection (and clone).
  [Process] Fix tests when pcntl is not available.
  [DependencyInjection] Roll back changes made to generated files.
  [Console] Roll back changes made to fixture files.
  Issue #11489 Added some CA and ES translations
  [Validator] Added more detailed inline documentation
  [Validator] Removed information from the violation output if the value is an array, object or resource
  partially reverted previous commit
  fixed CS
  properly handle null data when denormalizing
  [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls
  [Validator] Fixed CS
  [Validator] Fixed date-to-string conversion tests to match ICU 51
  [Validator] Added "{{ value }}" parameters where they were missing
  [Validator] Simplified and explained the LuhnValidator
  [Validator] Simplified IssnValidator
  ...

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
	src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php
	src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Constraints/FileValidator.php
	src/Symfony/Component/Validator/Constraints/Isbn.php
	src/Symfony/Component/Validator/Constraints/IsbnValidator.php
	src/Symfony/Component/Validator/Constraints/LengthValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
	src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php
	src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
2014-08-05 11:00:40 +02:00
Fabien Potencier
678f7728eb bug #11499 [BrowserKit] Fixed relative redirects for ambiguous paths (pkruithof)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11499).

Discussion
----------

[BrowserKit] Fixed relative redirects for ambiguous paths

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

This fixes a problem I discovered today during Mink testing: I have a route with a slug and id, separated by colon (`/{slug}:{id}`). When the `HTTP_HOST` is being normalized it only checks for array key existence, not emptyness. In this case it was `false` due to the `parse_url` call in `updateServerFromUri`, which cannot handle this case:

```
$> php -r "var_dump(parse_url('/redirect', PHP_URL_HOST));"                                                                               NULL

$> php -r "var_dump(parse_url('/redirect:1234', PHP_URL_HOST));"                                                                          bool(false)
```

So now the url becomes `http:///redirect:1234`, because of the missing host.

Commits
-------

5ecc449 Fixed relative redirects for ambiguous paths
2014-08-05 09:20:56 +02:00
Peter Kruithof
5ecc449898 Fixed relative redirects for ambiguous paths 2014-08-05 09:20:55 +02:00
Fabien Potencier
6094b5b3a9 bug #11516 [BrowserKit] Fix browser kit redirect with ports (dakota)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11516).

Discussion
----------

[BrowserKit] Fix browser kit redirect with ports

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

Whilst using Mink to do automated tests, I encountered a problem where redirects with ports would not work as the port was removed in the `updateServerFromURI()` method. This PR fixes the problem.

During my testing I encountered `$client->followRedirects(false);` in the ClientTest class that was causing the redirectWithPort test to pass even though it should have been failing (Removing the line caused the test to correctly fail before the patch was written)

Commits
-------

39973de [BrowserKit] Fix browser kit redirect with ports
2014-08-05 09:17:23 +02:00
Walther Lalk
39973de230 [BrowserKit] Fix browser kit redirect with ports 2014-08-05 09:17:23 +02:00
Fabien Potencier
e76561dbc0 bug #11545 [Bundle][FrameworkBundle] built-in server: exit when docroot does not exist (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Bundle][FrameworkBundle] built-in server: exit when docroot does not exist

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

When the server:run command is run with an invalid document root
directory (for example, when being in the app directory and not
changing the document root to ../web/), the command crashes on Windows
with a 267 exit code. On Linux, the server starts but just publishes
internal server errors.

Commits
-------

f143254 built-in server: exit when docroot does not exist
2014-08-05 09:12:57 +02:00
Fabien Potencier
24c49841c8 minor #11554 [TwigBridge] [Form] Fixed some extra empty spaces (eiannone)
This PR was squashed before being merged into the 2.3 branch (closes #11554).

Discussion
----------

[TwigBridge] [Form] Fixed some extra empty spaces

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

Extra empty spaces for choice_widget_collapsed, they were introduced by commit 8f9ed3ebb9 by @chrisguitarguy

Commits
-------

16bd88e [TwigBridge] [Form] Fixed some extra empty spaces
2014-08-05 09:07:37 +02:00
Emanuele Iannone
16bd88e61f [TwigBridge] [Form] Fixed some extra empty spaces 2014-08-05 09:07:37 +02:00
Fabien Potencier
1ba7c72b09 minor #11550 [Form] fix whitespace in Twig form template (craue)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] fix whitespace in Twig form template

| Q             | A
| ------------- | ---
| Bug fix?      | kind of (after updating from 2.3.17 to 2.3.18, some of my tests were broken because of this)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | they should, let's see what Travis has to say...
| Fixed tickets | --
| License       | MIT
| Doc PR        | --

This fixes some whitespace rendering.

after merging #11386:
```html
<input type="text" id="myfield" name="myfield"     value="blah" />
```

before merging #11386 and with this PR again:
```html
<input type="text" id="myfield" name="myfield" value="blah" />
```

Commits
-------

8504d02 fixed whitespace in Twig form template
2014-08-05 09:06:43 +02:00
Fabien Potencier
e17276b197 bug #11560 Plural fix (1emming)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11560).

Discussion
----------

Plural fix

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

*BC note - this breaks code if people build on top of the incorrect returned value `drife`.

Fixes the `singular` for `drives`. I've added more test values to prove more edge cases and to show this changes doesn't break other `singular`-look ups.
In the test class i've added a few `known issues` for later reference/fixure.

Commits
-------

9b550d6 Plural fix
2014-08-05 09:05:25 +02:00
Seb Koelen
9b550d6324 Plural fix 2014-08-05 09:05:24 +02:00
Fabien Potencier
59d6912b40 bug #11558 [DependencyInjection] Fixed missing 'factory-class' attribute in XmlDumper output (kerdany)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] Fixed missing 'factory-class' attribute in XmlDumper output

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

Problem: XmlDumper doesn't write 'factory-class' XML attribute for definitions on which setFactoryClass() was called.

Impact: Container[Builder] to throws an exception when the relevant service is being requested/initiated after loading the dumped XML.
`Uncaught Exception Symfony\Component\DependencyInjection\Exception\RuntimeException: "Cannot create service "xxx" from factory method without a factory service or factory class." at /<path>/<to>//DependencyInjection/ContainerBuilder.php`

Solution: Made XmlDumper write the 'factory-class' attribute, and updated the relevant test fixture.

Another related problem, is that XMLFileLoader doesn't complain if the 'factory-class' attribute is missing for a 'service' elements that include 'factory-method' attribute, resulting in an ill-configured Definition object in the ContainerBuilder. I'll post an issue/ticket, and probably send another PR for that.

Commits
-------

18e3e6f [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
2014-08-05 09:04:05 +02:00
Fabien Potencier
a4ec72e51f minor #11561 [Validator] Added Swedish translations (Nyholm)
This PR was merged into the 2.4 branch.

Discussion
----------

[Validator] Added Swedish translations

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | part of #11489
| License       | MIT

Added some missing Swedish translations.

Should I make an additional PR to `master` for the `trans-unit id=78` ([ref](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf#L302))? Or should I add that in this PR?

Commits
-------

a361f10 [Validator] Added Swedish translations
2014-08-04 21:48:57 +02:00
Bernhard Schussek
a6a7f5d2f5 minor #11485 [Validator] Constraint validators now use the 2.5 API (webmozart)
This PR was squashed before being merged into the 2.5 branch (closes #11485).

Discussion
----------

[Validator] Constraint validators now use the 2.5 API

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

See the comments in #11049 for the origin of this PR.

Currently, the 2.5 API needs to use `LegacyExecutionContextFactory` because the constraint validators rely on methods from the old `ExecutionContext` class (like `validate()`, `validateValue()`). Consequently it is impossible to switch to the pure 2.5 API and check whether all calls to deprecated methods were removed from application code. This is fixed now.

This PR also introduces a complete test suite to test each constraint validator against all three APIs: 2.4, 2.5-BC and 2.5. Currently, some tests are not executed yet when running the complete test suite is run. I expect this to be fixed soon (ticket: sebastianbergmann/phpunit#529, pr: sebastianbergmann/phpunit#1327).

Commits
-------

295e5bb [Validator] Fixed failing tests
3bd6d80 [Validator] CS fixes
870a41a [FrameworkBundle] Made ConstraintValidatorFactory aware of the legacy validators
7504448 [Validator] Added extensive test coverage for the constraint validators for the different APIs
8e461af [Validator] Constraint validators now use the 2.5 API. For incompatible validators, legacy validators were created
2014-08-04 16:36:36 +02:00
Bernhard Schussek
c43253e363 bug #11498 [Validator] Made it possible (again) to pass a class name to validatePropertyValue() (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Made it possible (again) to pass a class name to validatePropertyValue()

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

In the 2.4 API it was possible to do both:

```php
$validator->validatePropertyValue($object, 'propertyName', $myValue);
$validator->validatePropertyValue('\Vendor\Namespace\ClassName', 'propertyName', $myValue);
```

In the 2.5 API, the second case was not supported anymore. This is fixed now.

Together with the fix comes also a small change (also in the 2.4 API) which I'll demonstrate with a code snippet:

```php
$metadata->addPropertyConstraint('ClassName', 'propertyName', new Callback(
    function ($value, $context) {
        var_dump($context->getRoot());
        var_dump($context->getPropertyPath());
    }
));

$validator->validatePropertyValue('ClassName', 'propertyName', 'foobar');
```

Before this PR, the output would be:

```
string(9) "ClassName"
string(12) "propertyName"
```

This doesn't make a lot of sense, because usually the following condition holds during validation:

```php
'' === $context->getPropertyPath() || $value === $propertyAccessor->getValue($context->getRoot(), $context->getPropertyPath())
```

which obviously cannot work if root is a class name. Thus I changed the root and property path to become:

```
string(6) "foobar"
string(0) ""
```

With this change, the condition holds also in this case.

Commits
-------

2bf1b37 [Validator] Fixed ExpressionValidator when the validation root is not an object
ef6f5f5 [Validator] Fixed: Made it possible (again) to pass a class name to Validator::validatePropertyValue()
2014-08-04 16:33:56 +02:00
Tobias Nyholm
a361f10b1d [Validator] Added Swedish translations 2014-08-04 15:49:20 +02:00
Bernhard Schussek
2bf1b375c1 [Validator] Fixed ExpressionValidator when the validation root is not an object 2014-08-04 14:11:37 +02:00
Bernhard Schussek
ef6f5f50c5 [Validator] Fixed: Made it possible (again) to pass a class name to Validator::validatePropertyValue() 2014-08-04 14:11:35 +02:00
Fabien Potencier
99ee01d482 removed some .gitattributes that should have been removed a lot time ago 2014-08-04 12:32:26 +02:00
Bernhard Schussek
3bed1b7988 Merge branch '2.3' into 2.4
* 2.3: (22 commits)
  Fix incorrect romanian plural translations
  fix axes handling in Crawler::filterXPath()
  fix some docblocks
  Fixed self-reference in 'service_container' service breaks garbage collection (and clone).
  [Process] Fix tests when pcntl is not available.
  [DependencyInjection] Roll back changes made to generated files.
  [Console] Roll back changes made to fixture files.
  [Validator] Added more detailed inline documentation
  [Validator] Removed information from the violation output if the value is an array, object or resource
  partially reverted previous commit
  fixed CS
  properly handle null data when denormalizing
  [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls
  [Validator] Fixed CS
  [Validator] Fixed date-to-string conversion tests to match ICU 51
  [Validator] Added "{{ value }}" parameters where they were missing
  [Validator] Simplified and explained the LuhnValidator
  [Validator] Simplified IssnValidator
  [Validator] Fixed and simplified IsbnValidator
  [Validator] Simplified IBAN validation algorithm
  ...

Conflicts:
	src/Symfony/Component/Console/Helper/DescriptorHelper.php
	src/Symfony/Component/DependencyInjection/Container.php
	src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
	src/Symfony/Component/HttpFoundation/File/UploadedFile.php
	src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
	src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
2014-08-04 12:16:36 +02:00
Fabien Potencier
d754467d0e minor #11557 Fix incorrect romanian plural translations (moldcraft)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11557).

Discussion
----------

Fix incorrect romanian plural translations

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

In romanian plural translations was only one or two forms, but is required three, because it throws errors when transchoice has number that is translated to the third form.

Before fix

![staticshot_04-08-2014_11-27-51](https://cloud.githubusercontent.com/assets/1475489/3794833/ff9047c4-1bb2-11e4-8965-61d53803eb7c.png)

After fix

![staticshot_04-08-2014_11-33-18](https://cloud.githubusercontent.com/assets/1475489/3794844/1f8c48ca-1bb3-11e4-8654-69e0f3107e6d.png)

Info about romanian plural forms

![staticshot_04-08-2014_11-39-41](https://cloud.githubusercontent.com/assets/1475489/3794849/3cb03e70-1bb3-11e4-9151-7075ec9c8f4d.png)

Commits
-------

0c6f750 Fix incorrect romanian plural translations
2014-08-04 11:02:02 +02:00