Commit Graph

18460 Commits

Author SHA1 Message Date
Fabien Potencier
87d4039046 [FrameworkBundle] make assets-install --relative equivalent to --symlink --relative 2014-10-04 10:17:51 +02:00
Fabien Potencier
181e460984 minor #10241 [DependencyInjection] made some perf improvements (fabpot)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[DependencyInjection] made some perf improvements

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

This PR optimizes the creation of dumped containers drastically (thanks @jpauli for the hint).

The Container class generated by the PHP dumper does not include the `getDefaultParameters()` method anymore. It does not seem like a big deal to me as I fail to see a use case where someone would override this method.

Commits
-------

e1a3ef8 [DependencyInjection] made some perf improvements
2014-09-26 07:01:55 +02:00
Fabien Potencier
ff17493029 minor #12042 Update the Controller to be consistent (grifx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

Update the Controller to be consistent

We are always using $this->container->get() and now we're using the short-cut sometimes to access to a service.
It could be nice to stay with $this->container->get() to stay consistent and for those who copy and paste the Controller to create a ControllerUtils, they wont have to change it (in fact neither ControllerUtils::get() nor ControllerUtils::has() exists).
See: http://www.whitewashing.de/2013/06/27/extending_symfony2__controller_utilities.html

Commits
-------

707623c Update the Controller to be consistent
2014-09-26 06:57:05 +02:00
grifx
707623cb16 Update the Controller to be consistent
We are always using $this->container->get() and now we're using the short-cut sometimes to access to a service.
It could be nice to stay with $this->container->get(), so for those who copy and paste the Controller to create a ControllerUtils, they wont have to change it (in fact neither ControllerUtils::get() nor ControllerUtils::has() exists).
See: http://www.whitewashing.de/2013/06/27/extending_symfony2__controller_utilities.html
2014-09-26 11:35:02 +10:00
Fabien Potencier
c06e7546ad feature #7142 [2.3] Update src/Symfony/Component/HttpFoundation/Request.php (datibbaw)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[2.3] Update src/Symfony/Component/HttpFoundation/Request.php

This makes `getContentType()` work when a regular form is submitted. It would return `"form"`

Commits
-------

c81ec4d Update src/Symfony/Component/HttpFoundation/Request.php
2014-09-25 21:49:28 +02:00
Fabien Potencier
c788b217eb minor #12041 [Security] fixed typo in method call (jdreesen)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Security] fixed typo in method call

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

Commits
-------

1226dc1 [Security] fix typo
2014-09-25 21:47:46 +02:00
Jacob Dreesen
1226dc121f [Security] fix typo 2014-09-25 21:08:05 +02:00
Fabien Potencier
37711c74c1 feature #11453 [Config] Allow extra hint in exception message (WouterJ)
This PR was squashed before being merged into the 2.6-dev branch (closes #11453).

Discussion
----------

[Config] Allow extra hint in exception message

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #1666
| License       | MIT
| Doc PR        | symfony/symfony-docs#4047

Commits
-------

3062b3e [Config] Allow extra hint in exception message
2014-09-25 20:11:49 +02:00
WouterJ
3062b3ef96 [Config] Allow extra hint in exception message 2014-09-25 20:11:47 +02:00
Fabien Potencier
15dfb0614e feature #12036 [Debug] Add link to the output of debug function (lyrixx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Debug] Add link to the output of debug function

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

![link](https://cloud.githubusercontent.com/assets/408368/4403994/98f89526-44ab-11e4-8fa8-85b58afb738a.png)
![lin2](https://cloud.githubusercontent.com/assets/408368/4403998/abbabee6-44ab-11e4-9117-f786718dfb37.png)

Commits
-------

dadd2fe [Debug] Add link to the output of debug function
2014-09-25 17:51:11 +02:00
Bernhard Schussek
69deac3014 Merge branch '2.5'
* 2.5:
  [Validator] Added ConstraintValidator::buildViolation() helper for BC with 2.4 API
  [Validator] Fixed LegacyValidator when only a constraint is validated

Conflicts:
	src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
	src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
	src/Symfony/Component/Validator/Constraints/RangeValidator.php
2014-09-25 17:49:37 +02:00
Grégoire Pineau
dadd2fe6c6 [Debug] Add link to the output of debug function 2014-09-25 16:41:33 +02:00
Fabien Potencier
af0aa501e8 feature #11993 [Security] make it possible to override the default success/failure handler (fabpot)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Security] make it possible to override the default success/failure handler

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #5432, #9272, #10417, #11926
| License       | MIT
| Doc PR        | symfony/symfony-docs#4258

Overriding the default success/failure handler of the security firewalls is possible via the `success_handler` and `failure_handler` setting but this approach is not flexible as it does not allow you to get the options/provider key.

To sum up the problem:

* Overriding the default success/failure handler is possible via a service;
* When not overridden, the default success/failure handler gets options and the provider key;
* Those options and the provider key are injected by the factory as they are dynamic (they depend on the firewall and the provider key), so getting those options/provider key is not possible for a custom service that is only configured via the container configuration;
* Extending the default handler does not help as the injection mechanism is only triggered when no custom provider is set;
* Wrapping the default handler is not possible as the service id is dynamic.

... and of course we need to keep BC and make it work for people extending the default handler but also for people just using the interface.

Instead of the current PR, I propose this slightly different approach. It's not perfect, but given the above constraint, I think this is an acceptable trade-of.

So, several use cases:

 * Using the default handler (no change);
 * Using a custom handler that implements `AuthenticationSuccessHandlerInterface` directly and does not need any options (no change);
 * Using a custom handler that needs the options/provider key (that's the new use case this PR supports).

This PR introduces 2 new classes that wrap custom handlers. If those classes define the `setOptions()` and/or `setProviderKey()` methods, they are automatically called with the correct arguments. Yours handler does not need to extend the default handler `DefaultAuthentication*Handler`, but doing so helps as the setters are already defined there.

Commits
-------

810eeaf [Security] made it possible to override the default success/failure handler (take 2)
36116fc [Security] made it possible to override the default success/failure handler
2014-09-25 16:21:08 +02:00
Fabien Potencier
d7615e70d2 bug #12016 [Validator] Added ConstraintValidator::buildViolation() helper for BC with the 2.4 API (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Added ConstraintValidator::buildViolation() helper for BC with the 2.4 API

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

This PR adds a `buildViolation()` helper method to the base `ConstraintValidator` to remove the API checks (2.4 vs. 2.5) from the constraint validator implementations. Once the 2.4 API is removed, this helper method will be removed as well.

**Todos**

- [x] Backport changes from #12021

Commits
-------

6b0c24a [Validator] Added ConstraintValidator::buildViolation() helper for BC with 2.4 API
2014-09-25 16:01:10 +02:00
Fabien Potencier
07b234e1c7 bug #12031 [Validator] Fixed LegacyValidator when only a constraint is validated (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Fixed LegacyValidator when only a constraint is validated

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

The 2.5-BC API is currently broken for the following use case:

```php
$validator->validate($value, $constraint);
```

This is fixed now.

Commits
-------

1d48206 [Validator] Fixed LegacyValidator when only a constraint is validated
2014-09-25 15:54:04 +02:00
Bernhard Schussek
b4dcd500dd feature #9033 [Form] Choice children can be template customized like collection (adrienbrault)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Choice children can be template customized like collection

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

I wanted to customize the template of a children of a choice field. I learned it was not currently possible, though it is with the collection type. So this should let people be able to customize the template for all the choice children at once.

Ie:

```jinja
{% block _user_colors_entry_widget %}
```

Still have to fix the tests

Commits
-------

4e6b27f [Form] Choice children can be template customized like collection
2014-09-25 13:44:59 +02:00
Bernhard Schussek
6b0c24adf7 [Validator] Added ConstraintValidator::buildViolation() helper for BC with 2.4 API 2014-09-25 12:25:17 +02:00
Bernhard Schussek
88a25fc817 Merge branch '2.5'
* 2.5:
  [Command] Set the process title as late as possible
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations
  remove obsolete test file
  [FrameworkBundle] output failed matched path for clarification
  bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
  [Validator] Fixed StaticMethodLoaderTest to actually test something
  [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
  Use request format from request in twig ExceptionController
  fixed bug
  added the possibility to return null from SimplePreAuthenticationListener
  [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
  [Form] Add a form error if post_max_size has been reached.
  Response::isNotModified returns true when If-Modified-Since is later than Last-Modified
  [WebProfilerBundle] turbolinks compatibility

Conflicts:
	src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
2014-09-25 12:18:55 +02:00
Fabien Potencier
f94ba9ab43 bug #12032 [Command] Set the process title as late as possible (lyrixx)
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #12032).

Discussion
----------

[Command] Set the process title as late as possible

| Q             | A
| ------------- | ---
| Bug fix?      | yes (so it could be merged into 2.5)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

To be able to customize to process title in the `initialize` method of the
current command with some arguments or options

Commits
-------

44997d3 [Command] Set the process title as late as possible
2014-09-25 11:53:57 +02:00
Grégoire Pineau
44997d35af [Command] Set the process title as late as possible
To be able to customize to process title in the `initialize`
method of the current command with some arguments or option
2014-09-25 11:53:56 +02:00
Bernhard Schussek
c48ae250ac Merge branch '2.4' into 2.5
* 2.4:
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations
  remove obsolete test file
  [FrameworkBundle] output failed matched path for clarification
  bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
  [Validator] Fixed StaticMethodLoaderTest to actually test something
  [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
  Use request format from request in twig ExceptionController
  fixed bug
  added the possibility to return null from SimplePreAuthenticationListener
  [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
  [Form] Add a form error if post_max_size has been reached.
  Response::isNotModified returns true when If-Modified-Since is later than Last-Modified
  [WebProfilerBundle] turbolinks compatibility

Conflicts:
	src/Symfony/Component/Form/Extension/Core/Type/FormType.php
	src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
	src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php
	src/Symfony/Component/Security/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
	src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php
2014-09-25 11:52:29 +02:00
Fabien Potencier
efb1237b72 Merge branch '2.3' into 2.4
* 2.3:
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations
2014-09-25 11:38:53 +02:00
Fabien Potencier
87123f6e1d minor #12015 [Validator] Simplified testing of violations (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Simplified testing of violations

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

I simplified the assertion of violations in preparation of a replacement PR for #7276.

Commits
-------

8e5537b [Validator] Simplified testing of violations
2014-09-25 11:38:09 +02:00
Fabien Potencier
b2524d4988 minor #12033 [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5 (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5

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

This argument was introduced in #11924. No release was made of the 2.3 branch after merging that PR.

Since a different constructor argument (`$requestHandler`) was added to FormTypeHttpFoundationExtension in the 2.5 branch, we cannot merge this forward in a BC fashion. For this reason, I removed the argument again.

Commits
-------

6cbc862 [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
2014-09-25 11:33:23 +02:00
Bernhard Schussek
6cbc862e19 [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5 2014-09-25 11:29:33 +02:00
Bernhard Schussek
8e5537b8a5 [Validator] Simplified testing of violations 2014-09-25 11:17:44 +02:00
Fabien Potencier
43b83cf8db Merge branch '2.3' into 2.4
* 2.3:
  remove obsolete test file
  [FrameworkBundle] output failed matched path for clarification
  bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
  [Validator] Fixed StaticMethodLoaderTest to actually test something
  [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
  Use request format from request in twig ExceptionController
  [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
  [Form] Add a form error if post_max_size has been reached.
  Response::isNotModified returns true when If-Modified-Since is later than Last-Modified
  [WebProfilerBundle] turbolinks compatibility

Conflicts:
	src/Symfony/Component/Form/CHANGELOG.md
	src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
	src/Symfony/Component/Security/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
2014-09-25 10:51:47 +02:00
Bernhard Schussek
1d48206b45 [Validator] Fixed LegacyValidator when only a constraint is validated 2014-09-25 09:57:44 +02:00
Fabien Potencier
cc396fffde feature #10694 [Security] Call AuthenticationManager in AnonymousAuthenticationListener (Kacper Gunia)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Security] Call AuthenticationManager in AnonymousAuthenticationListener

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

Commits
-------

78fa5e2 Call AuthenticationManager in AnonymousAuthenticationListener
2014-09-25 09:10:47 +02:00
Fabien Potencier
499c1ddb95 fixed a unit test 2014-09-25 09:09:09 +02:00
Fabien Potencier
fc1592a8c8 feature #11949 [Console] More consistent application description (secondtruth)
This PR was squashed before being merged into the 2.6-dev branch (closes #11949).

Discussion
----------

[Console] More consistent application description

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

Commits
-------

28edd30 [Console] More consistent application description
2014-09-25 09:07:34 +02:00
Christian Neff
28edd30007 [Console] More consistent application description 2014-09-25 09:07:30 +02:00
Fabien Potencier
108f929a14 feature #11951 New php library structure made easier (pyrech)
This PR was merged into the 2.6-dev branch.

Discussion
----------

New php library structure made easier

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

[This article](https://medium.com/@christophewillemsen/stop-making-bundles-think-bundles-deadd27b88c0) from @ikwattro gives some good ideas on how to ease the creation of a PHP package:
- which is not a bundle usable only on a symfony full stack framework
- without requiring to maintain 2 repos (one for the lib and the other for the bundle)

The only drawback is that Symfony requires the DI extension to be on a given location. So I created a new method Bundle#getContainerExtensionClass than can be easily overwritten if you want to move the Extension class in another directory.

Commits
-------

8eda6b5 New php library structure made easier
2014-09-25 09:05:01 +02:00
Fabien Potencier
d671406ae5 minor #12017 [Validator] Fixed StaticMethodLoaderTest to actually test something (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Fixed StaticMethodLoaderTest to actually test something

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

This test is not testing anything, except for whether PHP throws a strict standards error when invalid code is loaded.

I disabled error reporting for this test, so that the actual functionality (ignoring static+abstract functions) is tested.

Commits
-------

1b1303a [Validator] Fixed StaticMethodLoaderTest to actually test something
2014-09-25 09:03:01 +02:00
Fabien Potencier
240648ddcb minor #12013 [FrameworkBundle] Added unit-tests for GlobalVariables::getUser() (iltar)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Added unit-tests for GlobalVariables::getUser()

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

Tests added should explain that `getUser()` should return `null` when a string is found as user. If this is not correct, a PR should be made. However, this would result in a huge BC break due to people using `{% if app.user %}` which would return `null` if an anonymous token was found. If this suddenly returns a string, this check will fail.

While at it, I have also added `getUser()` tests to verify the unhappy flow is working. These tests uncovered that  if `$container->get('security.token_storage')` fails, it will throw an exception rather than return `null`. This issue is now fixed.

List of changes
--------------------
- The old `testGetUser` has been refactored to be tested with multiple variations of return types to verify the return type to work as the code tells.
- `get('security.token_storage')` is now only executed if `has('security.token_storage')` returns true

@fabpot I think this PR should be merged before 2.6, because it fixes an uncaught exception bug in my previous PR which splits the security context

Commits
-------

3f055f7 Fixed a bug and added unit-tests for GlobalVariables
2014-09-25 08:52:12 +02:00
Fabien Potencier
45ac2c4522 minor #12026 [FrameworkBundle] output failed matched path for clarification (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] output failed matched path for clarification

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

Because cygwin resolves the path behind the scenes, it is otherwise very unclear what path is actually used for matching.

Commits
-------

8d13af7 [FrameworkBundle] output failed matched path for clarification
2014-09-25 08:43:41 +02:00
Fabien Potencier
1104112c04 feature #12022 [HttpKernel] Extract method to instantiate controller in ControllerResolver (danharper)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[HttpKernel] Extract method to instantiate controller in ControllerResolver

Replaces #10814 to merge into `master` instead of `2.3`.

---

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

Currently it's required to duplicate the entirety of the `getController()` and `createController()` methods just to replace the call to `new` (e.g. with container resolution, instead).

Now it's possible to just override the `instantiateController()` method.

Commits
-------

88274df [HttpKernel] Extract method to make callable controller in ControllerResolver
2014-09-25 08:41:43 +02:00
Fabien Potencier
11f0cb1f0e minor #12024 [FrameworkBundle]Ignore LoggingTranslatorPass if there is no Translator ... (aitboudad)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle]Ignore LoggingTranslatorPass if there is no Translator ...

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

Commits
-------

6e1b47c [FrameworkBundle]Ignore LoggingTranslatorPass if there is no Translator definition.
2014-09-25 08:36:31 +02:00
Fabien Potencier
89d6bb7e65 minor #12027 remove obsolete test file (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

remove obsolete test file

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

I don't think this file is used anymore.

Commits
-------

83f556f remove obsolete test file
2014-09-25 07:59:15 +02:00
Tobias Schultze
83f556f0f9 remove obsolete test file 2014-09-25 02:08:46 +03:00
Tobias Schultze
8d13af77db [FrameworkBundle] output failed matched path for clarification 2014-09-25 01:57:27 +03:00
Abdellatif Ait boudad
6e1b47c3fd [FrameworkBundle]Ignore LoggingTranslatorPass if there is no Translator definition. 2014-09-24 22:15:22 +01:00
Fabien Potencier
e1a3ef8b3f [DependencyInjection] made some perf improvements 2014-09-24 17:32:45 +02:00
Fabien Potencier
a05a95c30e bug #11058 [Security] bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider (glutamatt)
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #11058).

Discussion
----------

[Security] bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider

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

[Security] fixed missing call to UserChecker::checkPreAuth

edit : after the discution with @hellomedia , i replaced postcheck with precheck
e0730e07ed (commitcomment-6580764)

Commits
-------

a38d1cd bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
2014-09-24 17:03:22 +02:00
Mathieu Morlon
a38d1cd8bf bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider 2014-09-24 17:03:18 +02:00
Iltar van der Berg
3f055f706c Fixed a bug and added unit-tests for GlobalVariables 2014-09-24 16:46:33 +02:00
Fabien Potencier
cc04ce15c0 feature #9708 [Serializer] PropertyNormalizer: a new normalizer that maps an object's properties to an array (mnapoli)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Serializer] PropertyNormalizer: a new normalizer that maps an object's properties to an array

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | if PR is deemed mergeable, I'll write the docs

This PR adds a new Normalizer for the Serializer component: **`PropertyNormalizer`**.

Currently the only normalizer is `GetSetMethodNormalizer`, which calls getters and setters. This new serializer uses the properties values directly.

This is especially useful if you write a webservice and take/return very simple DTO (Data Transfer Objects) which role is only to act like a "named" `stdClass`. Every property is public (the class doesn't contain any logic), and mapping that to an array is pretty easy.

This normalizer takes into account public, but also *private* and *protected* properties.

FYI I've based most of the code of `GetSetMethodNormalizer`.

Commits
-------

78ceed1 [Serializer] Added PropertyNormalizer, a new normalizer that maps an object's properties to an array
2014-09-24 16:31:38 +02:00
Bernhard Schussek
1b1303a8d8 [Validator] Fixed StaticMethodLoaderTest to actually test something 2014-09-24 16:07:14 +02:00
Fabien Potencier
bc8ee6f497 bug #12004 [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required

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

Consider the following entity:

```php
class Author
{
    /**
     * @Assert\NotBlank
     */
    private $name;

    private $age;
}
```

Right now, the "required" HTML attribute is set for both fields (since the default value of the "required" option is true). IMO this is wrong.

With this fix, the ValidatorTypeGuesser guesses `false` for the "required" option unless a NotNull/NotBlank constraint is present.

Commits
-------

fd77b09 [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
2014-09-24 14:19:03 +02:00
Bernhard Schussek
fd77b09fba [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required 2014-09-24 14:11:43 +02:00