Commit Graph

29323 Commits

Author SHA1 Message Date
Fabien Potencier
203625ce07 Merge branch '2.8' into 3.2
* 2.8:
  fixed tests
  revert typo fix
  [Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily
  Test inline styles with non-decorated formatter
  Fix RuntimeException when an Emacs buffer is modified
  [Yaml] add tests for specific mapping keys
2017-03-01 10:18:25 -08:00
Fabien Potencier
4b27628bca fixed tests 2017-03-01 10:16:08 -08:00
Fabien Potencier
2d174f2bc3 Merge branch '2.7' into 2.8
* 2.7:
  revert typo fix
  [Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily
  Test inline styles with non-decorated formatter
  Fix RuntimeException when an Emacs buffer is modified
  [Yaml] add tests for specific mapping keys
2017-03-01 10:13:50 -08:00
Fabien Potencier
a786b5aaaf revert typo fix 2017-03-01 06:59:13 -08:00
Fabien Potencier
817524889c bug #21267 [Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily (issei-m)
This PR was squashed before being merged into the 2.7 branch (closes #21267).

Discussion
----------

[Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily

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

Fixed ChoiceType to protect against some problem caused by treating of array.

Let's say we have the choice-form like:

```php
$form = $factory->create(ChoiceType, null, [
    'choices' => [
        'A',
        'B',
        'C',
    ],
    'expanded' => true,
    'multiple' => true,
]);
```

Then, submit data like this:

```php
$form->submit([
    [], // unnecessality nested
]);
```

(Yes, I agree in most cases these situation doesn't happen, but can be)

Then, we get `array_flip(): Can only flip STRING and INTEGER values!` error at [here](6babdb3296/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php (L114)).
Even if form is not `multiple`, annoying `Array to string conversion` error occurs in [here](6babdb3296/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php (L144)) (via [ChoicesToValuesTransformer](5129c4cf7e/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToValuesTransformer.php (L74))).
(As far as I know, non-multiple and non-expanded form has no problem, thanks to [ChoiceToValueTransformer](6babdb3296/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php (L43)))

To resolve these problems, I just added a simple-validation listener to choice type.

Commits
-------

64d7a82d28 [Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily
2017-03-01 06:57:41 -08:00
Issei.M
64d7a82d28 [Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily 2017-03-01 06:57:38 -08:00
Fabien Potencier
891f4e7311 bug #21813 Update phpstorm helper to the official format (pierredup)
This PR was merged into the 3.2 branch.

Discussion
----------

Update phpstorm helper to the official format

| Q             | A
| ------------- | ---
| Branch?       | 3.2 <!--see comment below-->
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

Commits
-------

eb09d7cc2e Fix phpstorm helper to the official format
2017-03-01 06:55:48 -08:00
Pierre du Plessis
eb09d7cc2e Fix phpstorm helper to the official format 2017-03-01 16:46:28 +02:00
Fabien Potencier
0a15eea264 minor #21650 [Yaml] add tests for specific mapping keys (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] add tests for specific mapping keys

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | see https://github.com/symfony/symfony/pull/21643#discussion_r101703130
| License       | MIT
| Doc PR        |

Commits
-------

b8e0d705f6 [Yaml] add tests for specific mapping keys
2017-03-01 06:39:50 -08:00
Fabien Potencier
ffc1cd507b bug #21731 Fix emacs link (rubenrua)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix emacs link

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

When an Emacs buffer is modified, by default Emacs automatically creates a
temporary symlink in the same directory as the file being edited (e.g. Controller.php):

```
.#Controller.php -> user@host.12345:1296583136
```

where '12345' is [the Emacs' PID][1].

In this case Symfony breaks with a RuntimeException:

```
SplFileInfo::getMTime(): stat failed for ...Bundle/Controller/.#APIController.php
```

in
vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php
at line 89

```
$newestMTime = max($file->getMTime(), $newestMTime);
```

[1]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Interlocking.html

Commits
-------

c6f7ca6fa1 Fix RuntimeException when an Emacs buffer is modified
2017-03-01 06:05:48 -08:00
Fabien Potencier
908d470749 minor #21804 [Console] Test inline styles with non-decorated formatter (julienfalque)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Test inline styles with non-decorated formatter

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

Small improvement of `OutputFormatter` test.

Commits
-------

8530e05574 Test inline styles with non-decorated formatter
2017-02-28 14:11:15 -08:00
Julien Falque
8530e05574
Test inline styles with non-decorated formatter 2017-02-28 19:03:12 +01:00
Nicolas Grekas
3b420f9091 bug #21802 [3.2] Fix issues reported by static analyse (romainneutron)
This PR was merged into the 3.2 branch.

Discussion
----------

[3.2] Fix issues reported by static analyse

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

Follow-up #21801

Commits
-------

a9ccacc [3.2] Fix issues reported by static analyse
2017-02-28 15:42:52 +01:00
Romain Neutron
a9ccaccd41
[3.2] Fix issues reported by static analyse 2017-02-28 15:39:50 +01:00
Nicolas Grekas
bbb17df480 minor #21784 [Workflow] Remove unnecessary method calls (izzyp)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21784).

Discussion
----------

[Workflow] Remove unnecessary method calls

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| License       | MIT

getEnabledTransitions() method only requires 1 parameter "$subject".

Removed places where a second parameter "$this->getMarking($subject)" is being passed to getEnabledTransitions().

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

12d9129 [Workflow] Remove unnecessary method calls
2017-02-28 15:33:16 +01:00
izzyp
12d91290cc [Workflow] Remove unnecessary method calls 2017-02-28 15:33:16 +01:00
Nicolas Grekas
f11511e300 fix merge 2017-02-28 15:19:54 +01:00
Nicolas Grekas
f03e93395e Merge branch '2.8' into 3.2
* 2.8:
  [2.8] Fix issues reported by static analyse
2017-02-28 15:10:24 +01:00
Nicolas Grekas
d8c964cae9 minor #21801 [2.8] Fix issues reported by static analyse (romainneutron)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8] Fix issues reported by static analyse

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

Followup #21800

Commits
-------

cb14bfd [2.8] Fix issues reported by static analyse
2017-02-28 15:10:03 +01:00
Romain Neutron
cb14bfd166
[2.8] Fix issues reported by static analyse 2017-02-28 15:08:20 +01:00
Nicolas Grekas
4990b6ee7c Merge branch '2.8' into 3.2
* 2.8:
  [2.7] Fix issues reported by static analyse
  [Serializer] Reduce nesting in YamlFileLoader
2017-02-28 14:16:45 +01:00
Nicolas Grekas
8881221244 Merge branch '2.7' into 2.8
* 2.7:
  [2.7] Fix issues reported by static analyse
  [Serializer] Reduce nesting in YamlFileLoader
2017-02-28 14:13:45 +01:00
Nicolas Grekas
4597768377 bug #21800 [2.7] Fix issues reported by static analyze (romainneutron)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Fix issues reported by static analyze

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

This PR fixes invalid doc blocks (typo or missing use) and a `sprintf` issue

Commits
-------

e473aa8 [2.7] Fix issues reported by static analyse
2017-02-28 14:13:17 +01:00
Romain Neutron
e473aa8bc1
[2.7] Fix issues reported by static analyse 2017-02-28 14:08:19 +01:00
Nicolas Grekas
0f353ad6c9 minor #21754 [Serializer] Reduce nesting in YamlFileLoader (gadelat)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] Reduce nesting in YamlFileLoader

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

We don't need to check if $this->classes is empty, because isset takes care of it in next call anyway

Diffs on GH are hard to read for this type of change, here is old and new code:

```php
public function loadClassMetadata(ClassMetadataInterface $classMetadata)
{
    if (null === $this->classes) {
        $this->classes = $this->getClassesFromYaml();
    }

    if (!$this->classes) {
        return false;
    }

    if (isset($this->classes[$classMetadata->getName()])) {
        $yaml = $this->classes[$classMetadata->getName()];

        if (isset($yaml['attributes']) && is_array($yaml['attributes'])) {
           ...
        }

        return true;
    }

    return false;
}
```

```php
public function loadClassMetadata(ClassMetadataInterface $classMetadata)
{
    if (null === $this->classes) {
        $this->classes = $this->getClassesFromYaml();
    }

    if (!isset($this->classes[$classMetadata->getName()])) {
        return false;
    }

    $yaml = $this->classes[$classMetadata->getName()];

    if (isset($yaml['attributes']) && is_array($yaml['attributes'])) {
        ...
    }

    return true;
}
```

Commits
-------

45f0b16 [Serializer] Reduce nesting in YamlFileLoader
2017-02-28 13:57:37 +01:00
Nicolas Grekas
b69ca56e1c bug #21782 [DependencyInjection] add missing dumped private services list in a container frozen constructor. (hhamon)
This PR was merged into the 3.2 branch.

Discussion
----------

[DependencyInjection] add missing dumped private services list in a container frozen constructor.

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

Commits
-------

838d9ca [DependencyInjection] add missing dumped private services list in a container frozen constructor.
2017-02-28 13:46:37 +01:00
Nicolas Grekas
fcde9e689d Merge branch '2.8' into 3.2
* 2.8:
  Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)"
  [DependencyInjection] inline conditional statements.
2017-02-28 13:37:44 +01:00
Nicolas Grekas
15106bf918 Merge branch '2.7' into 2.8
* 2.7:
  Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)"
  [DependencyInjection] inline conditional statements.
2017-02-28 13:31:05 +01:00
Nicolas Grekas
9aebfad501 bug #21798 Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)" (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)"

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

#21791 was a mistake as pointed out by @slaci (see https://github.com/symfony/symfony/pull/21791#issuecomment-282990746) and @stof (see https://github.com/symfony/symfony/pull/21792#issuecomment-282980046).

Commits
-------

f6637dd Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)"
2017-02-28 13:27:45 +01:00
Nicolas Grekas
c1b3422900 minor #21785 [DependencyInjection] inline conditional statements (hhamon)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] inline conditional statements

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

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

b7b7c54 [DependencyInjection] inline conditional statements.
2017-02-28 13:23:43 +01:00
Christian Flothmann
f6637dd900 Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)"
This reverts commit eb750be851, reversing
changes made to 70be4ba3ca.
2017-02-28 13:20:26 +01:00
rubenrua
c6f7ca6fa1 Fix RuntimeException when an Emacs buffer is modified
When an Emacs buffer is modified, by default Emacs automatically creates a
temporary symlink in the same directory as the file being edited (e.g. Controller.php):

```
.#Controller.php -> user@host.12345:1296583136
```

where '12345' is Emacs' PID.

In this case Symfony breaks with a RuntimeException:

```
SplFileInfo::getMTime(): stat failed for ...Bundle/Controller/.#APIController.php
```

in
vendor/symfony/symfony/src/Symfony/Component/Config/Resource/DirectoryResource.php
at line 89

```
$newestMTime = max($file->getMTime(), $newestMTime);
```
2017-02-28 12:10:07 +01:00
Hugo Hamon
b7b7c5433a [DependencyInjection] inline conditional statements. 2017-02-28 10:12:48 +01:00
Fabien Potencier
65b7d43ac3 Merge branch '2.8' into 3.2
* 2.8:
  [SecurityBundle] only pass relevant user provider
  [Intl] Make tests pass after the ICU data update
  [Intl] Update ICU data to 58.2
  do not register the test listener twice
  [DependencyInjection] removed dead code.
  [Yaml] Stop replacing NULLs when merging
  [WebServerBundle] fixed html attribute escape
2017-02-27 18:30:50 -08:00
Fabien Potencier
4d4dec3d41 Merge branch '2.7' into 2.8
* 2.7:
  [SecurityBundle] only pass relevant user provider
  [Intl] Make tests pass after the ICU data update
  [Intl] Update ICU data to 58.2
  [DependencyInjection] removed dead code.
  [Yaml] Stop replacing NULLs when merging
2017-02-27 18:24:56 -08:00
Fabien Potencier
eb750be851 bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[SecurityBundle] only pass relevant user provider

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #4498, #12465, #20401, #21737
| License       | MIT
| Doc PR        |

There is no need for the context listener to be aware of all the configured user providers. It must only use the provider for the current firewall (the one identified by the context key passed to the constructor) to refresh the user from the session.

Commits
-------

d97e07fd6a [SecurityBundle] only pass relevant user provider
2017-02-27 18:22:58 -08:00
Fabien Potencier
70be4ba3ca minor #21790 [Intl] Update ICU data to 58.2 (jakzal)
This PR was squashed before being merged into the 2.7 branch (closes #21790).

Discussion
----------

[Intl] Update ICU data to 58.2

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

ICU 58.2 was released: http://site.icu-project.org/download/58

Commits
-------

d135e5cd2f [Intl] Make tests pass after the ICU data update
65faa1043d [Intl] Update ICU data to 58.2
2017-02-27 13:58:46 -08:00
Gabriel Ostrolucký
45f0b16b78 [Serializer] Reduce nesting in YamlFileLoader 2017-02-27 22:43:30 +01:00
Fabien Potencier
6d39fd4d51 bug #21776 [Process] Fix ignoring of bad env var names (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Process] Fix ignoring of bad env var names

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

Patch backported from master, which is free from the linked issue.

Commits
-------

406bb09ae3 [Process] Fix ignoring of bad env var names
2017-02-27 13:33:35 -08:00
Christian Flothmann
d97e07fd6a [SecurityBundle] only pass relevant user provider 2017-02-27 22:20:22 +01:00
Fabien Potencier
d5d68c0817 bug #21787 [PhpUnitBridge] do not register the test listener twice (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[PhpUnitBridge] do not register the test listener twice

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

If the listener is already configured through the PHPUnit config, there
is no need to also enable it explicitly in the test runner.

Commits
-------

cee435fefd do not register the test listener twice
2017-02-27 12:29:08 -08:00
Jakub Zalas
d135e5cd2f
[Intl] Make tests pass after the ICU data update 2017-02-27 19:39:35 +00:00
Jakub Zalas
65faa1043d
[Intl] Update ICU data to 58.2 2017-02-27 19:39:27 +00:00
Christian Flothmann
cee435fefd do not register the test listener twice
If the listener is already configured through the PHPUnit config, there
is no need to also enable it explicitly in the test runner.
2017-02-27 20:09:32 +01:00
Hugo Hamon
838d9ca6c0 [DependencyInjection] add missing dumped private services list in a container frozen constructor. 2017-02-27 16:48:04 +01:00
Nicolas Grekas
22968cda3b minor #21783 [DependencyInjection] remove dead code (hhamon)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] remove dead code

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

This PR removes some dead code introduced 7 years ago (!!!) by a wrong merge :)

Commits
-------

158b689 [DependencyInjection] removed dead code.
2017-02-27 16:31:05 +01:00
Nicolas Grekas
406bb09ae3 [Process] Fix ignoring of bad env var names 2017-02-27 16:27:30 +01:00
Hugo Hamon
158b689e76 [DependencyInjection] removed dead code. 2017-02-27 16:11:02 +01:00
Christian Flothmann
8ddfc0673a bug #21756 [Yaml] Stop replacing NULLs when merging (gadelat)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] Stop replacing NULLs when merging

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

This introduces slight change of behaviour. Whereas previous code is overwriting already processed NULL values, this code is not. I think this is more expected behaviour, though?

Commits
-------

d967440 [Yaml] Stop replacing NULLs when merging
2017-02-26 13:37:39 +01:00
Gabriel Ostrolucký
d9674401de [Yaml] Stop replacing NULLs when merging 2017-02-25 19:32:58 +01:00