Commit Graph

14042 Commits

Author SHA1 Message Date
Bernhard Schussek
8558377945 [Validator] Added deprecation notes 2014-03-30 18:28:57 +02:00
Bernhard Schussek
e8fa15b27c [Validator] Fixed the new validator API under PHP < 5.3.9 2014-03-30 18:28:57 +02:00
Bernhard Schussek
2936d10aa4 [Validator] Removed unused use statement 2014-03-30 18:28:57 +02:00
Bernhard Schussek
6fc6ecdd8e [Validator] Fixed tests under PHP<5.3.9
The new implementation is disabled on those PHP versions.
2014-03-30 18:28:57 +02:00
Bernhard Schussek
778ec2458b [Validator] Removed helper class Traversal 2014-03-30 18:28:57 +02:00
Bernhard Schussek
76d8c9a1f7 [Validator] Fixed typos 2014-03-30 18:28:57 +02:00
Bernhard Schussek
416137165e [Validator] Removed unused use statements 2014-03-30 18:28:57 +02:00
Bernhard Schussek
aeb68228b1 [Validator] Improved visitor names 2014-03-30 18:28:56 +02:00
Bernhard Schussek
08172bfe7b [Validator] Merged validate(), validateObject() and validateObjects() to simplify usage 2014-03-30 18:28:56 +02:00
Bernhard Schussek
51197f68a3 [Validator] Made traversal of Traversables consistent
If the traversal strategy is IMPLICIT (the default), the validator will now
traverse any object that implements \Traversable and any array
2014-03-30 18:28:56 +02:00
Bernhard Schussek
117b1b9a17 [Validator] Wrapped collections into CollectionNode instances 2014-03-30 18:28:56 +02:00
Bernhard Schussek
94583a9289 [Validator] Changed NodeTraverser to traverse nodes iteratively, not recursively
In this way, the deep method call chains are avoided. Also, it is possible to
avoid the many calls to leaveNode(), which are currently not really needed.
2014-03-30 18:28:56 +02:00
Bernhard Schussek
cf1281feef [Validator] Added "Visitor" suffix to all node visitors 2014-03-30 18:28:56 +02:00
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
Bernhard Schussek
9aee2ad999 [PropertyAccess] Removed the argument $value from isWritable()
To keep isWritable() and setValue() consistent, the exception thrown when only
an adder was present, but no remover (or vice versa), was removed.
2014-03-30 18:19:56 +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
Bernhard Schussek
4262707e5a [PropertyAccess] Fixed CS and added missing documentation 2014-03-28 19:21:04 +01:00
Bernhard Schussek
ce0efb189f [Form] ObjectChoiceList now compares choices by their value, if a value path is given 2014-03-28 18:03:44 +01:00
Bernhard Schussek
6d2af217aa [PropertyAccess] Added isReadable() and isWritable() 2014-03-28 17:21:37 +01:00
Bernhard Schussek
20e6bf8f49 [PropertyAccess] Refactored PropertyAccessorCollectionTest 2014-03-28 17:07:20 +01:00
Bernhard Schussek
0488389d95 [PropertyAccess] Refactored PropertyAccessorTest 2014-03-28 15:56:23 +01:00
Bernhard Schussek
b44e07b7f6 [Form] Added test case for 4759e062ed004749dbdc2ba31aef0f8ac2601895 2014-03-28 12:45:50 +01:00
Matt Janssen
7bc7a8a6ec [Form] Accept interfaces to be passed to "data_class" 2014-03-28 12:44:51 +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
47d1592b56 added missing unit test 2014-03-27 15:52:07 +01:00
Inal DJAFAR
6aa1050793 Add parameter descriptors 2014-03-27 12:26:27 +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
Jordi Boggiano
7d61154e7a Add command to list twig functions, filters, globals and tests 2014-03-27 08:58:32 +01:00
Fabien Potencier
6dba2296f1 made parsing controllers more robust 2014-03-27 08:52:42 +01:00
Manuel Reinhard
ec428445a1 Improved ISBN validator 2014-03-27 08:46:43 +01:00
Fabien Potencier
711788b794 fixed CS 2014-03-27 08:45:48 +01:00
Sascha Grossenbacher
e7389aa24c Move normalizer cache to getNormalier()/getDenormalizer(), use those in normalizeObject()/denormalizeObject() 2014-03-27 08:44:58 +01:00
John Nickell
fd1d48b54f Fixed YamlFileLoader imports path
YamlFileLoader used the resource name as the current directory during import, which can cause a failed import when using a relative path. Using the $path variable output from the locator is consistent with other loaders and fixes the bug.
2014-03-27 08:28:37 +01:00
Eduardo Gulias Davis
3368630482 #1581 - Strict in Email constraint and use of Egulias\EmailValidator 2014-03-27 07:02:30 +01:00
Fabien Potencier
e0de9586aa Merge branch '2.4'
* 2.4:
  Check headers sent before sending PHP response
  Fix issue symfony/symfony#10345 '[FrameworkBundle][Console] container:debug --parameter="" not working anymore'
  Fixed ACE domain checks on UrlValidator (#10031)
  handle array root element
2014-03-26 19:07:49 +01:00
Fabien Potencier
af6d11c9c6 Merge branch '2.3' into 2.4
* 2.3:
  Check headers sent before sending PHP response
  Fixed ACE domain checks on UrlValidator (#10031)
  handle array root element
2014-03-26 19:07:42 +01:00
Jerome TAMARELLE
97591c1b30 Check headers sent before sending PHP response
If the response contents has been sent before an error occurs, PHP
triggers the warning "Cannot modify header information - headers already sent"

This change ensure that the error message is echoed, while it's impossible
to change the HTTP status code and headers.
2014-03-26 19:06:50 +01:00
steveYeah
304cbe99fe Add UnprocessableEntityHttpException to HttpKernel Exceptions 2014-03-26 19:03:23 +01:00
Andrew Moore
b278aa4b02 Fix issue symfony/symfony#10345 '[FrameworkBundle][Console] container:debug --parameter="" not working anymore' 2014-03-26 18:53:45 +01:00
Colin O'Dell
19931c984c Added new validator for UUIDs 2014-03-26 18:50:25 +01:00
Diego Agulló
7a2f154533 Fixed ACE domain checks on UrlValidator (#10031) 2014-03-26 18:48:23 +01:00
Grégoire Paris
17ed8bf563 handle array root element
An array to string conversion notice was thrown when the root element of
the thing being validated is an array.
2014-03-26 18:31:52 +01:00
Gleb Sidora
9bb602fdd5 added explicit swiftmailer flush after ConsoleEvents::TERMINATE 2014-03-26 15:23:10 +01:00
Cedric LOMBARDOT
81e94d084b Model choice accept custom unique column
Use now ->add('my_field', 'model', array('class' => 'MyClassWithSlug', 'index_property' => 'slug'));
To make choice list keys as slug
2014-03-26 15:17:28 +01:00
Stefano Sala
e2d8944076 Fixed tests after merging pattern deprecation 2014-03-26 14:16:33 +01:00
Fabien Potencier
58bdf842b7 Merge branch '2.4'
* 2.4:
  [DomCrawler] fixed wrong merge
  [Filesystem] fixed a test broken after merging the 2.3 branch
2014-03-26 13:01:00 +01:00
Fabien Potencier
5808287d52 [DomCrawler] fixed wrong merge 2014-03-26 13:00:53 +01:00
Fabien Potencier
7a29818d77 [Filesystem] fixed a test broken after merging the 2.3 branch 2014-03-26 12:55:03 +01:00
Fabien Potencier
3baa43b44e Merge branch '2.4'
* 2.4: (52 commits)
  Fix #8205 : Deprecate file mode update when calling dumpFile
  Fix #10437: Catch exceptions when reloading a no-cache request
  Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
  removed ini check to make uploadedfile work on gae
  Update OptionsResolver.php
  fixed comment in forms.xml file
  Clean KernelInterface docblocks
  Cast the group name as a string
  Fixed doc of InitAclCommand
  [Form] Fix "Array was modified outside object" in ResizeFormListener.
  Fix IBAN validator
  [Process] Remove unreachable code + avoid skipping tests in sigchild environment
  Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute
  Added travis_retry to .travis.yml
  [Process] fix some typos and refactor some code
  [Process] Fix unit tests in sigchild disabled environment
  [Process] Trow exceptions in case a Process method is supposed to be called after termination
  fixed typo
  [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
  [Process] Fix escaping on Windows
  ...

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
	src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php
	src/Symfony/Component/Process/Process.php
	src/Symfony/Component/Process/ProcessPipes.php
	src/Symfony/Component/Process/Tests/AbstractProcessTest.php
2014-03-26 12:51:10 +01:00
Fabien Potencier
ab42e9cbc4 Merge branch '2.3' into 2.4
* 2.3: (34 commits)
  Fix #8205 : Deprecate file mode update when calling dumpFile
  Fix #10437: Catch exceptions when reloading a no-cache request
  Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
  removed ini check to make uploadedfile work on gae
  Update OptionsResolver.php
  fixed comment in forms.xml file
  Clean KernelInterface docblocks
  Cast the group name as a string
  Fixed doc of InitAclCommand
  [Form] Fix "Array was modified outside object" in ResizeFormListener.
  Fix IBAN validator
  [Process] Remove unreachable code + avoid skipping tests in sigchild environment
  Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute
  Added travis_retry to .travis.yml
  [Process] fix some typos and refactor some code
  [Process] Fix unit tests in sigchild disabled environment
  [Process] Trow exceptions in case a Process method is supposed to be called after termination
  fixed typo
  [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
  [Process] Fix escaping on Windows
  ...

Conflicts:
	src/Symfony/Component/DomCrawler/Crawler.php
	src/Symfony/Component/Filesystem/Filesystem.php
	src/Symfony/Component/Process/Process.php
2014-03-26 12:35:33 +01:00
kor3k
43451e9f50 made HttpFoundationRequestHandler a service 2014-03-26 10:57:26 +01:00
Stefano Sala
52c07c74ea Deprecated max_length and pattern options 2014-03-26 10:50:40 +01:00
Romain Neutron
cefb67a340 Fix #8205 : Deprecate file mode update when calling dumpFile 2014-03-26 08:33:01 +01:00
Romain Neutron
8e3a3951e3 Fix #10437: Catch exceptions when reloading a no-cache request 2014-03-26 08:25:06 +01:00
Romain Neutron
489b8aea90 Fix libxml_use_internal_errors and libxml_disable_entity_loader usage 2014-03-26 08:21:50 +01:00
Baptiste Clavié
849703a784 When a process fails, check if the output is enabled
With the recent addition of the ability to disable the output, it was
not taken into account within the `ProcessFailedException`.

So, if the output was indeed disabled, and the process returns an
error (i.e via a `mustRun`) we could have another LogicException which
is not expected.
2014-03-25 23:03:32 +01:00
Michele Orselli
ecb6481117 removed ini check to make uploadedfile work on gae 2014-03-25 17:54:15 +01:00
Sergey Kolodyazhnyy
5f3be0e7cb Fix Exception messages for ObjectIdentity ObjectIdentityInterface doesn't require implementing __toString method, so we need to make sure that object can be converted to string. 2014-03-25 17:45:52 +01:00
Shady
79ceb094f0 Update OptionsResolver.php
Deleting an extra space in the exception.
2014-03-25 14:10:48 +01:00
Fabien Potencier
f66bed7bac feature #10506 [Debug] sync with deprecation in DebugClassLoader (nicolas-grekas)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Debug] sync with deprecation in DebugClassLoader

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

Commits
-------

c70a468 [Debug] sync with deprecation in DebugClassLoader
2014-03-24 19:05:20 +01:00
Hugo Hamon
33c1ba7c79 fixed comment in forms.xml file 2014-03-24 19:01:48 +01:00
Sam Ward
e850b38464 Clean KernelInterface docblocks
- Fixed questionable grammar
- Added missing periods to make it consistent
2014-03-24 19:00:42 +01:00
Tobias Schultze
e3f17f9d30 add scheme option to router:match command 2014-03-21 17:50:06 +01:00