Commit Graph

43123 Commits

Author SHA1 Message Date
Nicolas Grekas
dc11777afa Merge branch '3.4' into 4.2
* 3.4: (23 commits)
  fix cs
  Use mocks before replacing the error handler
  [Config] Do not use absolute path when computing the vendor freshness
  Bump minimum version of symfony/phpunit-bridge
  Container*::getServiceIds() should return an array of string
  [Config][ReflectionClassResource] Use ternary instead of null coaelscing operator
  [Validator] Add missing Russian and Ukrainian translations
  [Translation] Use HTTPS and fix a url
  [Config] Fix for signatures of typed properties
  [Validator] Add missing Hungarian translations
  [Validator] Add Lithuanian translation for Range validator
  Add HTTPS to a URL
  sync translation files
  PHPDoc fixes
  Add notInRange translation
  Add danish translation for Range validator
  Add german translation for Range validator
  Update validators.es.xlf
  [Validator] Add missing en and fr translation ids from 4.4
  [Debug][DebugClassLoader] Don't check class if the included file don't exist
  ...
2019-07-18 12:29:22 +02:00
Nicolas Grekas
c03fff5b3e fix cs 2019-07-18 12:28:36 +02:00
Fabien Potencier
288772478c [Mailer] fixed logic 2019-07-18 10:29:30 +02:00
Fabien Potencier
d2f33d2cfe [Mailer] added debug info for HTTP mailers 2019-07-18 10:17:52 +02:00
Fabien Potencier
c8eed54684 fixed missing license 2019-07-18 10:16:25 +02:00
Fabien Potencier
3f48f1091b bug #32572 Bump minimum version of symfony/phpunit-bridge (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Bump minimum version of symfony/phpunit-bridge

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

Before those versions, PHPUnit was downloaded directly on github (on `https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip`), not installed with composer.

However, this behavior is not working (anymore ?) because https://github.com/sebastianbergmann/phpunit/archive/6.5.zip is a 404 (`Warning: fopen(https://github.com/sebastianbergmann/phpunit/archive/6.5.zip): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found`).

When installing lowest dependencies to run tests in local, you encounter this problem and you cannot launch the tests unless you set the `SYMFONY_PHPUNIT_VERSION` to `6.5.14`. But IMHO, it should work by default.

Commits
-------

04e0f3c575 Bump minimum version of symfony/phpunit-bridge
2019-07-18 10:03:39 +02:00
Fabien Potencier
6f78ad8d68 minor #32573 [Process] Path resolution for FCGI configuration (romantymoshyk)
This PR was merged into the 4.4 branch.

Discussion
----------

 [Process] Path resolution for FCGI configuration

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

This tiny improvement allows to speedup location of PHP executable if script is runned via FCGI.
PHP configured to be runned via Apache module mod_fcgid(usually on Windows), PHP_SAPI contains 'cgi-fcgi' and PHP_BINARY refer to correct PHP binary executable, same as in case of running via CLI.

Commits
-------

22150bc771  [Process] Path resolution for FCGI configuration
2019-07-18 10:00:23 +02:00
Fabien Potencier
039fd94dfd bug #32438 [Serializer] XmlEncoder: don't cast padded strings (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] XmlEncoder: don't cast padded strings

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony/pull/23122#discussion_r121886667   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This was a suggestion of @nicolas-grekas in #23122. Which seems to have been forgotten.

But shouldn't we also avoid casting something like `.18`, `+18`, `-18`?

Commits
-------

c1bfaa1de4 [Serializer] XmlEncoder: don't cast padded strings
2019-07-18 09:59:15 +02:00
Fabien Potencier
9ed1dd113c feature #32471 Add a new ErrorHandler component (mirror of the Debug component) (yceruto)
This PR was squashed before being merged into the 4.4 branch (closes #32471).

Discussion
----------

Add a new ErrorHandler component (mirror of the Debug component)

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

On top of https://github.com/symfony/symfony/pull/32470

Commits
-------

b1b6e80a3d Add a new ErrorHandler component (mirror of the Debug component)
2019-07-18 09:54:44 +02:00
Yonel Ceruto
b1b6e80a3d Add a new ErrorHandler component (mirror of the Debug component) 2019-07-18 09:54:35 +02:00
Nicolas Grekas
54c77e6a61 bug #32579 [Config] Do not use absolute path when computing the vendor freshness (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Do not use absolute path when computing the vendor freshness

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

When one uses Docker with a different mounting point between CLI & FPM,
the cache keeps regenerating because the ComposerResource class see a
different path for each SAPI. For example `/home/app/app/vendor` vs
`/var/www/app/vendor`.
So if you hit FPM, then the CLI, then FPM, each time a new cache is
generated. So the application is quite slow in dev env. And for people
on MacOSX (with docker) is a big pain! And obvisouly, this never
stabilizes !

This occurs a lot when you have a worker, that crash and reboot in the
background, and you browse the web interface. Or when you have something
that hit your API every X secondes, and you are working on a worker.

Commits
-------

2d2e2742c8 [Config] Do not use absolute path when computing the vendor freshness
2019-07-18 08:47:54 +02:00
Nicolas Grekas
0487e10ea3 minor #32592 [Debug] Use mocks before replacing the error handler (greg0ire)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Use mocks before replacing the error handler

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

We want the bridge to mute the php 7.4 deprecations triggered when building mocks.

Commits
-------

f6e0b01f7c Use mocks before replacing the error handler
2019-07-18 08:47:13 +02:00
Grégoire Paris
f6e0b01f7c
Use mocks before replacing the error handler
We want the bridge to mute the deprecations triggered when building mocks.
2019-07-18 08:26:12 +02:00
Piet Steinhart
49bb7435f1 [Messenger] fixed UnrecoverableExceptionInterface handling in Worker (fixes #32325) 2019-07-17 22:40:10 +02:00
Nicolas Grekas
ba988acaec feature #32463 [VarDumper] Allow to configure VarDumperTestTrait casters & flags (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Allow to configure VarDumperTestTrait casters & flags

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | TODO: showcase using `setUpVarDumper` in `setUp` or in specific test cases accordingly to the use-case. `tearDownVarDumper` is automatically called after each test case.

The VarDumper component is a great tool in tests to assert objects states.
The ability to register custom casters on need is a nice way to control only the fields you're expecting, or a way to write concise test cases.
Hence this feature allowing to configure casters specifically per test class/case.

Commits
-------

613dbb267d [VarDumper] Allow to configure VarDumperTestTrait casters & flags
2019-07-17 20:27:52 +02:00
Grégoire Pineau
2d2e2742c8 [Config] Do not use absolute path when computing the vendor freshness
When one uses Docker with a different mounting point between CLI & FPM,
the cache keeps regenerating because the ComposerResource class see a
different path for each SAPI. For example `/home/app/app/vendor` vs
`/var/www/app/vendor`.
So if you hit FPM, then the CLI, then FPM, each time a new cache is
generated. So the application is quite slow in dev env. And for people
on MacOSX (with docker) is a big pain! And obvisouly, this never
stabilizes !

This occurs a lot when you have a worker, that crash and reboot in the
background, and you browse the web interface. Or when you have something
that hit your API every X secondes, and you are working on a worker.
2019-07-17 17:23:18 +02:00
Fabien Potencier
f900c974a8 bug #32570 [WebProfilerBundle] Remove unneeded information in the routing panel (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Remove unneeded information in the routing panel

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

As explained in #26302, the number of routes tested before a mach is no longer relevant because of how the new routing matcher works ... so we can remove that information from the profiler panel.

The related issue mentioned the `router_match` command too ... but I can't find this information in that command.

Commits
-------

ffb22ef082 [WebProfilerBundle] Remove unneeded information in the routing panel
2019-07-17 17:05:36 +02:00
Roman Tymoshyk
22150bc771
[Process] Path resolution for FCGI configuration 2019-07-17 15:34:41 +03:00
Thomas Calvet
04e0f3c575 Bump minimum version of symfony/phpunit-bridge 2019-07-17 12:41:35 +02:00
Nicolas Grekas
0f1bca406d [HttpClient] fix debug output added to stderr at shutdown 2019-07-17 11:57:50 +02:00
Javier Eguiluz
ffb22ef082 [WebProfilerBundle] Remove unneeded information in the routing panel 2019-07-17 11:43:47 +02:00
Fabien Potencier
25f180416e minor #32562 [Lock] remove usage of the StoreInterface (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] remove usage of the StoreInterface

| Q             | A
| ------------- | ---
| Branch?       |4.4
| Bug fix?      |  no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | none  <!-- required for new features -->

<!--
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):
 - 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.
-->

Followup PR according to the review of @nicolas-grekas in https://github.com/symfony/symfony/pull/32555#discussion_r303749752.

Commits
-------

9988844eb4 [Lock] remove uusage of the StoreInterface
2019-07-17 09:26:25 +02:00
Fabien Potencier
e5ad9897e9 feature #31946 [Mailer] Extract transport factory and allow create custom transports (Koc)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Extract transport factory and allow create custom transports

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes, failure unrelated (master hasn't this PR)
| Fixed tickets | #31385, #32523
| License       | MIT
| Doc PR        | TBD

Alternative approach to allow create custom transports and register DSN for it. Replaces #31931, #31935 . Similar to already existent TansportFactory from Messenger.

TODO:
 - [x] Update changelog
 - [x] Add more tests for factories
 - [x] Add test for configuration + DI extension

Commits
-------

5b9cded276 Add transport factories (closes #31385, closes #32523)
2019-07-17 09:15:41 +02:00
Fabien Potencier
04b9ce39ad bug #32563 Container*::getServiceIds() should return strings (mathroc)
This PR was merged into the 3.4 branch.

Discussion
----------

Container*::getServiceIds() should return strings

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | o
| Tests pass?   | yes
| Fixed tickets | #32549
| License       | MIT

Cast services ids to string in `Container*::getServiceIds()`

Commits
-------

9c88caad31 Container*::getServiceIds() should return an array of string
2019-07-17 09:04:46 +02:00
Tobias Schultze
59926c8b59 [Messenger] pass transport name to factory 2019-07-17 02:09:02 +02:00
Konstantin Myakshin
5b9cded276 Add transport factories (closes #31385, closes #32523) 2019-07-16 22:15:50 +03:00
Mathieu Rochette
9c88caad31
Container*::getServiceIds() should return an array of string
see #32549
2019-07-16 20:58:26 +02:00
Amrouche Hamza
9988844eb4
[Lock] remove uusage of the StoreInterface 2019-07-16 18:53:09 +02:00
Fabien Potencier
e5bd6ff59e minor #32561 [Config][ReflectionClassResource] Use ternary instead of null coalescing operator (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config][ReflectionClassResource] Use ternary instead of null coalescing operator

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

`??` cannot be on 3.4, tests are failing because of this.

Commits
-------

4db953f40c [Config][ReflectionClassResource] Use ternary instead of null coaelscing operator
2019-07-16 15:04:39 +02:00
Thomas Calvet
4db953f40c [Config][ReflectionClassResource] Use ternary instead of null coaelscing operator 2019-07-16 14:34:18 +02:00
Fabien Potencier
b75a8be5e2 minor #32520 [Validator] Update Spanish translation for Range validator (plozmun)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Update Spanish translation for Range validator

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

Commits
-------

b5a96409b7 Update validators.es.xlf
2019-07-16 13:49:35 +02:00
Fabien Potencier
8e9c7a6b73 minor #32554 [Validator] Add missing Russian and Ukrainian translations (Koc)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing Russian and Ukrainian translations

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

~~Some of this translations could be missing in 4.2 also, but [support of Symfony 4.2](https://symfony.com/roadmap/4.2) ends in two weeks, so I think nobody cares about missing translations in it.~~

@peter-gribanov , @vudaltsov , @insidestyles, @stfalcon please, check also provided translations

Commits
-------

fae418f7cb [Validator] Add missing Russian and Ukrainian translations
2019-07-16 11:48:50 +02:00
Fabien Potencier
af309b0acf minor #32557 [HttpClient] make toStream() throw by default (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] make toStream() throw by default

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

For consistency with ->getHeaders()/->getContent().

Commits
-------

90e46ab13b [HttpClient] make toStream() throw by default
2019-07-16 11:44:12 +02:00
Fabien Potencier
da6cbab742 bug #32556 [Mailer] Add XML configuration for the mailer envelope (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Add XML configuration for the mailer envelope

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

<!--
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):
 - 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
-------

2e03f9dfa5 [Mailer] added XML configuration for the mailer envelope
2019-07-16 11:43:25 +02:00
Nicolas Grekas
90e46ab13b [HttpClient] make toStream() throw by default 2019-07-16 08:40:46 +02:00
Fabien Potencier
2e03f9dfa5 [Mailer] added XML configuration for the mailer envelope 2019-07-16 08:28:50 +02:00
Fabien Potencier
52e9fb91ff Merge branch '4.3' into 4.4
* 4.3:
  added missing test
  [Mailer] Allow register mailer configuration in xml format
  fixed CS
  [FrameworkBundle] Fix descriptor of routes described as callable array
  [Debug][DebugClassLoader] Include found files instead of requiring them
  [HttpKernel] fix tests
  Adding missing event_dispatcher wiring for messenger.middleware.send_message
2019-07-16 08:12:37 +02:00
Fabien Potencier
a0d2c429b1 added missing test 2019-07-16 08:12:19 +02:00
Fabien Potencier
b2dd93a231 bug #32553 [Mailer] Allow register mailer configuration in xml format (Koc)
This PR was submitted for the 4.4 branch but it was merged into the 4.3 branch instead (closes #32553).

Discussion
----------

[Mailer] Allow register mailer configuration in xml format

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

This looks like bugfix but also similar to new feature. I can switch branch to 4.3 if needed.

Commits
-------

2f3b47a9e4 [Mailer] Allow register mailer configuration in xml format
2019-07-16 08:05:24 +02:00
Konstantin Myakshin
2f3b47a9e4 [Mailer] Allow register mailer configuration in xml format 2019-07-16 08:05:15 +02:00
Konstantin Myakshin
fae418f7cb [Validator] Add missing Russian and Ukrainian translations 2019-07-16 00:17:21 +03:00
Maxime Steinhausser
613dbb267d [VarDumper] Allow to configure VarDumperTestTrait casters & flags 2019-07-15 16:30:54 +02:00
Nicolas Grekas
88575f01b7 bug #32442 Adding missing event_dispatcher wiring for messenger.middleware.send_message (weaverryan)
This PR was merged into the 4.3 branch.

Discussion
----------

Adding missing event_dispatcher wiring for messenger.middleware.send_message

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

This was probably my bad when I added this hook point (it's not used anywhere in the core). Also reported on Slack :).

Cheers!

Commits
-------

90d1b059fd Adding missing event_dispatcher wiring for messenger.middleware.send_message
2019-07-15 15:35:23 +02:00
Nicolas Grekas
e9ab2343df minor #32508 [Lock] add aliases for LockFactory (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] add aliases for LockFactory

| Q             | A
| ------------- | ---
| Branch?       |4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | none <!-- required for new features -->

<!--
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):
 - 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.
-->
see https://github.com/symfony/symfony/pull/32495/files#r302844198, add missing aliases in 4.4 and in 5.0 we just remove the old classes and aliases.

Commits
-------

5f301688ac [Lock] add aliases for LockFactory
2019-07-15 15:22:23 +02:00
Nicolas Grekas
10ba0c62c3 minor #32511 [Debug][DebugClassLoader] Don't check class if the included file doesn't exist (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug][DebugClassLoader] Don't check class if the included file doesn't exist

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

Follow up to https://github.com/symfony/symfony/pull/32500.

If the included file doesn't exist, we need to return or the execution continues (if warnings are not thrown as exceptions) and then an invalid exception is thrown when the class is checked.

For example : "The autoloader expected class "App\Foo\Bar" to be defined in file "/var/www/html/vendor/composer/../../src/Foo/Bar.php". The file was found but the class was not in it, the class name or namespace probably has a typo".

Commits
-------

0185527297 [Debug][DebugClassLoader] Don't check class if the included file don't exist
2019-07-15 15:19:38 +02:00
Fabien Potencier
e2d71731fa minor #32536 [Translation] Use HTTPS and fix a url (Arman-Hosseini)
This PR was squashed before being merged into the 3.4 branch (closes #32536).

Discussion
----------

[Translation] Use HTTPS and fix a url

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| License       | MIT

<!--
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):
 - 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
-------

e346ee6888 [Translation] Use HTTPS and fix a url
2019-07-15 09:11:50 +02:00
Arman Hosseini
e346ee6888 [Translation] Use HTTPS and fix a url 2019-07-15 09:11:40 +02:00
Fabien Potencier
e347e41dbf bug #32466 [Config] Fix for signatures of typed properties (tvandervorm)
This PR was submitted for the 4.3 branch but it was squashed and merged into the 3.4 branch instead (closes #32466).

Discussion
----------

[Config] Fix for signatures of typed properties

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

Also see the issue description, when using public typed properties ([new in PHP7.4](https://wiki.php.net/rfc/typed_properties_v2)) like this:

```
namespace App;

class Foo {
    public int $bar;
}
```

will cause `$defaults['bar']` not to be set in Symfony/Component/Config/Resource/ReflectionClassResource.php::139.

This is because `$bar` doesn't have a default value, but does have a type hint, meaning it's default value is not `null` but undefined. This causes an 'undefined index' error when clearing the cache through `bin/console cache:clear` when running PHP7.4.

The default value is used here for the class signature, having `null` should be appropriate for all cases.

Commits
-------

bad2a2c87a [Config] Fix for signatures of typed properties
2019-07-15 08:55:37 +02:00
Timon van der Vorm
bad2a2c87a [Config] Fix for signatures of typed properties 2019-07-15 08:55:28 +02:00
Fabien Potencier
9ab4f14a6e feature #31194 [PropertyAccess] Improve errors when trying to find a writable property (pierredup)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead (closes #31194).

Discussion
----------

[PropertyAccess] Improve errors when trying to find a writable property

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

When setting a property using an adder/remove, the error message is very generic if the methods don't fit the exact requirements (both the adder and remover need to be defined and accept at least one argument). This can be confusing when you already have the methods `addFoo()` and `removeFoo()` defined (but without any parameters in the signature), but the error message states that the method doesn't exist or don't have public access.

So this PR tries to improve the error message if a property isn't writable by doing the following:

* If only one of the add/remove methods is implemented, indicate that the other method is needed as well.
* If any of the adder/remover, setter or magic methods (`__call` or `__set`) don't have the required number of parameters,  make it clear that the methods need to define the correct number of parameter.
* The any of the access methods were found, but don't have public access, make it clear that the method needs to be defined as public,

```php
class Foo
{
    public function addBar($value)
    {
    }

    public function removeBar()
    {
    }
}
```

**Before:**
```
Neither the property "bar" nor one of the methods "addBar()/removeBar()", "setBar()", "bar()", "__set()" or "__call()" exist and have public access in class "Foo".
```

**After:**

```
The method "removeBar" requires at least "1" parameters, "0" found.
```

Commits
-------

f90a9fd771 Improve errors when trying to find a writable property
2019-07-15 08:46:38 +02:00