Commit Graph

10413 Commits

Author SHA1 Message Date
Nicolas Grekas
9b9fb5a160 [VarDumper] polymorphic and stateless output selection 2014-10-31 12:13:41 +01:00
Bernhard Schussek
99cfa8edf0 bug #12294 [OptionsResolver] fix count() and exceptions (Tobion)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[OptionsResolver] fix count() and exceptions

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

Please see commits.

Commits
-------

b93c4c0 [OptionsResolver] add missing exception based on OutOfBoundsException and clarify message
8bcbcc3 [OptionsResolver] fix calling resolve from within closure
dc1250c [OptionsResolver] fix invalid value exception formatting
6c2130f [OptionsResolver] fix counting of options
2014-10-27 22:48:40 +01:00
Daniel Wehner
cd2c2e332e decodes some special chars in a URL query 2014-10-26 21:31:09 +01:00
Fabien Potencier
96210c2e1f bug #12285 Various fixes (nicolas-grekas)
This PR was merged into the 2.6-dev branch.

Discussion
----------

Various fixes

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

A 3 in one PR (diff is best viewed [with whitespaces ignored](https://github.com/symfony/symfony/pull/12285/files?w=1)):
- changed the way the DebugHandlerListeners desactivates itself
- reduced a N×N iteration to a N one in ContainerAwareEventListener::removeListener
- fixed an issue in VarDumper

Commits
-------

ac8efd9 [HttpKernel] fix DebugHandlersListener
5af0f89 [EventDispatcher] perf optim
c7cf6cf [VarDumper] fix control chars styling
2014-10-26 08:50:57 +01:00
Fabien Potencier
842cba1d0c Merge branch '2.5'
* 2.5:
  Remove aligned '=>' and '='
  Break infinite loop while resolving aliases
  [Security][listener] change priority of switchuser
  Improved the phpdoc for security token classes
  bumped Symfony version to 2.5.7
  updated VERSION for 2.5.6
  updated CHANGELOG for 2.5.6
  bumped Symfony version to 2.3.22
  updated VERSION for 2.3.21
  update CONTRIBUTORS for 2.3.21
  updated CHANGELOG for 2.3.21

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
	src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php
	src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
	src/Symfony/Component/Debug/ErrorHandler.php
	src/Symfony/Component/Debug/ExceptionHandler.php
	src/Symfony/Component/Form/Extension/Core/Type/BaseType.php
	src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
	src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
	src/Symfony/Component/Form/Extension/Core/Type/DateType.php
	src/Symfony/Component/Form/Extension/Core/Type/TimeType.php
	src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php
	src/Symfony/Component/HttpFoundation/Request.php
	src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php
	src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Security/Core/SecurityContextInterface.php
	src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php
	src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php
	src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php
	src/Symfony/Component/Serializer/Serializer.php
	src/Symfony/Component/Validator/Constraints/File.php
2014-10-26 08:46:28 +01:00
Fabien Potencier
b5b12a54f7 Merge branch '2.3' into 2.5
* 2.3:
  Remove aligned '=>' and '='
  Break infinite loop while resolving aliases
  [Security][listener] change priority of switchuser
  Improved the phpdoc for security token classes
  bumped Symfony version to 2.3.22
  updated VERSION for 2.3.21
  update CONTRIBUTORS for 2.3.21
  updated CHANGELOG for 2.3.21

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
	src/Symfony/Bridge/Propel1/Form/Type/ModelType.php
	src/Symfony/Bridge/Propel1/Logger/PropelLogger.php
	src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php
	src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
	src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php
	src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
	src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php
	src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php
	src/Symfony/Component/Console/Descriptor/JsonDescriptor.php
	src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
	src/Symfony/Component/Console/Helper/ProgressHelper.php
	src/Symfony/Component/Debug/ErrorHandler.php
	src/Symfony/Component/DependencyInjection/Container.php
	src/Symfony/Component/Finder/Shell/Command.php
	src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php
	src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php
	src/Symfony/Component/Form/Extension/Core/Type/FormType.php
	src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php
	src/Symfony/Component/Form/Extension/Core/Type/NumberType.php
	src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php
	src/Symfony/Component/HttpFoundation/File/UploadedFile.php
	src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
	src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php
	src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php
	src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php
	src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
	src/Symfony/Component/Routing/Route.php
	src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php
	src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php
	src/Symfony/Component/Templating/PhpEngine.php
	src/Symfony/Component/Validator/Constraints/ImageValidator.php
	src/Symfony/Component/Validator/Constraints/TypeValidator.php
2014-10-26 08:41:27 +01:00
Fabien Potencier
20e7cf12ba minor #12293 Remove aligned '=>' and '=' (disquedur)
This PR was squashed before being merged into the 2.3 branch (closes #12293).

Discussion
----------

Remove aligned '=>' and '='

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | [https://github.com/symfony/symfony/issues/12284]
| License       | MIT

Could you said to me if i should make an other PR for 2.5 branch.

Commits
-------

51312d3 Remove aligned '=>' and '='
2014-10-26 08:31:56 +01:00
Disquedur
51312d31cc Remove aligned '=>' and '=' 2014-10-26 08:30:58 +01:00
Karoly Negyesi
acbde502bf Break infinite loop while resolving aliases 2014-10-26 08:26:27 +01:00
Tobias Schultze
b93c4c072c [OptionsResolver] add missing exception based on OutOfBoundsException and clarify message 2014-10-24 17:00:21 +02:00
Tobias Schultze
8bcbcc3fd7 [OptionsResolver] fix calling resolve from within closure 2014-10-24 17:00:10 +02:00
Tobias Schultze
dc1250c2b8 [OptionsResolver] fix invalid value exception formatting 2014-10-24 17:00:04 +02:00
Tobias Schultze
6c2130f578 [OptionsResolver] fix counting of options
and make sure the tests are compatible with phpunit strict mode
2014-10-24 16:59:59 +02:00
Christophe Coevoet
7b6d115a27 Improved the phpdoc for security token classes 2014-10-24 11:21:28 +02:00
Fabien Potencier
0f4993bd2a bumped Symfony version to 2.5.7 2014-10-24 10:21:46 +02:00
Fabien Potencier
1a1b1e5289 updated VERSION for 2.5.6 2014-10-24 08:55:39 +02:00
Fabien Potencier
016b0a9ad2 bumped Symfony version to 2.3.22 2014-10-24 08:50:18 +02:00
Fabien Potencier
0a6e90e091 updated VERSION for 2.3.21 2014-10-24 07:54:08 +02:00
Fabien Potencier
4a1375586c Merge branch '2.5'
* 2.5:
  enforce memcached version to be 2.1.0
  [PropertyAccess] Simplified code
  [FrameworkBundle] improve server:run feedback
  [Form] no need to add the url listener when it does not do anything
  [Form] Fix #11694 - Enforce options value type check in some form types
  Lithuanian security translations
  [SecurityBundle] Add trust_resolver variable into expression | Q             | A | ------------- | --- | Bug fix?      | [yes] | New feature?  | [no] | BC breaks?    | [no] | Deprecations? | [no] | Tests pass?   | [yes] | Fixed tickets | [#12224] | License       | MIT | Doc PR        | [-]
  [Router] Cleanup
  Fixed UPGRADE-3.0.md markup
  [FrameworkBundle] Fixed ide links
  Add missing argument
  [TwigBundle] do not pass a template reference to twig
  [TwigBundle] show correct fallback exception template in debug mode
  [TwigBundle] remove unused email placeholder from error page
  use meta charset in layouts without legacy http-equiv

Conflicts:
	src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
2014-10-24 07:51:19 +02:00
Fabien Potencier
7b43827b17 Merge branch '2.3' into 2.5
* 2.3:
  enforce memcached version to be 2.1.0
  [FrameworkBundle] improve server:run feedback
  [Form] no need to add the url listener when it does not do anything
  [Form] Fix #11694 - Enforce options value type check in some form types
  Lithuanian security translations
  [Router] Cleanup
  [FrameworkBundle] Fixed ide links
  Add missing argument
  [TwigBundle] do not pass a template reference to twig
  [TwigBundle] show correct fallback exception template in debug mode
  [TwigBundle] remove unused email placeholder from error page
  use meta charset in layouts without legacy http-equiv

Conflicts:
	src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php
	src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig
2014-10-24 07:49:22 +02:00
Christian Flothmann
2ac5c86e37 enforce memcached version to be 2.1.0
The signature of the `Memcached::get()` method changed with 2.2.0.
Therefore, tests fail in Symfony when mocking `Memcached` in the
`MemcachedSessionHandlerTest` of the HttpFoundation component (see
also php-memcached-dev/php-memcached#126 and
https://bugs.php.net/bug.php?id=66331).
2014-10-23 15:11:04 +02:00
Bernhard Schussek
b712ac1174 [PropertyAccess] Simplified code 2014-10-22 19:15:20 +02:00
Bernhard Schussek
d1e246e6b8 minor #12277 [Validator] update allowed variants documentation (xabbuh)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Validator] update allowed variants documentation

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

Commits
-------

4e3b78f update allowed variants documentation
2014-10-22 18:33:02 +02:00
Nicolas Grekas
ac8efd92d1 [HttpKernel] fix DebugHandlersListener 2014-10-22 17:32:46 +02:00
Nicolas Grekas
5af0f899fe [EventDispatcher] perf optim 2014-10-22 17:32:42 +02:00
Nicolas Grekas
c7cf6cfefe [VarDumper] fix control chars styling 2014-10-22 14:09:12 +02:00
Bernhard Schussek
8838143e6f bug #12156 [OptionsResolver] Merged Options class into OptionsResolver (webmozart)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[OptionsResolver] Merged Options class into OptionsResolver

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #4500, #9174, #10585, #10202, #11020, makes #7979+#10616 obsolete
| License       | MIT
| Doc PR        | symfony/symfony-docs#4159

#11716 was reverted as preparation of this PR (453882cd03).

The Options class was merged into OptionsResolver. This made it possible to fix several tickets, as indicated above.

**Usage**

See [the updated documentation](https://github.com/webmozart/symfony-docs/blob/issue11705/components/options_resolver.rst).

**Bug Fixes**

Previously, the options weren't validated before the normalizers were called. As a result, the normalizers had to perform validation again:

```php
$resolver->setAllowedTypes(array(
    'choices' => 'array',
));
$resolver->setNormalizers(array(
    'choices' => function (Options $options, $value) {
         array_merge($options['choices'], ...);
    },
));

// fatal error
$resolver->resolve(array('choices' => 'foobar'));
```

This is fixed now.

**BC Breaks**

The `array` type hint was removed from `setRequired()`, `setAllowedValues()`, `addAllowedValues()`, `setAllowedTypes()` and `addAllowedTypes()`. If anybody implemented `OptionsResolverInterface`, they must adapt their code.

The Options class was turned into an interface extending ArrayAccess and Countable. Anybody instantiating Options directly should instantiate OptionsResolver instead. Anybody using any of the methods available in Options (`get()`, `has()`) should use the ArrayAccess interface instead.

Normalizers are not called anymore for undefined options (#9174). People need to set a default value if they want a normalizer to be executed independent of the options passed to `resolve()`.

**Deprecations**

OptionsResolverInterface was deprecated and will be removed in 3.0. OptionsResolver instances are not supposed to be shared between classes, hence an interface does not make sense.

Several other methods were deprecated. See the CHANGELOG and UPGRADE-2.6 files for information.

**Todo**

- [x] Fix PHPDoc
- [x] Adapt CHANGELOG/UPGRADE
- [x] Adapt documentation
- [x] Deprecate OptionsResolver[Interface]

Commits
-------

642c119 [OptionsResolver] Merged Options class into OptionsResolver
2014-10-22 11:09:59 +02:00
Bernhard Schussek
642c119e0c [OptionsResolver] Merged Options class into OptionsResolver 2014-10-22 11:07:34 +02:00
Christian Flothmann
4e3b78f5bb update allowed variants documentation 2014-10-21 17:54:16 +02:00
Fabien Potencier
22d3df8f0f feature #12256 [VarDumper] add meta-data on hover (nicolas-grekas)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[VarDumper] add meta-data on hover

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

This PR adds meta-data on hover to HTML dumps:
- strings length
- constants value
- control chars code
- local refs count

Commits
-------

bef48b3 [VarDumper] add meta-data on hover
2014-10-21 14:25:39 +02:00
Bernhard Schussek
453882cd03 Revert "feature #11716 [OptionsResolver] Added a light-weight, low-level API for basic option resolving (webmozart)"
This reverts commit aa594450d2, reversing
changes made to cc63edbfa8.
2014-10-21 11:07:51 +02:00
Nicolas Grekas
bef48b3bc1 [VarDumper] add meta-data on hover 2014-10-20 21:11:43 +02:00
Bernhard Schussek
91fde699aa minor #12242 [Form] no need to add the url listener when it does not do anything (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] no need to add the url listener when it does not do anything

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

In line with #11696

Commits
-------

7aea1c9 [Form] no need to add the url listener when it does not do anything
2014-10-20 12:59:59 +02:00
Fabien Potencier
a05379eab0 feature #12098 [Serializer] Handle circular references (dunglas)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Serializer] Handle circular references

| Q             | A
| ------------- | ---
| Bug fix?      | Yes: avoid infinite loops. Allows to improve #5347
| New feature?  | yes (circular reference handler)
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | symfony/symfony-docs#4299

This PR adds handling of circular references in the `Serializer` component.
The number of allowed iterations is configurable (one by default).
The behavior when a circular reference is detected is configurable. By default an exception is thrown. Instead of throwing an exception, it's possible to register a custom handler (e.g.: a Doctrine Handler returning the object ID).

Usage:
```php
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
use Symfony\Component\Serializer\Serializer;

class MyObj
{
    private $id = 1312;

    public function getId()
    {
        return $this->getId();
    }

    public function getMe()
    {
        return $this;
    }
}

$normalizer = new GetSetMethodNormalizer();
$normalizer->setCircularReferenceLimit(3);
$normalizer->setCircularReferenceHandler(function ($obj) {
    return $obj->getId();
});

$serializer = new Serializer([$normalizer]);
$serializer->normalize(new MyObj());
```

Commits
-------

48491c4 [Serializer] Handle circular references
2014-10-20 11:20:49 +02:00
Fabien Potencier
8487ef2c0c minor #12230 [Security] Lithuanian security translations (tadcka)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] Lithuanian security translations

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

Commits
-------

2e573f1 Lithuanian security translations
2014-10-17 11:15:13 +02:00
Nicolas Grekas
3c401af023 [VarDumper] enhance dumping refs 2014-10-17 09:38:59 +02:00
Tobias Schultze
7aea1c9808 [Form] no need to add the url listener when it does not do anything 2014-10-17 01:39:03 +02:00
Stepan Anchugov
0af6467757 [Form] Fix #11694 - Enforce options value type check in some form types 2014-10-16 11:06:53 +02:00
Tadas Gliaubicas
2e573f1c81 Lithuanian security translations 2014-10-15 16:10:58 +03:00
Nikita Gusakov
5a6677d216 [Router] Cleanup 2014-10-13 14:38:27 +02:00
Fabien Potencier
8e42756c37 minor #12191 [Security] More accurate docblocks for AbstractVoter (johnkary)
This PR was squashed before being merged into the 2.6-dev branch (closes #12191).

Discussion
----------

[Security] More accurate docblocks for AbstractVoter

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

Two fixes for docblocks in AbstractVoter:

1. Previously the example return value for a few methods used PHP's short array syntax (>= PHP 5.4). Symfony minimum PHP is 5.3 so the docblock examples should be compatible with that.

2. Previously getSupportedClasses() docblock had an example return value showing a FQCN using a leading slash. AbstractVoter looks for `get_class($object)` in the array of getSupportedClasses() returned values, and `get_class()` returns the FQCN without a leading slash.

Commits
-------

ed226ec [Security] More accurate docblocks for AbstractVoter
2014-10-10 18:59:55 +02:00
John Kary
ed226ec258 [Security] More accurate docblocks for AbstractVoter 2014-10-10 18:59:52 +02:00
Kévin Dunglas
48491c4441 [Serializer] Handle circular references 2014-10-09 19:55:06 +02:00
Fabien Potencier
60d006df43 minor #12192 use meta charset in layouts without legacy http-equiv (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

use meta charset in layouts without legacy http-equiv

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

`<meta charset="UTF-8" />` is now the recommended approach

Commits
-------

96e7b01 use meta charset in layouts without legacy http-equiv
2014-10-09 19:34:46 +02:00
Tobias Schultze
96e7b01602 use meta charset in layouts without legacy http-equiv 2014-10-09 18:42:17 +02:00
Tobias Schultze
41412f99f0 [Routing] unify fluent interface in RequestContext 2014-10-09 18:12:58 +02:00
Fabien Potencier
8203c66e3a Merge branch '2.5'
* 2.5:
  [Routing] add tests for RequestContext
  [Routing] fix inconsistencies in RequestContext
  don't raise warnings when exception is thrown
  [Framework][DX] Set the proper validator class according to the configured api version
2014-10-09 18:00:19 +02:00
Fabien Potencier
b4ed800529 Merge branch '2.3' into 2.5
* 2.3:
  [Routing] add tests for RequestContext
  [Routing] fix inconsistencies in RequestContext
  don't raise warnings when exception is thrown
2014-10-09 18:00:03 +02:00
Tobias Schultze
676c4a0253 [Routing] add tests for RequestContext 2014-10-09 17:28:58 +02:00
Tobias Schultze
f61607f5cb [Routing] fix inconsistencies in RequestContext 2014-10-09 17:27:10 +02:00