Commit Graph

21427 Commits

Author SHA1 Message Date
maxime.steinhausser ea71174fb7 [TwigBridge] Make AppVariable check if security.context exists
If security isn't configured in the application, the `security.context` service, nor the `security.token_storage` service exists.
Therefore, if a third-party bundle relies on the app.user check in Twig templates, an exception was thrown about asking for an non-existing service.
Instead, this change check if the `security.context` actually exists before trying to use it, and return null otherwise.
2015-06-01 16:10:45 +02:00
Abdellatif Ait boudad 3061ace2bf [WebProfilerBundle][logger] added missing deprecation message. 2015-06-01 09:10:59 +00:00
Benjamin Laugueux fb9e5bfc69 Fix profiler CSS 2015-06-01 10:01:07 +02:00
Abdellatif Ait boudad 7220f2c880 [Translator] avoid serialize unserializable resources. 2015-05-31 17:58:25 +00:00
Christian Flothmann bbb1064c99 [Security][Acl] enforce string identifiers 2015-05-31 17:00:49 +02:00
Christian Flothmann 95dcfa2ee6 [FrameworkBundle] make `templating.helper.router` service available again for BC reasons 2015-05-30 22:40:00 +02:00
Hassan Amouhzi 6d3ec633cd [BrowserKit] Fix bug when uri starts with http.
| Q             | A
| ------------- | ---
| Fixed tickets |
| License       | MIT
2015-05-30 22:07:20 +02:00
ogizanagi fc598ff6ad [Console] SymfonyStyle : fix & automate block gaps.
Autoprepend appropriate blocks by the correct number of blank lines.
Handle most of the SymfonyStyle guide line breaks and gaps automatically and fix thing such as double blank lines between titles.
Add output tests.
Fix askQuestion method, which should not output anything when the input isn't interactive.
2015-05-30 20:12:12 +02:00
Fabien Potencier 7493c2bef5 bumped Symfony version to 2.7.1 2015-05-30 19:16:04 +02:00
Fabien Potencier 9975b1eca3 updated VERSION for 2.7.0 2015-05-30 18:52:28 +02:00
Fabien Potencier c16e122590 updated CHANGELOG for 2.7.0 2015-05-30 18:52:19 +02:00
ogizanagi 260702eae8 [Console] SymfonyStyle : Improve EOL consistency by relying on output instance 2015-05-30 12:54:49 +02:00
Fabien Potencier e2b74ca429 Merge branch '2.6' into 2.7
* 2.6:
  bumped Symfony version to 2.6.10
  updated VERSION for 2.6.9
  updated CHANGELOG for 2.6.9
  fixed tests
  Avoid using the app global variable in the profiler templates

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2015-05-30 01:30:31 +02:00
Fabien Potencier 390e9b4dc6 bumped Symfony version to 2.6.10 2015-05-30 01:26:13 +02:00
Fabien Potencier b06539573c updated VERSION for 2.6.9 2015-05-30 00:55:07 +02:00
Fabien Potencier c6bf554a2f updated CHANGELOG for 2.6.9 2015-05-30 00:55:02 +02:00
Fabien Potencier b5f7196bf5 fixed tests 2015-05-30 00:53:29 +02:00
Fabien Potencier cff69aa18b bumped Symfony version to 2.3.31 2015-05-30 00:42:49 +02:00
Fabien Potencier 6dfe5551b7 updated VERSION for 2.3.30 2015-05-30 00:16:04 +02:00
Fabien Potencier cceb63e6d5 updated CHANGELOG for 2.3.30 2015-05-30 00:15:41 +02:00
Vladimir Reznichenko 9eb2b14115 Php Inspections (EA Extended):
- resolved possible PHP Fatal in \Symfony\Component\BrowserKit\Cookie::__toString
    -resolved implicit magic methods calls
    -resolved callable name case mismatches
2015-05-29 19:14:48 +02:00
Fabien Potencier d9550362ef minor #14782 Adding UPGRADE-2.7 about small BC break in InputDefinition (weaverryan)
This PR was merged into the 2.7 branch.

Discussion
----------

Adding UPGRADE-2.7 about small BC break in InputDefinition

Hi guys!

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

In #13220, a small BC break was introduced when `InputDefinition::getSynopsis()` was given an optional argument. This, for example, breaks Behat 2.5, which overrides this method. I don't think this was noticed before, and it may be too late (or not worth it) to reverse the BC break.

So, I've at least doc'ed it.

Thanks!

Commits
-------

a7985d2 Fixing phpdoc typo
c35f2c8 Talking about getSynopsis()
2015-05-29 19:13:39 +02:00
Fabien Potencier 2e3040cefe bug #14777 Avoid using the app global variable in the profiler templates (stof)
This PR was merged into the 2.6 branch.

Discussion
----------

Avoid using the app global variable in the profiler templates

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | small one for people overwriting the WebDebugToolbarListener methods
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/silexphp/Silex-WebProfiler/issues/64
| License       | MIT
| Doc PR        | n/a

#14217 introduced a usage of the ``app`` global variables in profiler templates, while we previously removed all such usages to avoid the dependency on TwigBundle in these templates.
This keeps them usable outside the fullstack framework (for instance in Silex).

I had to do a small BC break to be able to pass the request in the place where we were not yet injecting the Request in the template.

Commits
-------

415c79e Avoid using the app global variable in the profiler templates
2015-05-29 18:43:31 +02:00
Ryan Weaver a7985d244c Fixing phpdoc typo 2015-05-29 12:22:24 -04:00
Ryan Weaver c35f2c8482 Talking about getSynopsis() 2015-05-29 12:21:38 -04:00
Fabien Potencier b07eca5453 Merge branch '2.6' into 2.7
* 2.6: (21 commits)
  Revert "bug #14262 [TwigBundle] Refresh twig paths when resources change. (aitboudad)"
  InvalidResourceException file name
  [Validators] Remove forgotten space in a translation key [nl]
  [Validators] Correct translation key and content [nl]
  bumped Symfony version to 2.6.9
  updated VERSION for 2.6.8
  updated CHANGELOG for 2.6.8
  added missing CVE number
  bumped Symfony version to 2.3.30
  updated VERSION for 2.3.29
  update CONTRIBUTORS for 2.3.29
  updated CHANGELOG for 2.3.29
  [Validators] Missing translations for arabic language.
  Code style
  fixed C
  [HttpKernel][Bundle] Check extension implements ExtensionInterface
  [DebugBundle] Fix config XSD
  [CS] [Console] StreamOuput : fix loose comparison
  [Framework][router commands] fixed failing test.
  [HttpKernel] Do not call the FragmentListener if _controller is already defined
  ...

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php
2015-05-29 16:44:44 +02:00
Fabien Potencier c349cb3528 Merge branch '2.3' into 2.6
* 2.3:
  Revert "bug #14262 [TwigBundle] Refresh twig paths when resources change. (aitboudad)"
  InvalidResourceException file name
  [Validators] Remove forgotten space in a translation key [nl]
  [Validators] Correct translation key and content [nl]
  added missing CVE number
  bumped Symfony version to 2.3.30
  updated VERSION for 2.3.29
  update CONTRIBUTORS for 2.3.29
  updated CHANGELOG for 2.3.29
  [CS] [Console] StreamOuput : fix loose comparison
  [DependencyInjection] Avoid unnecessary calls to strtolower()

Conflicts:
	src/Symfony/Component/Console/Output/StreamOutput.php
	src/Symfony/Component/HttpKernel/Kernel.php
2015-05-29 16:42:58 +02:00
Fabien Potencier a3ee1c5c09 Revert "bug #14262 [TwigBundle] Refresh twig paths when resources change. (aitboudad)"
This reverts commit 4d40852596, reversing
changes made to dd2fb850a7.
2015-05-29 16:42:01 +02:00
Christophe Coevoet 415c79e0a6 Avoid using the app global variable in the profiler templates
This keeps them usable outside the fullstack framework (for instance in
Silex).
2015-05-29 10:20:13 +02:00
Fabien Potencier a78d939da1 minor #14776 Adding notes about deprecated warnings in 2.7 (weaverryan)
This PR was merged into the 2.7 branch.

Discussion
----------

Adding notes about deprecated warnings in 2.7

| 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

Hi guys!

When I upgraded, my project exploded with deprecated warnings. I'm certain we'll get a lot of questions about these, so I think we should try to get ahead of these questions as much as possible. I'm adding this - if I'm mistaken in anything, please let me know. I also think we should mention this in the release blog post so that people are aware.

I'm about to propose a short docs entry to explain things there too (so that hopefully if someone googles for the issue, they'll find our explanation).

Thanks!

Commits
-------

e374274 Adding notes about deprecated warnings in 2.7
2015-05-29 06:53:58 +02:00
Ryan Weaver e374274159 Adding notes about deprecated warnings in 2.7 2015-05-28 20:33:45 -04:00
Fabien Potencier afd0b105a1 minor #14762 InvalidResourceException file name (DancZer)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #14762).

Discussion
----------

InvalidResourceException file name

Added filen ame to the InvalidResourceException,

Commits
-------

2e04e23 InvalidResourceException file name
2015-05-28 22:42:23 +02:00
Ladislav Tánczos 2e04e23c6a InvalidResourceException file name 2015-05-28 22:42:23 +02:00
Fabien Potencier 41adf224b5 minor #14643 [DependencyInjection] Avoid unnecessary calls to strtolower() (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] Avoid unnecessary calls to strtolower()

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

Commits
-------

c27f564 [DependencyInjection] Avoid unnecessary calls to strtolower()
2015-05-28 16:28:38 +02:00
Fabien Potencier a4e126d531 minor #14765 [Validators] Correct translation key and content [nl] (amouhzi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validators] Correct translation key and content [nl]

The nl file is not up to date. Correct changed translation key.

Commits
-------

5bc4085 [Validators] Correct translation key and content [nl]
2015-05-28 05:26:02 +02:00
Fabien Potencier fc39317691 minor #14766 [Validators] Remove forgotten space in a translation key [nl] (amouhzi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validators] Remove forgotten space in a translation key [nl]

The nl file is not up to date. Correct changed translation key.

Commits
-------

51e3c22 [Validators] Remove forgotten space in a translation key [nl]
2015-05-28 05:24:15 +02:00
Hassan Amouhzi 51e3c222d4 [Validators] Remove forgotten space in a translation key [nl] 2015-05-27 23:21:50 +02:00
Hassan Amouhzi 5bc4085e4c [Validators] Correct translation key and content [nl] 2015-05-27 23:11:20 +02:00
Fabien Potencier 86ab2505a9 minor #14742 [CS] [Console] StreamOuput : fix loose comparison (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

[CS] [Console] StreamOuput : fix loose comparison

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

Commits
-------

cd70ca8 [CS] [Console] StreamOuput : fix loose comparison
2015-05-27 20:33:26 +02:00
Fabien Potencier 31b5e5c5b1 minor #14758 [Serializer] [2.6] Code style (derrabus)
This PR was merged into the 2.6 branch.

Discussion
----------

[Serializer] [2.6] Code style

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

This PR fixes some minor code style issues fabbot discovered while I was working on PR #14756.

Commits
-------

864136a Code style
2015-05-27 20:30:26 +02:00
Kévin Dunglas 2983ecbf3d feature #14756 [Serializer] Support for array denormalization (derrabus)
This PR was merged into the 2.8 branch.

Discussion
----------

[Serializer] Support for array denormalization

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

This is a rebase of #14343 against the 2.8 branch.

I had to implement a couple of API endpoints that receive data as JSON-serialized arrays of objects. The current implementation of the Serializer component is capable of serializing such arrays, but so far this operation is a one-way-road. This PR is an attempt to change this.

## Demo
```php
class Dummy
{
    public $foo;
    public $bar;

    public function __construct($foo = null, $bar = null)
    {
        $this->foo = $foo;
        $this->bar = $bar;
    }
}

$serializer = new \Symfony\Component\Serializer\Serializer(
    array(
        new \Symfony\Component\Serializer\Normalizer\PropertyNormalizer(),
        new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer()
    ),
    array(
        new \Symfony\Component\Serializer\Encoder\JsonEncoder()
    )
);

$json = $serializer->serialize(
    array(
        new Dummy('one', 'two'),
        new Dummy('three', 'four')
    ),
    'json'
);

echo $json . "\n\n";

// Deserialize the JSON string, so we get back to where we started from.
$data = $serializer->deserialize($json, 'Dummy[]', 'json');

var_dump($data);
```

By appending `[]` to the type parameter, you indicate that you expect to deserialize an array of objects of the given type. This is the same notation that phpDocumentor uses to indicate collections. The denormalization of the array is implemented recursively: The denormalizer simply calls `Serializer::denormalize()` on each element of the array. This way, the ArrayDenormalizer can be combined with any other denormalizer.

## Side effects

For this implementation, I had to touch `GetSetMethodNormalizer`, `PropertyNormalizer` and `CustomNormalizer`. Those classes expected `supportsDenormalization` to be called with a valid class in the `$type` parameter. Instead of throwing a reflection exception, they now simply return false. I'm not exactly sure, if this is should be considered to be a BC break.

This implementation violates the `SerializerInterface` which declared `deserialize()` to always return an object. But imho, the assumption that serialized data always represents an object is too restrictive anyway. Also, this declaration is not consistent with the `serialize()` method which accepts `mixed` as input type for the data to serialize.

## Other PRs

I've found an older PR adressing this issue, #12066. That PR was closed because the contributor did not reply to feedback.

Commits
-------

0573f28d Support for array denormalization.
2015-05-27 13:35:50 +02:00
Fabien Potencier 9f5a6c6b66 bumped Symfony version to 2.6.9 2015-05-27 02:47:03 +02:00
Fabien Potencier 7ae1934082 updated VERSION for 2.6.8 2015-05-27 02:17:10 +02:00
Fabien Potencier 53c60cb825 updated CHANGELOG for 2.6.8 2015-05-27 02:17:02 +02:00
Fabien Potencier ce2a47abe2 added missing CVE number 2015-05-27 01:41:50 +02:00
Fabien Potencier a8886615e4 bumped Symfony version to 2.3.30 2015-05-27 01:35:14 +02:00
Fabien Potencier c4da51ce0f updated VERSION for 2.3.29 2015-05-26 23:55:27 +02:00
Fabien Potencier da10a3cb20 update CONTRIBUTORS for 2.3.29 2015-05-26 23:46:03 +02:00
Fabien Potencier a5914d283b updated CHANGELOG for 2.3.29 2015-05-26 23:45:29 +02:00
Nicolas Grekas 662346403b Merge branch '2.3' into 2.6
* 2.3:
  [Validators] Missing translations for arabic language.
  fixed C
  [HttpKernel][Bundle] Check extension implements ExtensionInterface
  [HttpKernel] Do not call the FragmentListener if _controller is already defined
2015-05-26 14:42:28 -07:00