Commit Graph

251 Commits

Author SHA1 Message Date
Nicolas Grekas
db4cb51f0c [HttpClient] remove "experimental" annotations 2020-05-08 22:08:25 +02:00
Nicolas Grekas
4dd6e2f0b2 Merge branch '5.0'
* 5.0:
  [DI] Fix CheckTypeDeclarationPass
  [Security/Http] don't require the session to be started when tracking its id
  [DI] fix preloading script generation
2020-03-18 09:01:26 +01:00
Nicolas Grekas
ea0eb11bcf Merge branch '4.4' into 5.0
* 4.4:
  [DI] Fix CheckTypeDeclarationPass
  [Security/Http] don't require the session to be started when tracking its id
  [DI] fix preloading script generation
2020-03-18 09:00:37 +01:00
Nicolas Grekas
a10fc4da5d [DI] fix preloading script generation 2020-03-17 20:51:46 +01:00
Fabien Potencier
d6dd06ba89 Merge branch '5.0'
* 5.0:
  Add missing dots at the end of exception messages
  Add missing dots at the end of exception messages
  [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict)
  Fix bad merge
  Add missing dots at the end of exception messages
2020-03-15 15:51:35 +01:00
Fabien Potencier
20a19884ac Merge branch '4.4' into 5.0
* 4.4:
  Add missing dots at the end of exception messages
  [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict)
  Fix bad merge
  Add missing dots at the end of exception messages
2020-03-15 15:33:06 +01:00
Fabien Potencier
6dad402e97 Add missing dots at the end of exception messages 2020-03-15 15:17:26 +01:00
Nicolas Grekas
1b5430bc9f Merge branch '5.0'
* 5.0: (36 commits)
  Add test for tagged iterator with numeric index
  Fix container lint command when a synthetic service is used in combination with the expression language
  Fix Travis script
  [Validator][Range] Fix typos
  [SecurityBundle] Minor fix in LDAP config tree builder
  [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle
  Revert "minor #35559 [FrameworkBundle] remove mention of the old Controller class (nicolas-grekas)"
  [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
  [Mime] remove phpdoc mentioning Utf8AddressEncoder
  Add missing phpdoc
  Remove int return type from FlattenException::getCode
  [Yaml] fix dumping strings containing CRs
  [DI] Fix XmlFileLoader bad error message
  [Form] Handle false as empty value on expanded choices
  [Messenger] Add ext-redis min version req to tests
  Tweak message
  improve PlaintextPasswordEncoder docBlock summary
  [Validator] Add two missing translations for the Arabic (ar) locale
  Use some PHP 5.4 constants unconditionally
  Add new packages on the link script
  ...
2020-03-12 18:11:13 +01:00
Nicolas Grekas
ac2c8f2352 Merge branch '4.4' into 5.0
* 4.4: (34 commits)
  Add test for tagged iterator with numeric index
  Fix container lint command when a synthetic service is used in combination with the expression language
  [Validator][Range] Fix typos
  [SecurityBundle] Minor fix in LDAP config tree builder
  [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle
  [FrameworkBundle] remove redundant PHPDoc in console Descriptor and subclass
  [Mime] remove phpdoc mentioning Utf8AddressEncoder
  Add missing phpdoc
  Remove int return type from FlattenException::getCode
  [Yaml] fix dumping strings containing CRs
  [DI] Fix XmlFileLoader bad error message
  [Form] Handle false as empty value on expanded choices
  [Messenger] Add ext-redis min version req to tests
  Tweak message
  improve PlaintextPasswordEncoder docBlock summary
  [Validator] Add two missing translations for the Arabic (ar) locale
  Use some PHP 5.4 constants unconditionally
  Add new packages on the link script
  [DI] fix dumping errored definitions
  [DI] ignore extra tags added by autoconfiguration in PriorityTaggedServiceTrait
  ...
2020-03-12 18:08:07 +01:00
Nicolas Grekas
4b45685306 [HttpClient] fix requests to hosts that idn_to_ascii() cannot handle 2020-03-11 09:29:03 +01:00
Nicolas Grekas
0f46aa602a [Contracts] Add changelog entry for "symfony/deprecation-contracts" 2020-02-14 10:07:39 +01:00
Nicolas Grekas
9181c3ad61 [Contracts] add missing changelog entries 2020-02-14 10:04:22 +01:00
Nicolas Grekas
d6fa13bafd [symfony/contracts] Reference one main CHANGELOG in each contracts 2020-02-14 08:31:56 +01:00
Nicolas Grekas
b84faa4ee8 Merge branch '5.0'
* 5.0:
  [HttpClient] fix "undefined variable"
  [HttpClient] remove useless code in test
  [HttpClient] fix getting response content after its destructor throwed an HttpExceptionInterface
  [HttpClient] fix HttpClientDataCollector when handling canceled responses
  [Security] Fix exception name in doc comments
2020-02-11 15:27:37 +01:00
Nicolas Grekas
b43d418171 Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] fix "undefined variable"
  [HttpClient] remove useless code in test
  [HttpClient] fix getting response content after its destructor throwed an HttpExceptionInterface
  [HttpClient] fix HttpClientDataCollector when handling canceled responses
  [Security] Fix exception name in doc comments
2020-02-11 15:26:26 +01:00
Nicolas Grekas
d41ea2a02e [HttpClient] remove useless code in test 2020-02-11 15:05:45 +01:00
Nicolas Grekas
6d1657b720 [HttpClient] fix getting response content after its destructor throwed an HttpExceptionInterface 2020-02-11 14:51:01 +01:00
Grégoire Pineau
a05ee087a2 [Constracts] Split the global CHANGELOG in dedicated CHANGELOG per contract 2020-02-10 11:54:33 +01:00
Nicolas Grekas
0032b2a289 [Contracts/Deprecation] don't use assert(), rename to trigger_deprecation() 2020-02-08 14:27:18 +01:00
Ion Bazan
d5bcaff00c
Fix Contracts autoloader typo 2020-02-06 11:10:55 +08:00
Fabien Potencier
8c596bce30 feature #35526 [Contracts/Deprecation] Provide a generic function and convention to trigger deprecation notices (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Contracts/Deprecation] Provide a generic function and convention to trigger deprecation notices

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

This PR results from a discussion we had yesterday with @alcaeus, @beberlei and others at the Symfony UG meetup in Berlin (thanks SensioLabs for bringing me there).

It provides a generic function and convention to trigger deprecation notices, which could be a better alternative to the `@trigger_error(..., E_USER_DEPRECATED)` calls that we use currently.

This proposed package would provide a single global function named `deprecated()`.
Its purpose is to trigger deprecations in a way that can be silenced on production environment
by using the `zend.assertions` ini setting and that can be caught during development to generate reports.

The function requires at least 3 arguments:
 - the name of the package that is triggering the deprecation
 - the version of the package that introduced the deprecation
 - the message of the deprecation
 - more arguments can be provided: they will be inserted in the message using `printf()` formatting

Example:
```php
deprecated('symfony/blockchain', 8.9, 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
```

This will generate the following message:
`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`

Check #35550 to see how using this function could look like on Symfony itself.

Commits
-------

f0f41cbfc5 [Contracts/Deprecation] Provide a generic function and convention to trigger deprecation notices
2020-02-05 19:14:04 +01:00
Nicolas Grekas
f0f41cbfc5 [Contracts/Deprecation] Provide a generic function and convention to trigger deprecation notices 2020-02-05 19:04:04 +01:00
Fabien Potencier
bb4e394949 Merge branch '4.4' into 5.0
* 4.4:
  Fix CS
  Fix CS
2020-02-04 10:41:09 +01:00
Fabien Potencier
de8348a033 Fix CS 2020-02-04 10:32:40 +01:00
Nicolas Grekas
581b439931 Merge branch '4.4' into 5.0
* 4.4: (26 commits)
  [HttpClient] NativeHttpClient should not send >1.1 protocol version
  [HttpClient] fix support for non-blocking resource streams
  [Mailer] Make sure you can pass custom headers to Mailgun
  [Mailer] Remove line breaks in email attachment content
  Update links to documentation
  [Validator] Add the missing translations for the Arabic (ar) locale
  ensure to expect no validation for the right reasons
  [Security-Guard] fixed 35203 missing name tag in param docblock
  [HttpClient] fix casting responses to PHP streams
  [PhpUnitBridge] Add test case for @expectedDeprecation annotation
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
  [Mailer] Fix addresses management in Sendgrid API payload
  [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
  [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
  [HttpClient] fix capturing SSL certificates with NativeHttpClient
  Update year in license files
  [TwigBridge][Form] Added missing help messages in form themes
  Update year in license files
  Update year in license files
  fix version when "anonymous: lazy" was introduced
  ...
2020-01-04 15:08:26 +01:00
Nicolas Grekas
c000577edb Merge branch '4.3' into 4.4
* 4.3:
  [Mailer] Remove line breaks in email attachment content
  Update links to documentation
  [Validator] Add the missing translations for the Arabic (ar) locale
  ensure to expect no validation for the right reasons
  [PhpUnitBridge] Add test case for @expectedDeprecation annotation
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
  [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
  [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
  [HttpClient] fix capturing SSL certificates with NativeHttpClient
  [TwigBridge][Form] Added missing help messages in form themes
  Update year in license files
  Update year in license files
  [HttpClient] fix typo
  [Console][FormatterHelper] Use helper strlen statically and remove duplicated code
  [Routing] Fix i18n routing when the url contains the locale
  Fix BC issue in phpDoc Reflection library
  [Translator] Performance improvement in MessageCatalogue and catalogue operations.
2020-01-04 14:00:46 +01:00
Jan Rosier
0d7a8bdd0a Update year in license files 2020-01-01 12:51:43 +01:00
Nicolas Grekas
53127c54a1 bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix early cleanup of pushed HTTP/2 responses

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

Commits
-------

0f51da6ec7 [HttpClient] Fix early cleanup of pushed HTTP/2 responses
2019-11-28 15:09:27 +01:00
Robin Chalas
e5f0e60a44 Merge branch '4.4' into 5.0
* 4.4: (38 commits)
  reset the kernel cache after each test
  [HttpKernel] Ability to define multiple kernel.reset tags
  [Routing] Continue supporting single colon in object route loaders
  [FWBundle] Remove unused parameter
  [Intl] [Workflow] fixes English grammar typos
  [Filesystem] [Serializer] fixes English grammar typo
  mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport
  has_roles should be is_granted in upgrade files
  [HttpClient] Fix early cleanup of pushed HTTP/2 responses
  skip test on incompatible PHP versions
  [HttpKernel] Don't cache "not-fresh" state
  [FrameworkBundle][Cache] Don't deep-merge cache pools configuration
  [Messenger] Adding exception to amqp transport in case amqp ext is not installed
  [SecurityBundle] Don't require a user provider for the anonymous listener
  [Monolog Bridge] Fixed accessing static property as non static.
  Improve Symfony description
  [Mailer] Add UPGRADE entries about Envelope and MessageEvent
  [FrameworkBundle] fix leftover mentioning "secret:" processor
  Add DateTimeZoneNormalizer into Dependency Injection
  [Messenger] Error when specified default bus is not among the configured
  ...
2019-11-27 00:25:11 +01:00
Grégoire Pineau
0f51da6ec7 [HttpClient] Fix early cleanup of pushed HTTP/2 responses 2019-11-25 13:42:17 +01:00
Nicolas Grekas
6194c2a96c Allow PHP ^7.2.5 2019-11-18 18:27:11 +01:00
Alexander M. Turek
4de3773979 Add parameter type declarations to contracts. 2019-11-09 10:18:34 +01:00
Peter Schultz
e98731aabf [HttpClient] allow arbitrary JSON values in requests
Allow arbitrary values in the "json" request option. Previously values were
limitated to arrays and objects of type JsonSerializable. This doesn't account
for scalar values and classes with public properties (which don't need to
implement JsonSerializable), all of which are perfectly acceptable arguments to
json_encode.
2019-11-07 13:44:51 +01:00
Nicolas Grekas
0b5b6fa79f Merge branch '4.3' into 4.4
* 4.3:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [HttpClient] always return the empty string when the response cannot have a body
  [TwigBundle][exception] Added missing css variable to highlight line in trace
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:55:29 +01:00
Nicolas Grekas
f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Nicolas Grekas
05f7f4e147 Merge branch '4.3' into 4.4
* 4.3:
  [OptionsResolve] Revert change in tests for a not-merged change in code
  [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
  [Workflow] Made the configuration more robust for the 'property' key
  [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
  #30432 fix an error message
  fix paths to detect code owners
  [HttpClient] ignore the body of responses to HEAD requests
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  [SecurityBundle] Fix wrong assertion
  Remove unused local variables in tests
  [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
  Make sure to collect child forms created on *_SET_DATA events
  [WebProfilerBundle] Improve display in Email panel for dark theme
  do not render errors for checkboxes twice
2019-10-28 21:30:34 +01:00
Nicolas Grekas
50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected 2019-10-28 16:45:56 +01:00
Nicolas Grekas
0fc371e7df [HttpClient] ignore the body of responses to HEAD requests 2019-10-25 15:08:37 +02:00
Nicolas Grekas
e87301603e [HttpClient] allow option "buffer" to be a stream resource 2019-10-21 18:05:25 +02:00
Yanick Witschi
bbb8ed11ff [HttpClient] Add a canceled state to the ResponseInterface 2019-10-21 17:46:23 +02:00
Nicolas Grekas
3723d03663 Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] workaround curl_multi_select() issue
  [CI] fix building local packages
  Increase limits for flakey appveyor tests
2019-10-15 14:38:35 +02:00
Nicolas Grekas
e635491c96 [HttpClient] workaround curl_multi_select() issue 2019-10-15 14:30:03 +02:00
Christian Flothmann
ae808b0a74 Merge branch '4.3' into 4.4
* 4.3:
  fix PHP 5.6 compatibility
  [Cache] fixed TagAwareAdapter returning invalid cache
  Add plus character `+` to legal mime subtype
  Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
  bug #33942 [DI] Add extra type check to php dumper
  [Dotenv] search variable values in ENV first then env file
  [PropertyInfo] Respect property name case when guessing from public method name
  [VarDumper] fix resetting the "bold" state in CliDumper
  Missing argument in method_exists
  SCA: added missing break in a loop
2019-10-14 14:27:06 +02:00
Gabriel Ostrolucký
8a04886f26
Increase limits for flakey appveyor tests 2019-10-13 14:02:04 +02:00
Reedy
c2dd804a24 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
Also make getServiceLocator protected

As per https://github.com/symfony/symfony/issues/33946#issuecomment-541100439
2019-10-12 01:38:35 +01:00
Nicolas Grekas
2044ba8e97 Merge branch '4.3' into 4.4
* 4.3:
  [Intl] Update the ICU data to 65.1 (4.3 branch)
  Replace deprecated calls in tests
  [Intl] Update the ICU data to 65.1
  Delete 5_Security_issue.md
  [DI] Whitelist validator.auto_mapper in UnusedTagsPass
  [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method
  [Cache] give 100ms before starting the expiration countdown
  [Cache] fix logger usage in CacheTrait::doGet()
  [VarDumper] fix dumping uninitialized SplFileInfo
  Added missing translations.
  Fixed invalid changelog 4.0.0 for VarDumper
  Fixed invalid VarDumper upgrade doc.
  [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
  Don't let falsey usernames slip through
2019-10-04 23:43:27 +02:00
Nicolas Grekas
ca6515cc76 [Cache] fix logger usage in CacheTrait::doGet() 2019-10-04 10:02:16 +02:00
Nicolas Grekas
fc78e200db Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] Fix framework bundle lock configuration not working as expected
  [Validator] Add the missing translations for the Azerbaijani locale
  [HttpClient] workaround bad Content-Length sent by old libcurl
  [Cache] dont override native Memcached options
  Fix CS
  Fix exceptions (PDOException) error code type
  Fix return type of Process::restart().
  [Cache] fail gracefully when locking is not supported
  [HttpClient] fix race condition when reading response with informational status
  Names for buttons should start with lowercase
2019-09-27 00:09:58 +02:00
Nicolas Grekas
450c3c4998 [HttpClient] fix race condition when reading response with informational status 2019-09-24 20:09:31 +02:00
Nicolas Grekas
13640b9422 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-09-20 12:12:04 +02:00
Nicolas Grekas
b4e2ba2c04 fix merge 2019-09-20 12:11:58 +02:00
Nicolas Grekas
bbf2ae576e Merge branch '4.3' into 4.4
* 4.3:
  [HttpKernel] fix merge
  fix tests
  [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted
2019-09-20 11:28:18 +02:00
Nicolas Grekas
3c93764f10 [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted 2019-09-19 20:56:12 +02:00
Fabien Potencier
3c78fde548 Merge branch '4.3' into 4.4
* 4.3:
  [Twig] Remove dead code
  Add gitignore file for Symfony 4.3
  Add gitignore file for Symfony 3.4
  [Inflector] Add .gitignore file
  [Messenger] Fix exception message of failed message is dropped on retry
  Add default value for Accept header
  [HttpClient] Add .gitignore file
  [Finder] Adjust regex to correctly match comments in gitignore contents
  [Security] Removed unused argument in Test
  [Console] Get dimensions from stty on windows if possible
  [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2019-09-17 13:12:18 +02:00
Valentine Boineau
856b9a8a6e Add gitignore file for Symfony 4.3 2019-09-17 11:54:03 +02:00
Nicolas Grekas
789448b65c Merge branch '4.3' into 4.4
* 4.3:
  Re-enable push support for HttpClient
  [DependencyInjection] Accept existing interfaces as valid named args
  Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property
2019-09-11 10:38:59 +02:00
Zmey
954dad44a1 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property 2019-09-11 07:03:51 +02:00
andyexeter
d8533066de [Cache] Added reserved characters constant for CacheItem 2019-09-11 06:59:27 +02:00
Nicolas Grekas
b0abc10617 Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] Fix a bug preventing Server Pushes to be handled properly
  [HttpClient] fix support for 103 Early Hints and other informational status codes
  [DI] fix failure
  [Validator] Add ConstraintValidator::formatValue() tests
  [HttpClient] improve handling of HTTP/2 PUSH
  Fix #33427
  [Validator] Only handle numeric values in DivisibleBy
  [Validator] Sync string to date behavior and throw a better exception
  Check phpunit configuration for listeners
  [DI] fix support for "!tagged_locator foo"
2019-09-03 23:44:11 +02:00
Nicolas Grekas
34275bba1c [HttpClient] fix support for 103 Early Hints and other informational status codes 2019-09-03 23:21:26 +02:00
Yonel Ceruto
55eac639c5 Nullable message id? 2019-09-03 08:18:35 -04:00
Nicolas Grekas
fc186bb78f Add return types to tests and final|internal|private methods 2019-08-21 17:14:41 +02:00
Nicolas Grekas
225bf41e3b Merge branch '4.3' into 4.4
* 4.3:
  cs fix
  Fix inconsistent return points.
  [Config] Add handling for ignored keys in ArrayNode::mergeValues.
  Fix inconsistent return points.
  [Security/Core] UserInterface::getPassword() can return null
  [Router] Fix TraceableUrlMatcher behaviour with trailing slash
  Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2019-08-20 16:44:19 +02:00
Alexander M. Turek
c26c53596e Fix inconsistent return points. 2019-08-20 16:27:59 +02:00
Nicolas Grekas
aa338c8b42 Import return annotations from vendors 2019-08-14 15:27:41 +02:00
Nicolas Grekas
11fab74e5c Merge branch '4.3' into 4.4
* 4.3:
  Fix compatibility with PHPUnit 8
2019-08-08 12:05:21 +02:00
Jérémy Derussé
55daf15353
Fix compatibility with PHPUnit 8 2019-08-08 12:03:27 +02:00
Nicolas Grekas
2273de0011 Merge branch '4.3' into 4.4
* 4.3:
  consistently throw NotSupportException
  [HttpKernel] Clarify error handler restoring process again
  [HttpClient] Remove CURLOPT_CONNECTTIMEOUT_MS curl opt
  [Intl] fix nullable phpdocs and useless method visibility of internal class
  Resilience against file_get_contents() race conditions.
2019-08-08 11:18:35 +02:00
Grégoire Pineau
e289723aad [HttpClient] Remove CURLOPT_CONNECTTIMEOUT_MS curl opt 2019-08-08 08:37:38 +02:00
Nicolas Grekas
a0c2aa8302 Merge branch '4.3' into 4.4
* 4.3:
  Fix inconsistent return points.
  pass translation parameters to the trans filter
  [Mime] fixed wrong mimetype
  [ProxyManagerBridge] Polyfill for unmaintained version
  [HttpClient] Declare `$active` first to prevent weird issue
  Remove deprecated assertContains
  [HttpClient] fix tests
  SCA: dropped unused mocks, duplicate import and a function alias usage
  Added correct plural for box -> boxes
  [Config] fix test
  Fix remaining tests
  Improve fa (persian) translation
2019-08-07 14:00:28 +02:00
Mario Blažek
43acda6cf4 Remove deprecated assertContains 2019-08-07 10:22:11 +02:00
Thomas Calvet
3cbb978b00 [HttpClient] Relax max duration test assertion 2019-08-06 14:14:26 +02:00
Nicolas Grekas
3498259b12 feature #32807 [HttpClient] add "max_duration" option (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] add "max_duration" option

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32765
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12073

Commits
-------

a4178f1369 [HttpClient] add "max_duration" option
2019-08-06 10:45:25 +02:00
Thomas Calvet
356341bc19 [HttpClient] Minor fixes 2019-08-05 15:12:03 +02:00
Thomas Calvet
a4178f1369 [HttpClient] add "max_duration" option 2019-08-05 12:08:40 +02:00
Nicolas Grekas
d2c4bf0da8 [HttpClient] use "idle" instead of "inactivity" when telling about the timeout option 2019-08-04 17:49:22 +02:00
Nicolas Grekas
1b56d7f04d Merge branch '3.4' into 4.3
* 3.4:
  Fix tests
  Fix deprecated phpunit annotation
2019-08-02 14:15:04 +02:00
Nicolas Grekas
9ac85d5d8b [HttpClient] Preserve the case of headers when sending them 2019-07-31 13:44:32 +02:00
Nicolas Grekas
5db58f6d37 Merge branch '4.3' into 4.4
* 4.3:
  [Security/Core] align defaults for sodium with PHP 7.4
  fix inline handling when dumping tagged values
  [HttpClient] fix canceling responses in a streaming loop
  [Messenger] Flatten collection of stamps collected by the traceable middleware
  [PropertyAccess] Fix PropertyAccessorCollectionTest
  [HttpClient] rewind stream when using Psr18Client
  Typo in web profiler
  [4.3] Remove dead test fixtures
  [Routing] Fix CHANGELOG
  relax some date parser patterns
  Avoid getting right to left style
2019-07-24 16:49:41 +02:00
Nicolas Grekas
c5c67d913d [HttpClient] fix canceling responses in a streaming loop 2019-07-24 09:56:35 +02:00
Nicolas Grekas
55c0b02587 Merge branch '4.3' into 4.4
* 4.3: (34 commits)
  [PhpunitBridge] Read environment variable from superglobals
  [Bridge/PhpUnit] Fix PHP5.5 compat
  [PhpUnitBridge] More accurate grouping
  fixed CS
  Extract unrecoverable exception to interface
  [FrameworkBundle] Fix calling Client::getProfile() before sending a request
  Fix type error
  [Security/Core] require libsodium >= 1.0.14
  [Workflow] re-add workflow.definition tag to workflow services
  [Security/Core] Don't use ParagonIE_Sodium_Compat
  revert #30525 due to performance penalty
  collect called listeners information only once
  [Lock] fix missing inherit docs in RedisStore
  [Messenger] fix retrying handlers using DoctrineTransactionMiddleware
  [Mailgun Mailer] fixed issue when using html body
  [HttpClient] fix timing measurements with NativeHttpClient
  [HttpClient] fix dealing with 1xx informational responses
  add test to avoid regressions
  fix mirroring directory into parent directory
  fix typos
  ...
2019-06-26 11:30:56 +02:00
Nicolas Grekas
412411d795 [HttpClient] fix dealing with 1xx informational responses 2019-06-23 19:42:15 +02:00
Nicolas Grekas
8a1813a095 Revert "minor #32054 Prepare for PHP 7.4 preload (nicolas-grekas)"
This reverts commit a0aa94114a, reversing
changes made to 8496003634.
2019-06-20 08:42:33 +02:00
Nicolas Grekas
651de173df Merge branch '4.3' into 4.4
* 4.3:
  [Cache] replace getNsSeparator by NS_SEPARATOR on AbstractTrait
  [Cache] fix versioning with SimpleCacheAdapter
  [Messenger] fix AMQP delay queue to be per exchange
  Fix expired lock not cleaned
  [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error
  [HttpFoundation] Fix SA/phpdoc JsonResponse
  [DI] Show the right class autowired when providing a non-existing class in constructor
  SimpleCacheAdapter fails to cache any item if a namespace is used
  validate composite constraints in all groups
  [Serializer] Handle true and false appropriately in CSV encoder
  [Messenger] improve logs
  [Messenger] fix delay delivery for non-fanout exchanges
  Parameterize Mailgun's region
  Fix binary operation `+`, `-` or `*` on string
  [VarDumper] fix dumping objects that implement __debugInfo()
  [HttpClient] Don't use CurlHttpClient on Windows when curl.cainfo is not set
  Add statement to fileLink to ignore href code when no fileLink.
  [Routing] fix absolute url generation when scheme is not known
2019-06-17 19:38:10 +02:00
Nicolas Grekas
3f167417fb [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error 2019-06-16 20:17:37 +02:00
Nicolas Grekas
7cf3fb4a21 Prepare for PHP 7.4 preload 2019-06-15 00:30:02 +02:00
Fabien Potencier
8787bbc94a Merge branch '4.3' into 4.4
* 4.3:
  fixed CS
  fixed CS
  fixed CS
  Do not log or call the proxy function when the locale is the same
  Added missing required dependencies on psr/cache and psr/container in symfony/cache-contracts and symfony/service-contracts respectively.
  [HttpClient] fix closing debug stream prematurely
  [Mailer] made code more robust
  Restore compatibility with php 5.5
  fixed sender/recipients in SMTP Envelope
  collect called listeners information only once
  [HttpKernel] Remove TestEventDispatcher.
2019-06-13 13:05:05 +02:00
Fabien Potencier
9526988eca fixed CS 2019-06-13 13:03:18 +02:00
Fabien Potencier
84bc7aba91 Merge branch '4.2' into 4.3
* 4.2:
  fixed CS
  fixed CS
  [HttpKernel] Remove TestEventDispatcher.
2019-06-13 13:01:17 +02:00
Fabien Potencier
37fa45bbd1 fixed CS 2019-06-13 12:57:15 +02:00
Michael Bessolov
9cbeb63613
Added missing required dependencies on psr/cache and psr/container
in symfony/cache-contracts and symfony/service-contracts respectively.
2019-06-12 23:16:15 -07:00
Nicolas Grekas
d3055814ad Merge branch '4.3' into 4.4
* 4.3:
  [Cache] Fixed undefined variable in ArrayTrait
  [HttpClient] revert bad logic around JSON_THROW_ON_ERROR
  [HttpKernel] Fix handling non-catchable fatal errors
  Fix json-encoding when JSON_THROW_ON_ERROR is used
  [HttpFoundation] work around PHP 7.3 bug related to json_encode()
  [HttpClient] add $response->cancel()
  [Security] added support for updated \"distinguished name\" format in x509 authentication
2019-06-05 15:27:25 +02:00
Fabien Potencier
e5b082acee bug #31850 [HttpClient] add $response->cancel() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add $response->cancel()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11668

An alternative to #31845 and #31842.
Same as  #31831 but considered as a bug fix (at the Contracts level), thus for 4.3.
I think we're early enough since 4.3/1.1 to do it.
That will save us some headaches in the short term.

Commits
-------

c402418723 [HttpClient] add $response->cancel()
2019-06-05 15:19:12 +02:00
Fabien Potencier
7207849037 Merge branch '4.3' into 4.4
* 4.3:
  [Console] Add check for Konsole/Yakuake to disable hyperlinks
  [HttpClient] work around PHP 7.3 bug related to json_encode()
  [VarDumper] fix dumping the cloner itself
  Rename the Symfony Mailer service config to avoid conflict with SwitMailer
  Set default crypto method - Fix #31105
  [Form] add missing symfony/service-contracts dependency
  [HttpClient] Don't throw InvalidArgumentException on bad Location header
2019-06-05 04:26:21 +02:00
Nicolas Grekas
c402418723 [HttpClient] add $response->cancel() 2019-06-04 13:36:30 +02:00
Nicolas Grekas
4acca42330 [HttpClient] Don't throw InvalidArgumentException on bad Location header 2019-06-04 10:32:15 +02:00
Nicolas Grekas
549930e820 [HttpClient] add $response->cancel() 2019-06-03 20:11:29 +02:00
Robin Chalas
8e5b6573ea Merge branch '4.3' into 4.4
* 4.3:
  [Security\Core] Make SodiumPasswordEncoder validate BCrypt-ed passwords
  [Validator] Fix TimezoneValidator default option
  [Messenger] Inject RoutableMessageBus instead of bus locator
  [DomCrawler] Fix type error with null Form::$currentUri
  [Contracts] Fixed typos
  do not enable validator auto mapping by default
  [HttpClient] remove unused argument
2019-05-31 20:55:48 +02:00
SAMUEL NELA
0bb8ba4ea4
[Contracts] Fixed typos 2019-05-31 00:41:44 +02:00
Nicolas Grekas
384393cb36 Allow Symfony 5.0 2019-05-28 17:53:17 +02:00
Nicolas Grekas
90167c36f8 fix tests 2019-05-28 11:19:25 +02:00
Nicolas Grekas
cfeb5bee07 fix tests 2019-05-28 09:50:59 +02:00
Chris Wilkinson
b27b4199fc
Fix typo 2019-05-27 11:52:29 +01:00
Nicolas Grekas
0a640c53cb Reference individual contracts packages 2019-05-27 10:16:38 +02:00
Nicolas Grekas
f410691842 [Contracts] split in one package per sub-contracts 2019-05-22 14:23:29 +02:00
Nicolas Grekas
7a53e8d3f9 Merge branch '4.2' into 4.3
* 4.2:
  [Routing] Fixed unexpected 404 NoConfigurationException
  [DI] Removes number of elements information in debug mode
  [Contracts] Simplify implementation declarations
  Update PR template for 4.3
  [Intl] Add FallbackTrait for data generation
  [Console] Commands with an alias should not be recognized as ambiguous
  clarify the possible class/interface of the cache
2019-05-09 11:33:12 +02:00
Nicolas Grekas
7d51da36a7 [Contracts] Simplify implementation declarations 2019-05-09 09:39:53 +02:00
Mehdi Achour
c5819f444d
[HttpClient] fix typo 2019-04-27 15:29:50 +01:00
Nicolas Grekas
8f699541f5 [HttpClient] fix too high timeout in test 2019-04-15 19:24:46 +02:00
Alexander M. Turek
8acf29eaf5 There is no OB to flush. 2019-04-07 10:26:05 +02:00
Nicolas Grekas
847a9bb86d [Cache] add logs on early-recomputation and locking 2019-04-03 11:22:57 +02:00
Nicolas Grekas
0b21268bf5 [HttpClient][Contracts] rename "raw_headers" to "response_headers" 2019-04-02 12:06:39 +02:00
Fabien Potencier
07276642de fixed typo 2019-03-31 15:49:16 +02:00
Nicolas Grekas
a4ce08ec30 [Contracts][EventDispatcher] move the Event class to symfony/contracts 2019-03-29 19:47:03 +01:00
Mateusz Sip
aaf5422cfb [DI][Contracts] add and implement ServiceProviderInterface 2019-03-28 12:22:02 +01:00
Fabien Potencier
c949f9a282 feature #30691 [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible

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

This PR adds a new `EventDispatcherInterface` in `Contracts`. This interface contains only one method: `dispatch($event, $eventName)`. That covers almost all use cases of the event dispatcher in components (some use add/removeListeners/Subscribers but they are a minority.)

While doing so, it allows dispatching any objects as events - not only instances of `Event`.

This allows decoupling e.g. `Messenger` from the `EventDispatcher` component.
Next steps could be about planning to remove the base `Event` class from some concrete event classes and/or moving `EventSubscriberInterface` to `symfony/contracts`. It would allow decoupling e.g. `Workflow` from the component - but that's too far away for now, let's think about it in 5.1.

Commits
-------

3c3db2f14a [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible
2019-03-27 07:28:10 +01:00
Gregor Harlan
226dbbc54f
[Contracts] fix phpdoc for http-client (user_data) 2019-03-26 00:17:13 +01:00
Nicolas Grekas
3c3db2f14a [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible 2019-03-25 18:18:00 +01:00
Fabien Potencier
dae5686722 [HttpClient] added CachingHttpClient 2019-03-22 16:52:17 +01:00
Fabien Potencier
d5d1b50cf7 feature #30604 [HttpClient] add MockHttpClient (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] add MockHttpClient

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

This PR introduces `MockHttpClient` and `MockResponse`, to be used for testing classes that need an HTTP client without making actual HTTP requests.

`MockHttpClient` is configured via its constructor: you provide it either with an iterable or a callable, and these will be used to provide responses as the consumer requests them.

Example:
```php
$responses = [
    new MockResponse($body1, $info1),
    new MockResponse($body2, $info2),
];

$client = new MockHttpClient($responses);
$response1 = $client->request(...); // created from $responses[0]
$response2 = $client->request(...); // created from $responses[1]
```

Or alternatively:
```php
$callback = function ($method, $url, $options) {
    return new MockResponse(...);
};

$client = new MockHttpClient($callback);
$response = $client->request(...); // calls $callback internal
```

The responses provided to the client don't have to be instances of `MockResponse` - any `ResponseInterface` works (e.g. `$this->getMockBuilder(ResponseInterface::class)->getMock()`).

Using `MockResponse` allows simulating chunked responses and timeouts:
```php
$body = function () {
    yield 'hello';
    yield ''; // the empty string is turned into a timeout so that they are easy to test
    yield 'world';
};
$mockResponse = new Mockresponse($body);
```

Last but not least, the implementation simulates the full lifecycle of a properly behaving `HttpClientInterface` contracts implementation: error handling, progress function, etc. This is "proved" by `MockHttpClientTest`, who implements and passes the reference test suite in `HttpClientTestCase`.

Commits
-------

8fd7584158 [HttpClient] add MockHttpClient
2019-03-19 19:41:07 +01:00
Nicolas Grekas
8fd7584158 [HttpClient] add MockHttpClient 2019-03-19 19:38:55 +01:00
Anton Chernikov
103448cc67 [HttpClient] exceptions carry response 2019-03-19 08:49:42 +01:00
Kévin Dunglas
8d5096a638
[HttpClient] Allow to pass user/pw as an array 2019-03-14 08:32:36 +01:00
Kévin Dunglas
f79ef21458 [HttpClient] Add new bearer option 2019-03-14 08:15:49 +01:00
Nicolas Grekas
e11ef7ed12 [HttpClient] yield a last chunk for completed responses also 2019-03-11 12:00:28 +01:00
Nicolas Grekas
f54c89c530 [HttpClient] add missing test case 2019-03-10 23:05:39 +01:00
Nicolas Grekas
4619ae483d feature #30499 [HttpClient] add ResponseInterface::toArray() (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[HttpClient] add ResponseInterface::toArray()

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

I'd like we discuss adding a `toArray()` method to `ResponseInterface`.

JSON responses are so common when doing server-side requests that this may help remove boilerplate - especially the logic dealing with errors.

WDYT?

(about flags, I don't think we should make them configurable: if one really needs to deal with custom flags, there's always `ResponseInterface::getContent()` - but it should be very rare.).

Commits
-------

aabd1d455e [HttpClient] add ResponseInterface::toArray()
2019-03-10 18:25:55 +01:00
Nicolas Grekas
aabd1d455e [HttpClient] add ResponseInterface::toArray() 2019-03-09 17:49:48 +01:00
Nicolas Grekas
0e2ea87199 [HttpClient] Remove dead code 2019-03-09 17:08:21 +01:00
Nicolas Grekas
3eca2b448d [HttpClient] fixes 2019-03-08 17:57:56 +01:00
Nicolas Grekas
d2d63a28e1 [Contracts] introduce HttpClient contracts 2019-03-07 17:16:38 +01:00
Nicolas Grekas
aa6a60ead6 [Contracts] bump branch alias 2019-03-04 11:50:13 +01:00
Fabien Potencier
e03db43894 fixed CS 2019-01-16 22:31:25 +01:00
Fabien Potencier
d2098d7e5d fixed CS 2019-01-16 21:35:37 +01:00
Christian Flothmann
36110b1e95 update years in license files 2019-01-03 10:09:06 +01:00
Nicolas Grekas
73e4a1a5ff [Contracts] extract LocaleAwareInterface out of TranslatorInterface 2018-12-05 08:06:11 +00:00
Nicolas Grekas
302b8446a7 [Contracts][Cache] allow retrieving metadata of cached items 2018-11-24 10:35:08 +01:00
Nicolas Grekas
07e2cc2858 [Contracts] clarify the README 2018-11-21 19:26:39 +01:00
Nicolas Grekas
fd74951405 Merge branch '4.1'
* 4.1:
  [Form] Hardened test suite for empty data
  Bump phpunit XSD version to 5.2
  [Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables
  Add required key attribute
2018-11-11 20:52:12 +01:00
Nicolas Grekas
321d7f4be0 [Cache] allow to skip saving the computed value when using CacheInterface::get() 2018-10-31 09:00:32 +01:00
Fabien Potencier
51f39b9999 feature #28718 [Cache] add CacheInterface::delete() + improve CacheTrait (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] add CacheInterface::delete() + improve CacheTrait

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

I've been hesitating a lot on this topic, but I think we should add a `delete()` method to `CacheInterface`.
Deleting is a very common invalidation strategy and invalidating by passing `$beta=INF` to `get()` has the drawback of requiring a fetch+unserialize+save-with-past-expiration. That's complexity that a delete removes.

This PR fixes an issue found meanwhile on `get()`: passing an `ItemInterface` to its callback makes it harder than required to implement on top of PSR-6. Let's pass a `CacheItemInterface`.

Lastly, the early expiration logic can be moved from the component to the trait shipped on contracts.

Here we are for all these steps.

Commits
-------

c6cf690b2f [Cache] add CacheInterface::delete() + improve CacheTrait
2018-10-10 02:20:36 -07:00
Nicolas Grekas
dc5f3bfff7 Make trans + %count% parameter resolve plurals 2018-10-06 18:22:22 +02:00
Nicolas Grekas
c6cf690b2f [Cache] add CacheInterface::delete() + improve CacheTrait 2018-10-06 16:52:09 +02:00
Nyholm
d870a850bd [Translator] Deprecated transChoice and moved it away from contracts 2018-10-06 09:58:31 +02:00
Nicolas Grekas
8a11e76c14 [Contracts] fine tune composer.json declarations for suggest/provide 2018-09-20 15:44:19 +02:00
Nyholm
06cd8dca8f [Cache][Contracts] We must save the item or the trait does not have any effect 2018-09-17 20:09:31 +02:00
Nicolas Grekas
675abdcfee [Contracts] Add traits+interfaces from the DI component 2018-09-04 10:20:02 +02:00
Nicolas Grekas
ca6478bbbb [Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection 2018-09-04 09:16:03 +02:00
Nicolas Grekas
064e369e06 [Contracts] Add Translation\TranslatorInterface + decouple symfony/validator from symfony/translation 2018-09-03 15:19:33 +02:00
Christian Flothmann
ec795cca78 fix compatibility with older Cache versions
FrameworkBundle 4.2 will be compatible with older versions of the Cache
component. In those versions adapters don't implement `ResetInterface`.
For backwards compatibility they still need to be tagged.
2018-07-14 10:12:57 +02:00