Commit Graph

29252 Commits

Author SHA1 Message Date
Nicolas Grekas
d0ac91a815 minor #21874 [DI] Remove unused legacy arg in XmlFileLoaderTest (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[DI] Remove unused legacy arg in XmlFileLoaderTest

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

Commits
-------

db4ab9d [DI] Remove unused legacy arg in XmlFileLoaderTest
2017-03-05 10:41:56 +01:00
Nicolas Grekas
db4ab9d0d6 [DI] Remove unused legacy arg in XmlFileLoaderTest 2017-03-05 01:06:55 +01:00
Nicolas Grekas
4ee9d563c5 Merge branch '2.8' into 3.2
* 2.8:
  [Security] fix Composer constraint
  Provide less state in getRequestFormat
  fix test class location
  Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed
2017-03-04 13:23:14 +01:00
Nicolas Grekas
6e9d1bbf32 Merge branch '2.7' into 2.8
* 2.7:
  [Security] fix Composer constraint
  Provide less state in getRequestFormat
  fix test class location
  Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed
2017-03-04 13:20:59 +01:00
Nicolas Grekas
d75ca7fa44 minor #21864 [Security] fix Composer constraint (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] fix Composer constraint

| 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        |

The `MAX_USERNAME_LENGTH` constant introduced by #18733 that is used in the `UsernamePasswordFormAuthenticationListener` was first part of Symfony 2.7.13 and 2.8.6.

Commits
-------

69a572d [Security] fix Composer constraint
2017-03-04 13:01:21 +01:00
Christian Flothmann
69a572dc5d [Security] fix Composer constraint 2017-03-04 12:40:30 +01:00
Nicolas Grekas
af40fd789c minor #21862 [Security] fix test class location (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] fix test class location

| 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        |

Keeping the test file in the old location means that it is not available in the `symfony/security-http` subtree split.

Commits
-------

1ed0092 fix test class location
2017-03-04 11:57:10 +01:00
Nicolas Grekas
d45008d2d1 bug #21805 Provide less state in getRequestFormat (dawehner)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21805).

Discussion
----------

Provide less state in getRequestFormat

Let's assume you multiple lines of code calling to ```Request::getRequestFormat```providing different default values.

```
$request->getRequestFormat();
$request->getRequestFormat('json')
```

As of HEAD this causes the second call to return 'html', unless its set explicit via ```setRequestFormat()```.

IMHO this is state which can be avoided.

Note: This also helps Drupal.

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

Commits
-------

1d43007 Provide less state in getRequestFormat
2017-03-04 11:53:39 +01:00
Daniel Wehner
1d43007f3c Provide less state in getRequestFormat 2017-03-04 11:53:31 +01:00
Christian Flothmann
1ed0092a62 fix test class location 2017-03-04 11:20:42 +01:00
Nicolas Grekas
5898ec2c5e minor #21855 SCA with Php Inspections (EA Extended) (kalessil)
This PR was merged into the 2.7 branch.

Discussion
----------

SCA with Php Inspections (EA Extended)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| 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
-------

e1773ee Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed
2017-03-04 10:49:48 +01:00
Vladimir Reznichenko
e1773ee2b8 Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed 2017-03-03 17:35:37 +01:00
Fabien Potencier
2da12fc080 bug #21851 Adding use statement for InvalidArgumentException (Nyholm)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21851).

Discussion
----------

Adding use statement for InvalidArgumentException

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

This is a super minor bugfix. We should tell what InvalidArgumentException we throw. I consider this a bugfix and not a BC break because `Symfony\Component\Translation\Exception\InvalidArgumentException` has always been the intention.

Commits
-------

187f65bb33 Adding use statement for InvalidArgumentException
2017-03-03 07:24:16 -08:00
Tobias Nyholm
187f65bb33 Adding use statement for InvalidArgumentException 2017-03-03 07:24:16 -08:00
Fabien Potencier
86675f3faa Merge branch '2.8' into 3.2
* 2.8:
  fixed CS
2017-03-02 13:34:34 -08:00
Fabien Potencier
a19e3fe970 Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
2017-03-02 13:33:27 -08:00
Fabien Potencier
cb12e323a5 minor #21814 fixed CS (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed CS

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

Commits
-------

ad0bb6ac53 fixed CS
2017-03-02 13:32:57 -08:00
Fabien Potencier
6aa87febf0 [Config] removed obsolete code 2017-03-02 07:58:09 -08:00
Fabien Potencier
e1558cc042 Merge branch '2.8' into 3.2
* 2.8:
  [Form] Improve rounding precision
  [Routing] Ignore hidden directories when loading routes from annotations
2017-03-02 07:57:24 -08:00
Fabien Potencier
db38c6f629 Merge branch '2.7' into 2.8
* 2.7:
  [Form] Improve rounding precision
  [Routing] Ignore hidden directories when loading routes from annotations
2017-03-02 07:56:34 -08:00
Fabien Potencier
c579b96cef bug #21832 [Routing] Ignore hidden directories when loading routes from annotations (jakzal)
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] Ignore hidden directories when loading routes from annotations

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

The problem surfaced after implementing #18869. Therefore it doesn't exist on 2.7, but I'd still merge it there to avoid conflicts when merging between branches. Without this fix, the oldest branch the added test will fail is 3.2.

Commits
-------

ce9df0237c [Routing] Ignore hidden directories when loading routes from annotations
2017-03-02 07:54:09 -08:00
Fabien Potencier
058121819c bug #21769 [Form] Improve rounding precision (foaly-nr1)
This PR was squashed before being merged into the 2.7 branch (closes #21769).

Discussion
----------

[Form] Improve rounding precision

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

For full details see https://github.com/symfony/symfony/issues/21734 from https://github.com/symfony/symfony/issues/21734#issuecomment-282552802 onwards.

Excerpt:

```php
$number = floor(37.37*100); // double(3736)
var_dump($number);
$number = floor(bcmul(37.37, 100)); // double(3737)
var_dump($number);
```

From http://php.net/manual/en/language.types.float.php#language.types.float:

> Additionally, rational numbers that are exactly representable as floating point numbers in base 10, like 0.1 or 0.7, do not have an exact representation as floating point numbers in base 2, which is used internally, no matter the size of the mantissa. Hence, they cannot be converted into their internal binary counterparts without a small loss of precision. This can lead to confusing results: for example, floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since the internal representation will be something like 7.9999999999999991118....
>
> So never trust floating number results to the last digit, and do not compare floating point numbers directly for equality. If higher precision is necessary, the arbitrary precision math functions and gmp functions are available.

Commits
-------

e50804cef4 [Form] Improve rounding precision
2017-03-02 07:52:24 -08:00
foaly-nr1
e50804cef4 [Form] Improve rounding precision 2017-03-02 07:52:21 -08:00
Jakub Zalas
ce9df0237c
[Routing] Ignore hidden directories when loading routes from annotations 2017-03-02 14:51:26 +00:00
Fabien Potencier
b45e99f7cc Merge branch '2.8' into 3.2
* 2.8:
  disable global test listener when not registered
2017-03-01 17:46:11 -08:00
Fabien Potencier
cadc31330e bug #21825 [PhpUnitBridge] disable global test listener when not registered (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[PhpUnitBridge] disable global test listener when not registered

| 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        |

The global test listener is always initialized to register the clock
mock and DNS mock as soon as possible. However, when the listener is
registered locally through the PHPUnit config, it will never be
registered as a listener. In thise case, the state of the local
listener must be reset to correctly report expected deprecation test
results.

Commits
-------

e068661240 disable global test listener when not registered
2017-03-01 17:45:34 -08:00
Fabien Potencier
ad0bb6ac53 fixed CS 2017-03-01 11:43:24 -08:00
Christian Flothmann
e068661240 disable global test listener when not registered
The global test listener is always initialized to register the clock
mock and DNS mock as soon as possible. However, when the listener is
registered locally through the PHPUnit config, it will never be
registered as a listener. In thise case, the state of the local
listener must be reset to correctly report expected deprecation test
results.
2017-03-01 20:11:57 +01:00
Fabien Potencier
120f29344d fixed tests 2017-03-01 10:18:36 -08:00
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