Commit Graph

134 Commits

Author SHA1 Message Date
Nicolas Grekas
aae9ff4f22 Remove deadcode after the bump to PHP >= 8.4 2025-06-04 12:38:30 +02:00
Christian Flothmann
ab3e42610d Merge branch '7.2' into 7.3
* 7.2:
  Review validator-related japanese translations with ids 114-120
  don't trigger "internal" deprecations for PHPUnit Stub objects
  drop comments while lexing unquoted strings
2025-03-03 08:13:19 +01:00
Christian Flothmann
102be5e6a8 Merge branch '6.4' into 7.2
* 6.4:
  Review validator-related japanese translations with ids 114-120
  don't trigger "internal" deprecations for PHPUnit Stub objects
  drop comments while lexing unquoted strings
2025-03-03 08:12:39 +01:00
Christian Flothmann
aa3bcf4f76 don't trigger "internal" deprecations for PHPUnit Stub objects 2025-03-01 14:00:38 +01:00
Christian Flothmann
8390131a15 Merge branch '7.2' into 7.3
* 7.2: (47 commits)
  Remove comment about AppVeyor in `phpunit`
  [Webhook][RemoteEvent] fix SendgridPayloadConverter category support
  Update old Appveyor skip conditions
  sync the Dutch translation file with changes from the 7.2 branch
  [Yaml] fix inline notation with inline comment
  clean up code for doctrine/persistence 2.x
  Generate missing translations using Gemini
  fix(property-info): make sure that SerializerExtractor returns null for invalid class metadata
  add translations for the Slug constraint
  [RemoteEvent][Webhook] fix SendgridRequestParser & SendgridPayloadConverter in case of missing sg_message_id
  [Messenger] Fix `TransportMessageIdStamp` not always added
  [DoctrineBridge] Fix compatibility to Doctrine persistence 2.5 in Doctrine Bridge 6.4 to avoid Projects stuck on 6.3
  [PropertyInfo] Fix add missing composer conflict
  [ErrorHandler] Don't trigger "internal" deprecations for anonymous LazyClosure instances
  [VarDumper] Fix displaying closure's "this" from anonymous classes
  [Doctrine][Messenger] Prevents multiple TransportMessageIdStamp being stored in envelope
  [HttpKernel] Don't override existing LoggerInterface autowiring alias in LoggerPass
  reject inline notations followed by invalid content
  Fix predis command error checking
  [Security] Fix triggering session tracking from ContextListener
  ...
2025-01-07 14:06:36 +01:00
Christian Flothmann
959a74d044 Merge branch '7.1' into 7.2
* 7.1: (27 commits)
  add translations for the Slug constraint
  [Messenger] Fix `TransportMessageIdStamp` not always added
  [DoctrineBridge] Fix compatibility to Doctrine persistence 2.5 in Doctrine Bridge 6.4 to avoid Projects stuck on 6.3
  [PropertyInfo] Fix add missing composer conflict
  [ErrorHandler] Don't trigger "internal" deprecations for anonymous LazyClosure instances
  [VarDumper] Fix displaying closure's "this" from anonymous classes
  [Doctrine][Messenger] Prevents multiple TransportMessageIdStamp being stored in envelope
  [HttpKernel] Don't override existing LoggerInterface autowiring alias in LoggerPass
  reject inline notations followed by invalid content
  [Security] Fix triggering session tracking from ContextListener
  [AssetMapper] add leading slash to public prefix
  fix: modify Exception message parameter order
  [Yaml] Fix parsing of unquoted strings in Parser::lexUnquotedString() to ignore spaces
  Update exception.css
  Remove outdated guard from security xsd schema
  Bump Symfony version to 7.1.11
  Update VERSION for 7.1.10
  Update CHANGELOG for 7.1.10
  Bump Symfony version to 6.4.18
  Update VERSION for 6.4.17
  ...
2025-01-07 10:39:55 +01:00
Christian Flothmann
f4d1fd1bcb Merge branch '6.4' into 7.1
* 6.4: (23 commits)
  add translations for the Slug constraint
  [Messenger] Fix `TransportMessageIdStamp` not always added
  [DoctrineBridge] Fix compatibility to Doctrine persistence 2.5 in Doctrine Bridge 6.4 to avoid Projects stuck on 6.3
  [PropertyInfo] Fix add missing composer conflict
  [ErrorHandler] Don't trigger "internal" deprecations for anonymous LazyClosure instances
  [VarDumper] Fix displaying closure's "this" from anonymous classes
  [Doctrine][Messenger] Prevents multiple TransportMessageIdStamp being stored in envelope
  [HttpKernel] Don't override existing LoggerInterface autowiring alias in LoggerPass
  reject inline notations followed by invalid content
  [Security] Fix triggering session tracking from ContextListener
  [AssetMapper] add leading slash to public prefix
  fix: modify Exception message parameter order
  [Yaml] Fix parsing of unquoted strings in Parser::lexUnquotedString() to ignore spaces
  Update exception.css
  Bump Symfony version to 6.4.18
  Update VERSION for 6.4.17
  Update CONTRIBUTORS for 6.4.17
  Update CHANGELOG for 6.4.17
  Fix exception thrown by YamlEncoder
  [AssetMapper] Fix JavaScript compiler create self-referencing imports
  ...
2025-01-07 10:23:14 +01:00
Nicolas Grekas
87d26c219e [ErrorHandler] Don't trigger "internal" deprecations for anonymous LazyClosure instances 2025-01-05 21:34:05 +01:00
Christian Flothmann
e0a44070e6 support non-empty-string/non-empty-list when patching return types 2024-12-07 09:53:13 +01:00
Christian Flothmann
ad57ca0486 resolve class constant types when patching return types 2024-10-14 10:54:27 +02:00
Dariusz Ruminski
9faaecf000 chore: CS fixes 2024-06-24 18:01:36 +02:00
Alexander M. Turek
64908ae925 Prefix all sprintf() calls 2024-06-20 17:52:34 +02:00
Nicolas Grekas
07a7ca2489 Merge branch '7.0' into 7.1
* 7.0:
  [DependencyInjection] Fix computing error messages involving service locators
  [Serializer] Fix unknown types normalization type when know type
  [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3
  [AssetMapper] Fix enquoted string pattern
  [Validator] Review Romanian (ro) translations
  [Console] Fix display of Table on Windows OS
  [FrameworkBundle] Fix config builder with extensions extended in `build()`
  [Translation] Fix extracting qualified t() function calls
  Fix vertical table on windows
  Fix the `command -v` exception when the command option with a dash prefix
  Fix a minor design issue in the Welcome Page
  [WebProfilerBundle] disable turbo in web profiler toolbar to avoid link prefetching
  explicitly cast boolean SSL stream options
  return the unchanged text if preg_replace_callback() fails
  the 'use_notify' option is on the factory, not on the postgres connection class
  review translations
2024-02-22 15:28:06 -05:00
Nicolas Grekas
677b24759d Merge branch '6.4' into 7.0
* 6.4:
  [DependencyInjection] Fix computing error messages involving service locators
  [Serializer] Fix unknown types normalization type when know type
  [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3
  [AssetMapper] Fix enquoted string pattern
  [Validator] Review Romanian (ro) translations
  [Console] Fix display of Table on Windows OS
  [FrameworkBundle] Fix config builder with extensions extended in `build()`
  [Translation] Fix extracting qualified t() function calls
  Fix vertical table on windows
  Fix the `command -v` exception when the command option with a dash prefix
  [WebProfilerBundle] disable turbo in web profiler toolbar to avoid link prefetching
  explicitly cast boolean SSL stream options
  return the unchanged text if preg_replace_callback() fails
  the 'use_notify' option is on the factory, not on the postgres connection class
  review translations
2024-02-22 15:27:20 -05:00
Nicolas Grekas
c725219bdf Merge branch '5.4' into 6.4
* 5.4:
  [DependencyInjection] Fix computing error messages involving service locators
  [Serializer] Fix unknown types normalization type when know type
  [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3
  [Validator] Review Romanian (ro) translations
  [Console] Fix display of Table on Windows OS
  [FrameworkBundle] Fix config builder with extensions extended in `build()`
  [WebProfilerBundle] disable turbo in web profiler toolbar to avoid link prefetching
  explicitly cast boolean SSL stream options
  return the unchanged text if preg_replace_callback() fails
  the 'use_notify' option is on the factory, not on the postgres connection class
  review translations
2024-02-22 15:27:10 -05:00
Nicolas Grekas
90b1d7799b [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3 2024-02-22 06:40:53 -05:00
Nicolas Grekas
135f16be8a Merge branch '7.0' into 7.1
* 7.0:
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 16:06:13 +01:00
Nicolas Grekas
0437061a19 Merge branch '6.4' into 7.0
* 6.4:
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 16:02:46 +01:00
Nicolas Grekas
93a8400a7e Merge branch '5.4' into 6.3
* 5.4:
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 15:35:58 +01:00
Nicolas Grekas
39225b1e47 Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value 2024-01-23 14:51:25 +01:00
Dariusz Ruminski
03b35b60af DX: re-apply CS 2023-12-30 21:01:23 +01:00
Oskar Stark
d71bd112a1 Fix typo 2023-12-28 10:18:21 +01:00
Wouter de Jong
f1c1d003bd [Components] Convert to native return types 2023-07-05 15:06:06 +02:00
Nicolas Grekas
4f57142300 [HttpClient] Favor php-http/discovery instead of nyholm/psr7 2023-05-03 12:08:08 +02:00
Nicolas Grekas
dfda782a39 Merge branch '6.2' into 6.3
* 6.2:
  [HttpClient] Dev-require php-http/message-factory
  [ErrorHandler] Skip Httplug deprecations for HttplugClient
  [Messenger] Fix registering message handlers
  Bump Symfony version to 5.4.24
  Update VERSION for 5.4.23
  Update CONTRIBUTORS for 5.4.23
  Update CHANGELOG for 5.4.23
2023-05-02 15:05:51 +02:00
Nicolas Grekas
6a5384ba94 Merge branch '5.4' into 6.2
* 5.4:
  [HttpClient] Dev-require php-http/message-factory
  [ErrorHandler] Skip Httplug deprecations for HttplugClient
  [Messenger] Fix registering message handlers
  Bump Symfony version to 5.4.24
  Update VERSION for 5.4.23
  Update CONTRIBUTORS for 5.4.23
  Update CHANGELOG for 5.4.23
2023-05-02 15:05:31 +02:00
Nicolas Grekas
de0d247471 [ErrorHandler] Skip Httplug deprecations for HttplugClient 2023-05-02 12:45:49 +02:00
Nicolas Grekas
2c1caf08bc Merge branch '6.2' into 6.3
* 6.2: (21 commits)
  Fix tests
  CS fix
  [HttpKernel] Tests for DataCollector
  for #49320
  [Console] Fix computing column width containing multibyte chars
  [Messenger] Fix deprecation layer of RedeliveryStamp
  [Mime] Form field values with integer keys not resolved correctly
  [Messenger] [Redis] Fixed problem where worker stops handling messages on first empty message
  [PHPUnitBridge] Fix PHPUnit 10.1 compatibility
  [VarDumper] Make the server TCP connection sync
  [Messenger] Fix warning message on failed messenger show command
  [Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID
  [HttpFoundation] Fix BinaryFileResponse
  [Form] fix merge
  [HttpFoundation] Fix memory limit problems in BinaryFileResponse
  [PropertyAccess] Readonly properties must have no PropertyWriteInfo
  [Form] Cast choices value callback result to string
  [Serializer] Unexpected value should throw UnexpectedValueException
  [ErrorHandler] Don't throw deprecations for HttplugClient
  [Serializer] Fix denormalization of object with typed constructor arg (not castable) and with COLLECT_DENORMALIZATION_ERRORS
  ...
2023-04-18 15:59:59 +02:00
Nicolas Grekas
8b7e9f1246 Merge branch '5.4' into 6.2
* 5.4:
  [Console] Fix computing column width containing multibyte chars
  [Messenger] Fix deprecation layer of RedeliveryStamp
  [Mime] Form field values with integer keys not resolved correctly
  [Messenger] [Redis] Fixed problem where worker stops handling messages on first empty message
  [PHPUnitBridge] Fix PHPUnit 10.1 compatibility
  [VarDumper] Make the server TCP connection sync
  [Messenger] Fix warning message on failed messenger show command
  [Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID
  [HttpFoundation] Fix BinaryFileResponse
  [Form] fix merge
  [HttpFoundation] Fix memory limit problems in BinaryFileResponse
  [PropertyAccess] Readonly properties must have no PropertyWriteInfo
  [Form] Cast choices value callback result to string
  [Serializer] Unexpected value should throw UnexpectedValueException
  [ErrorHandler] Don't throw deprecations for HttplugClient
  [Serializer] Fix denormalization of object with typed constructor arg (not castable) and with COLLECT_DENORMALIZATION_ERRORS
  Avoid leading .. for temporary files from Filesystem recursive remove
2023-04-18 15:46:08 +02:00
Nicolas Grekas
218206b477 [ErrorHandler] Don't throw deprecations for HttplugClient 2023-04-17 12:03:27 +02:00
Antoine Lamirault
1e4c2b6371 Remove unused local variable 2023-02-21 09:04:13 +01:00
Wouter de Jong
9a39dcd7b3 Add void return types 2023-02-13 14:18:23 +01:00
Nicolas Grekas
9efa58c9b2 Merge branch '6.2' into 6.3
* 6.2:
  Fix some phpdoc
  [ErrorHandler] Do not patch return statements in closures
  [DI] keep `proxy` tag on original definition when decorating
2023-02-13 11:14:31 +01:00
Nicolas Grekas
f525e7a56e Merge branch '5.4' into 6.2
* 5.4:
  Fix some phpdoc
  [ErrorHandler] Do not patch return statements in closures
  [DI] keep `proxy` tag on original definition when decorating
2023-02-13 11:14:15 +01:00
Wouter de Jong
1471b167ae [ErrorHandler] Do not patch return statements in closures 2023-02-13 00:02:35 +01:00
Adrien Roches
f1ce406b47 [DependencyInjection] Add missing template notation on ServiceLocator 2023-01-26 14:06:30 +01:00
Christian Flothmann
8fcb17031a try to read SYMFONY_PATCH_TYPE_DECLARATIONS from superglobal arrays too 2023-01-14 08:56:42 +01:00
Nicolas Grekas
12a25d01cc Merge branch '6.1' into 6.2
* 6.1:
  [Mailer] Include all transports' debug messages in RoundRobin transport exception
  [FrameworkBundle] fix: fix help message
  Fix HtmlSanitizer default configuration behavior for allowed schemes
  Use relative timestamps
  [Cache] Fix dealing with ext-redis' multi/exec returning a bool
  [Messenger][Amqp] Added missing rpc_timeout option
  [Serializer] Prevent GetSetMethodNormalizer from creating invalid magic method call
  [HttpFoundation] Fix dumping array cookies
  [WebProfilerBundle] Fix dump header not being displayed
  TraceableHttpClient: increase decorator's priority
  Use static methods inside data providers
  [FrameworkBundle] Allow configuring `framework.exceptions` with a config builder
  bug #48313 [Mime] Fix MessagePart serialization
  [HttpKernel][ErrorHandler] Fix reading the SYMFONY_IDE env var
  [ErrorHandler][DebugClassLoader] Fix some new return types support
  Fix getting the name of closures on PHP 8.1.11+
  [Translator] Fix typo "internal" / "interval"
  fix dumping top-level tagged values
  [Console] Fix clear line with question in section
2022-12-14 17:11:27 +01:00
Nicolas Grekas
6e1416fcb6 Merge branch '6.0' into 6.1
* 6.0:
  [Mailer] Include all transports' debug messages in RoundRobin transport exception
  [FrameworkBundle] fix: fix help message
  Use relative timestamps
  [Cache] Fix dealing with ext-redis' multi/exec returning a bool
  [Messenger][Amqp] Added missing rpc_timeout option
  [Serializer] Prevent GetSetMethodNormalizer from creating invalid magic method call
  [HttpFoundation] Fix dumping array cookies
  [WebProfilerBundle] Fix dump header not being displayed
  TraceableHttpClient: increase decorator's priority
  Use static methods inside data providers
  [FrameworkBundle] Allow configuring `framework.exceptions` with a config builder
  bug #48313 [Mime] Fix MessagePart serialization
  [ErrorHandler][DebugClassLoader] Fix some new return types support
  Fix getting the name of closures on PHP 8.1.11+
  [Translator] Fix typo "internal" / "interval"
  fix dumping top-level tagged values
2022-12-14 17:05:20 +01:00
Nicolas Grekas
1113c4bcf3 Merge branch '5.4' into 6.0
* 5.4:
  [Mailer] Include all transports' debug messages in RoundRobin transport exception
  [FrameworkBundle] fix: fix help message
  Use relative timestamps
  [Cache] Fix dealing with ext-redis' multi/exec returning a bool
  [Messenger][Amqp] Added missing rpc_timeout option
  [Serializer] Prevent GetSetMethodNormalizer from creating invalid magic method call
  [HttpFoundation] Fix dumping array cookies
  [WebProfilerBundle] Fix dump header not being displayed
  TraceableHttpClient: increase decorator's priority
  Use static methods inside data providers
  [FrameworkBundle] Allow configuring `framework.exceptions` with a config builder
  bug #48313 [Mime] Fix MessagePart serialization
  [ErrorHandler][DebugClassLoader] Fix some new return types support
  Fix getting the name of closures on PHP 8.1.11+
  [Translator] Fix typo "internal" / "interval"
  fix dumping top-level tagged values
2022-12-14 16:52:41 +01:00
Thomas Calvet
7305720f24 [ErrorHandler][DebugClassLoader] Fix some new return types support 2022-12-12 19:59:41 +01:00
Nicolas Grekas
4b6e76c0a5 [DependencyInjection][VarExporter] Generate lazy proxies for non-ghostable lazy services out of the box 2022-09-03 11:56:53 +02:00
Nicolas Grekas
5d30a93bc2 minor #47016 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm (mdeboer, wouterj)
This PR was merged into the 6.2 branch.

Discussion
----------

Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)
| Tickets       | Replaces #40783
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/17064

Todo
---

* [x] Review the Psalm check of this PR
* [x] Test the changes with DebugClassLoader in a real app

Description
---

This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.

<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:

* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added
* The PHPdoc MUST NOT break PHPstorm
* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)
* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.
* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>

EDIT: Replaced the guidelines by https://github.com/symfony/symfony-docs/pull/17064

On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in #40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).

Commits
-------

f5a802ab85 [DependencyInjection] Add nice exception when using non-scalar parameter as array key
fa7703ba4a [ErrorHandler] Do not patch return types that are not a valid PHP type
38ab6de900 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
2022-08-02 15:22:35 +02:00
Nicolas Grekas
430103afb4 [ErrorHandler] Don't trigger deprecations for lazy objects extending @final classes 2022-07-28 16:00:34 +02:00
Wouter de Jong
eb08a3ff6a [ErrorHandler] Do not patch return types that are not a valid PHP type 2022-07-28 12:03:39 +02:00
Alexander M. Turek
3758329a0f Merge branch '6.0' into 6.1
* 6.0:
  Fix return type patching for list and class-string pseudo types
  [HttpKernel] [HttpCache] Don't throw on 304 Not Modified
2022-07-21 10:48:29 +02:00
Alexander M. Turek
1ad59271cb Merge branch '5.4' into 6.0
* 5.4:
  Fix return type patching for list and class-string pseudo types
  [HttpKernel] [HttpCache] Don't throw on 304 Not Modified
2022-07-21 10:48:06 +02:00
Alexander M. Turek
340490b4ae Merge branch '4.4' into 5.4
* 4.4:
  Fix return type patching for list and class-string pseudo types
  [HttpKernel] [HttpCache] Don't throw on 304 Not Modified
2022-07-21 10:47:46 +02:00
Alexander M. Turek
8085df215d Fix return type patching for list and class-string pseudo types 2022-07-21 00:22:46 +02:00
Nicolas Grekas
e600c54e5b Merge branch '5.4' into 6.0
* 5.4:
  bug #45043 [ErrorHandler] ignore ``@return`` when there is an ``@template`` (nicolas-grekas)
  [Finder] fix tests on Windows
2022-03-18 17:21:55 +01:00