Commit Graph

16824 Commits

Author SHA1 Message Date
Bernhard Schussek
230f2a72fa [Validator] Fixed exception message 2014-03-30 18:28:56 +02:00
Bernhard Schussek
e057b19964 [Validator] Decoupled ContextRefresher from ExecutionContext 2014-03-30 18:28:56 +02:00
Bernhard Schussek
e440690bb4 [Validator] Renamed validateCollection() to validateObjects() 2014-03-30 18:28:56 +02:00
Bernhard Schussek
df41974f31 [Validator] Changed context manager to context factory
The current context is not stored anymore. Instead, it is passed around the traverser
and the visitors. For this reason, validation can occur in multiple contexts at the
same time.
2014-03-30 18:28:56 +02:00
Bernhard Schussek
26eafa43f7 [Validator] Removed unused use statements 2014-03-30 18:28:56 +02:00
Bernhard Schussek
bc29591935 [Validator] Clearly separated classes supporting the API <2.5/2.5+ 2014-03-30 18:28:55 +02:00
Bernhard Schussek
a3555fbd99 [Validator] Fixed: Objects are not traversed unless they are instances of Traversable 2014-03-30 18:28:55 +02:00
Bernhard Schussek
2c65a28608 [Validator] Completed test coverage and documentation of the Node classes 2014-03-30 18:28:55 +02:00
Bernhard Schussek
9c9e715ca8 [Validator] Completed documentation of GroupManagerInterface 2014-03-30 18:28:55 +02:00
Bernhard Schussek
1e81f3bdc8 [Validator] Finished test coverage and documentation of ExecutionContextManager 2014-03-30 18:28:55 +02:00
Bernhard Schussek
feb3d6f202 [Validator] Tested the validation in a separate context 2014-03-30 18:28:55 +02:00
Bernhard Schussek
718601c6c3 [Validator] Changed validateValue() to validate() in the new API
The validation of values against constraints should be a first-class citizen
in the API. For this reason, validate() now takes a value and a constraint or
a list of constraints. This method should be used for the most basic use
cases.

If users want to annotate objects with constraints (this is optional,
advanced functionality), they can use the more expressive validateObject()
method now. For traversing arrays or Traversables, a new method
validateCollection() is now available in the API.
2014-03-30 18:28:55 +02:00
Bernhard Schussek
ee1adadbfb [Validator] Implemented handling of arrays and Traversables in LegacyExecutionContext::validate() 2014-03-30 18:28:55 +02:00
Bernhard Schussek
09f744b89c [Validator] Implemented BC traversal of traversables through validate() 2014-03-30 18:28:55 +02:00
Bernhard Schussek
297ba4f585 [Validator] Added a note why scalars are passed to cascadeObject() in NodeTraverser 2014-03-30 18:28:55 +02:00
Bernhard Schussek
9b07b0c672 [Validator] Implemented BC validation of arrays through validate() 2014-03-30 18:28:55 +02:00
Bernhard Schussek
405a03b365 [Validator] Updated deprecation notes in GroupSequence 2014-03-30 18:28:55 +02:00
Bernhard Schussek
499b2bb601 [Validator] Completed test coverage of ExecutionContext 2014-03-30 18:28:55 +02:00
Bernhard Schussek
adc1437fab [Validator] Fixed failing tests 2014-03-30 18:28:54 +02:00
Bernhard Schussek
4ea3ff6688 [Validator] Finished inline documentation of ExecutionContext[Interface] 2014-03-30 18:28:54 +02:00
Bernhard Schussek
f6b7288449 [Validator] Removed unused use statement 2014-03-30 18:28:54 +02:00
Bernhard Schussek
8318286650 [Validator] Completed GroupSequence implementation 2014-03-30 18:28:54 +02:00
Bernhard Schussek
5fbf848f2f [Validator] Added note about Callback constraint to CHANGELOG 2014-03-30 18:28:54 +02:00
Bernhard Schussek
c1b1e03399 [Validator] Added TODO reminder 2014-03-30 18:28:54 +02:00
Bernhard Schussek
8ae68c9543 [Validator] Made tests green (yay!) 2014-03-30 18:28:54 +02:00
Bernhard Schussek
680f1ee6c7 [Validator] Renamed $params to $parameters 2014-03-30 18:28:54 +02:00
Bernhard Schussek
321d5bb30a [Validator] Throw exception if ObjectInitializer is constructed without visitors 2014-03-30 18:28:54 +02:00
Bernhard Schussek
1156bde823 [Validator] Extracted code for group sequence resolving into GroupSequenceResolver 2014-03-30 18:28:54 +02:00
Bernhard Schussek
b1a947737a [Validator] Added ObjectInitializer visitor 2014-03-30 18:28:54 +02:00
Bernhard Schussek
7e3a41d9db [Validator] Moved visitors to NodeVisitor namespace 2014-03-30 18:28:54 +02:00
Bernhard Schussek
a40189ccb7 [Validator] Decoupled the new classes a bit 2014-03-30 18:28:54 +02:00
Bernhard Schussek
a6ed4cae5d [Validator] Prototype of the traverser implementation 2014-03-30 18:28:53 +02:00
Bernhard Schussek
25cdc68d36 [Validator] Refactored ValidatorTest and ValidationVisitorTest into an abstract validator test class 2014-03-30 18:28:53 +02:00
Fabien Potencier
95f8e43205 bug #10581 [Validator][Email] - When standalone "Fatal error: Class 'validator.email' not found" (egulias)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Validator][Email] - When standalone "Fatal error: Class 'validator.email' not found"

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/silexphp/Silex/issues/932
| License       | MIT
| Doc PR        | no

When using the validator as an standalone component a bug was introduced by overriding the `validatedBy()` method in the `Email` constraint.
This PR removes the override and implements a way for the DI to get the right validator.

Another way would be modifying the definition of validator to change the alias instead of having the FQCN in the xml

Commits
-------

e79b3a9 Change in validator.email service alias to match the validator FQCN
2014-03-30 09:34:45 +02:00
Eduardo Gulias Davis
e79b3a9755 Change in validator.email service alias to match the validator FQCN 2014-03-30 09:34:45 +02:00
Fabien Potencier
3cd1c9cd5b bug #10565 fixed typos (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

fixed typos

/cc @nicolas-grekas

Commits
-------

584b5c0 fixed typos
2014-03-28 10:40:08 +01:00
Fabien Potencier
584b5c0508 fixed typos 2014-03-28 10:40:08 +01:00
Fabien Potencier
4a0382b58a fixed CS 2014-03-27 21:36:23 +01:00
Fabien Potencier
9e78a0603e Merge branch '2.4'
* 2.4:
  added missing unit test
  fixed too greedy replacements
  fixed protocol-relative URLs
  added override power to server parameters provided on request method
  made parsing controllers more robust
  Fixed YamlFileLoader imports path
2014-03-27 15:53:24 +01:00
Fabien Potencier
82cbf698b7 Merge branch '2.3' into 2.4
* 2.3:
  added missing unit test
  fixed too greedy replacements
  fixed protocol-relative URLs
  added override power to server parameters provided on request method
  made parsing controllers more robust
  Fixed YamlFileLoader imports path

Conflicts:
	src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php
2014-03-27 15:53:17 +01:00
Fabien Potencier
ea4b8bf993 minor #10558 [DependencyInjection] added missing unit test (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] added missing unit test

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

Added a unit test to ensure that #10536 won't break BC.

Commits
-------

47d1592 added missing unit test
2014-03-27 15:52:08 +01:00
Fabien Potencier
47d1592b56 added missing unit test 2014-03-27 15:52:07 +01:00
Fabien Potencier
b78d1746f0 minor #10554 framework_bundle -> framework (mvrhov)
This PR was merged into the 2.5-dev branch.

Discussion
----------

framework_bundle -> framework

Commits
-------

85cf7a7 framework_bundle -> framework
2014-03-27 14:47:58 +01:00
Miha Vrhovnik
85cf7a762c framework_bundle -> framework 2014-03-27 14:47:58 +01:00
Fabien Potencier
e505ecdacd feature #10370 [FrameworkBundle][Console] Add parameter descriptors (inalgnu)
This PR was squashed before being merged into the 2.5-dev branch (closes #10370).

Discussion
----------

[FrameworkBundle][Console] Add parameter descriptors

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

I've added several descriptors for each format, henceforth :
``php app/console container:debug --parameter=database_name --format=txt`` will output:
``symfony``

``php app/console container:debug --parameter=database_name --format=json`` will output:
```json
{
    "database_name": "symfony"
}
```

``php app/console container:debug --parameter=database_name --format=xml`` will output :
```xml
<?xml version="1.0" encoding="UTF-8"?>
<parameter key="database_name">symfony</parameter>
```
and ``php app/console container:debug --parameter=database_name --format=md`` will output :
```md
database_name
=============

symfony
```

what do you think ?

Commits
-------

6aa1050 Add parameter descriptors
2014-03-27 12:26:27 +01:00
Inal DJAFAR
6aa1050793 Add parameter descriptors 2014-03-27 12:26:27 +01:00
Fabien Potencier
0380d1456a bug #10549 Fixed server values in BrowserKit (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

Fixed server values in BrowserKit

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

Commits
-------

65b9810 fixed too greedy replacements
d9cf28d fixed protocol-relative URLs
289da16 added override power to server parameters provided on request method
2014-03-27 10:14:18 +01:00
Fabien Potencier
65b98102d1 fixed too greedy replacements 2014-03-27 10:14:18 +01:00
Fabien Potencier
d9cf28d016 fixed protocol-relative URLs 2014-03-27 10:14:18 +01:00
Luis Cordova
289da16681 added override power to server parameters provided on request method 2014-03-27 10:14:17 +01:00