Commit Graph

37969 Commits

Author SHA1 Message Date
Fabien Potencier
ee0988cb06 minor #34227 Simplify PHP CS Fixer configuration (keradus)
This PR was merged into the 3.4 branch.

Discussion
----------

Simplify PHP CS Fixer configuration

Possible after updating PHP CS Fixer on fabbot.io to 2.16

Commits
-------

0b0e5b50d5 Simplify PHP CS Fixer configuration
2019-11-03 20:59:03 +01:00
Alexander Schranz
49b58ed45e Avoid using of kernel after shutdown 2019-11-03 20:32:26 +01:00
Fabien Potencier
0af10ccd0d minor #34160 Adding some validations tags on validators.et.xlf (glodzienski)
This PR was merged into the 3.4 branch.

Discussion
----------

Adding some validations tags on validators.et.xlf

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/30160
| License       | MIT

I saw an issue in the **Issues Page** and i want to help to improve the repository, even with a simple modification

Commits
-------

16bd71b5b1 Adding some validations tags on validators.et.xlf
2019-11-03 18:41:53 +01:00
Fabien Potencier
78bdf1a307 minor #34153 [Validator] add missing translation for 94 (it) (garak)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add missing translation for 94 (it)

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | None
| License       | MIT
| Doc PR        | not needed

Italian translation for validator is missing last item (id 94)

Commits
-------

1dc7ce1159 add missing translation for 94 (it)
2019-11-03 18:21:08 +01:00
Fabien Potencier
9162892fd4 bug #34181 [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34087
| License       | MIT
| Doc PR        | N/A

When running multiple periods in StopwatchEvent (start multiple times and not stop them all), the getDuration() method would return unexpected values.

This was because at every stop, the last entry in the `started` array was removed, while the `getDuration` method was still expecting all the started events to still be there.

Now, when calling `getDuration`, the duration of all the finished periods are added together with the unfinished counts.

Commits
-------

af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
2019-11-03 18:17:59 +01:00
Dariusz Ruminski
0b0e5b50d5 Simplify PHP CS Fixer configuration 2019-11-03 15:37:51 +01:00
Fabien Potencier
767b265681 bug #34179 [Stopwatch] Fixed a bug in StopwatchEvent::getStartTime (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed a bug in StopwatchEvent::getStartTime

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34088
| License       | MIT
| Doc PR        | N/A

When using a `StopwatchEvent` with an `$origin` that's smaller than the first start time, calling `getStartTime()` before ending the event will give `0` instead of the correct number.

The proposed fix in #34088 fixes this.

Commits
-------

b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime
2019-11-03 13:11:53 +01:00
Fabien Potencier
a1b507974e bug #34203 [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month (erics86)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #34203).

Discussion
----------

[FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month

Q | A
-- | --
Branch? | 3.4
Bug fix? | yes
New feature? | no
Deprecations? | no
Tickets | -
License | MIT
Doc PR | -

Commits
-------

613717d71f [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
2019-11-03 13:06:46 +01:00
Eric Schildkamp
613717d71f [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
* Added a hardcoded day 01 in order to output the proper month November
which is the correct EOL and EOM month.
* \DateTime::createFromFormat('mY') will output December for every month
where day 31 exists.
2019-11-03 13:06:33 +01:00
Fabien Potencier
85bcd9d554 minor #34225 [HttpFoundation] MockFileSessionStorageTest::sessionDir being used after it's unset (HypeMC)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] MockFileSessionStorageTest::sessionDir being used after it's unset

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The `$sessionDir` property was used after being set to `null`.

Commits
-------

51b20dd895 Fix MockFileSessionStorageTest::sessionDir being used after it's unset
2019-11-03 11:46:27 +01:00
HypeMC
51b20dd895 Fix MockFileSessionStorageTest::sessionDir being used after it's unset 2019-11-03 03:12:45 +01:00
Fabien Potencier
36c4c66a60 bumped Symfony version to 3.4.34 2019-11-01 10:59:17 +01:00
Fabien Potencier
4781365269
Merge pull request #34208 from fabpot/release-3.4.33
released v3.4.33
2019-11-01 09:46:51 +00:00
Fabien Potencier
a3ae48695d updated VERSION for 3.4.33 2019-11-01 10:46:31 +01:00
Fabien Potencier
202e420505 update CONTRIBUTORS for 3.4.33 2019-11-01 10:46:18 +01:00
Fabien Potencier
9d81271d9b updated CHANGELOG for 3.4.33 2019-11-01 10:45:21 +01:00
Timo Bakx
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime 2019-10-30 14:03:57 +01:00
Nicolas Grekas
27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| Q             | A
| ------------- | ---
| Branch?       | 3.4  <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

<!--
Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas
1a92f44a33 bug #34144 [Serializer] Improve messages for unexpected resources values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce276c7 [Serializer] Improve messages for unexpected resources values
2019-10-30 13:39:30 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Thomas Calvet
ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Glodzienski
16bd71b5b1
Adding some validations tags on validators.et.xlf 2019-10-28 21:40:18 -03:00
Robin Chalas
2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (and forward)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
Massimiliano Arione
1dc7ce1159
add missing translation for 94 (it) 2019-10-28 16:39:28 +01:00
Fabien Potencier
8920672b2e minor #34127 fix paths to detect code owners (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix paths to detect code owners

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I was wondering why sometimes I didn't receive any notifications for PRs where I thought a file for which I claimed code ownership was modified. Turns out according to https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax the `dir/*` pattern does not include nested directories.

Commits
-------

cb7523d595 fix paths to detect code owners
2019-10-26 21:54:01 +02:00
Yonel Ceruto
fb70e0af8d minor #30442 [OptionsResolver] Fix an error message to be more accurate (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
>     ->setDefault('testme', [])
>     ->setAllowedTypes('testme', ['string[]'])
>     ->resolve(['testme' => ['test', 12]]);
> ```

In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".

Commits
-------

7fa2fc2 #30432 fix an error message
2019-10-26 07:18:38 -04:00
Dmytro
7fa2fc2b96 #30432 fix an error message 2019-10-26 07:02:01 -04:00
Yonel Ceruto
2a5c75582e bug #33999 [Form] Make sure to collect child forms created on *_SET_DATA events (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Make sure to collect child forms created on *_SET_DATA events

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #29291
| License       | MIT
| Doc PR        | -

See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.

Commits
-------

50efc1a Make sure to collect child forms created on *_SET_DATA events
2019-10-26 06:32:38 -04:00
Christian Flothmann
cb7523d595 fix paths to detect code owners 2019-10-26 10:25:32 +02:00
Tobias Schultze
c953ba88d7 minor #34097 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 (alexpott)
This PR was squashed before being merged into the 3.4 branch (closes #34097).

Discussion
----------

[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.

Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```

Commits
-------

6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
2019-10-25 15:07:00 +02:00
Alex Pott
6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 2019-10-25 15:06:49 +02:00
Tobias Schultze
278280a246 minor #34105 Remove unused local variables (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove unused local variables

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This PR removes useless assignations. There are also somes fixes in tests.

Commits
-------

c07cee8f61 Remove unused local variables in tests
2019-10-25 04:33:49 +02:00
Thomas Calvet
c07cee8f61 Remove unused local variables in tests 2019-10-24 17:33:53 +02:00
Yonel Ceruto
50efc1a923 Make sure to collect child forms created on *_SET_DATA events 2019-10-23 15:46:41 -04:00
Douglas Greenshields
6b7044fc01
[SecurityBundle] correct types for default arguments for firewall configs 2019-10-23 10:40:35 +01:00
Nicolas Grekas
5d097d2eb5 bug #34021 [TwigBridge] do not render errors for checkboxes twice (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] do not render errors for checkboxes twice

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34008
| License       | MIT
| Doc PR        |

Commits
-------

9eddea97d8 do not render errors for checkboxes twice
2019-10-22 08:41:35 +02:00
Nicolas Grekas
3644a18012 minor #34049 [Workflow] Fix small typo in Exception message (holtkamp)
This PR was merged into the 3.4 branch.

Discussion
----------

[Workflow] Fix small typo in Exception message

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      |no
| New feature?  |no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

Commits
-------

7c2b974e26 Fix small typo in Exception message
2019-10-21 17:45:06 +02:00
Menno Holtkamp
7c2b974e26 Fix small typo in Exception message 2019-10-21 17:42:36 +02:00
Fabien Potencier
b38bde9cb1 bug #34041 [HttpKernel] fix wrong removal of the just generated container dir (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix wrong removal of the just generated container dir

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The patch applies to 3.4 but the fix really affects to 4.4 with the introduction of the new `.preload.php` file.

/cc @fabpot since you encountered this error quite often recently during `composer up/req` :)

Commits
-------

4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:36:59 +02:00
Nicolas Grekas
4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir 2019-10-20 12:02:53 +02:00
Nicolas Grekas
a54ecb0fae bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:07:56 +02:00
Fabien Potencier
a054d88830 bug #34023 [Dotenv] allow LF in single-quoted strings (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] allow LF in single-quoted strings

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

in a shell:
```sh
FOO='bar
baz'
```

is legal to set a value to (in PHP):
```php
"bar\nbaz"
```

Commits
-------

4d79116a0d [Dotenv] allow LF in single-quoted strings
2019-10-18 13:17:48 +02:00
Nicolas Grekas
4d79116a0d [Dotenv] allow LF in single-quoted strings 2019-10-18 12:00:34 +02:00
Christian Flothmann
52f8fc839c bug #33818 [Yaml] Throw exception for tagged invalid inline elements (gharlan)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] Throw exception for tagged invalid inline elements

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

At the moment the result for `!foo 'don't do somthin' like that'` is a `TaggedValue` with value "don".

Commits
-------

bed479c561 [Yaml] Throw exception for tagged invalid inline elements
2019-10-18 11:15:32 +02:00
Christian Flothmann
9eddea97d8 do not render errors for checkboxes twice 2019-10-18 10:33:13 +02:00
Gregor Harlan
bed479c561
[Yaml] Throw exception for tagged invalid inline elements 2019-10-16 00:10:41 +02:00
Christian Flothmann
ffa5db74c1 fix comparisons with null values at property paths 2019-10-15 16:50:58 +02:00
Nicolas Grekas
29cabf94c5 minor #33987 [CI] fix building local packages (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[CI] fix building local packages

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

b7b6942251 [CI] fix building local packages
2019-10-15 14:25:35 +02:00
Nicolas Grekas
b7b6942251 [CI] fix building local packages 2019-10-15 14:09:56 +02:00