Commit Graph

426 Commits

Author SHA1 Message Date
Fabien Potencier ee787d17b4 [Mime] added classes for generating MIME messages 2019-03-02 15:10:47 +01:00
Robin Chalas 9429face97 feature #29753 [Console] Add an iterate method to the ProgressBar class (jvasseur)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Console] Add an iterate method to the ProgressBar class

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

Add an iterate method to the `ProgressBar` class that simplify updating the progress bar when iterating over an `iterable`.

Before:
```php
$bar->start();
foreach ($iterable as $value) {
    // Process $value

    $bar->advance();
}
$bar->finish();
```

After:
```php
foreach ($bar->iterate($iterable) as $value) {
    // Process $value
}
```

Additionally if `$iterable` is countable, the progress bar max step will automatically set to its count. If it isn't countable, nothing is done (instead of setting it to 0) to allow passing a max independently before calling `iterate`.

I will try to do the doc PR soon.

Commits
-------

eb355314b0 Add an iterate method to the ProgressBar class
2019-01-31 10:53:43 +01:00
Jérôme Vasseur eb355314b0 Add an iterate method to the ProgressBar class 2019-01-30 21:33:07 +01:00
Nicolas Grekas e8a7a0e2fc Dont advertize what symfony/symfony "provides" 2019-01-24 23:02:27 +01:00
Fabien Potencier 74ca91deaa [Mime] added the component 2019-01-16 23:56:01 +01:00
Nicolas Grekas ee337dd761 Merge branch '4.2'
* 4.2:
  [Security\Http] detect bad redirect targets using backslashes
  [Form] Filter file uploads out of regular form types
  Fix CI
  minor #28258 [travis] fix composer.lock invalidation for deps=low (nicolas-grekas)
  [travis] fix composer.lock invalidation for PRs patching several components
  [travis] fix composer.lock invalidation for deps=low
  minor #28199 [travis][appveyor] use symfony/flex to accelerate builds (nicolas-grekas)
  [travis] ignore ordering when validating composer.lock files for deps=low
  minor #28146 [travis] cache composer.lock files for deps=low (nicolas-grekas)
  fix ci
  [travis] fix requiring mongodb/mongodb before composer up
  minor #28114 [travis] merge "same Symfony version" jobs in one (nicolas-grekas)
  [2.7] Make CI green
  updated VERSION for 2.7.49
  updated CHANGELOG for 2.7.49
  [HttpKernel] fix trusted headers management in HttpCache and InlineFragmentRenderer
  [HttpFoundation] Remove support for legacy and risky HTTP headers
  updated VERSION for 2.7.48
  update CONTRIBUTORS for 2.7.48
  updated CHANGELOG for 2.7.48
2018-12-06 11:37:20 +00:00
Nicolas Grekas 95e4edba92 Merge branch '4.1' into 4.2
* 4.1:
  [Security\Http] detect bad redirect targets using backslashes
  [Form] Filter file uploads out of regular form types
  Fix CI
  minor #28258 [travis] fix composer.lock invalidation for deps=low (nicolas-grekas)
  [travis] fix composer.lock invalidation for PRs patching several components
  [travis] fix composer.lock invalidation for deps=low
  minor #28199 [travis][appveyor] use symfony/flex to accelerate builds (nicolas-grekas)
  [travis] ignore ordering when validating composer.lock files for deps=low
  minor #28146 [travis] cache composer.lock files for deps=low (nicolas-grekas)
  fix ci
  [travis] fix requiring mongodb/mongodb before composer up
  minor #28114 [travis] merge "same Symfony version" jobs in one (nicolas-grekas)
  [2.7] Make CI green
  updated VERSION for 2.7.49
  updated CHANGELOG for 2.7.49
  [HttpKernel] fix trusted headers management in HttpCache and InlineFragmentRenderer
  [HttpFoundation] Remove support for legacy and risky HTTP headers
  updated VERSION for 2.7.48
  update CONTRIBUTORS for 2.7.48
  updated CHANGELOG for 2.7.48
2018-12-06 11:36:58 +00:00
Fabien Potencier 534b83f080 updated version to 4.3 2018-11-26 17:19:01 +01:00
Nicolas Grekas a42e8774d6 [Cache] added support for connecting to Redis clusters via DSN 2018-10-10 06:45:03 -07:00
Nicolas Grekas 0a1220fd96 [Cache] leverage Contracts\Cache 2018-09-04 09:24:06 +02:00
Nicolas Grekas de6329a7d9 Autoload symfony/contracts from the local repository 2018-09-01 18:41:38 +02:00
Fabien Potencier da0ef24744 feature #28231 [VarExporter] a new component to serialize values to plain PHP code (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] a new component to serialize values to plain PHP code

| 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 proposes moving what is currently the `PhpMarshaller` class in the Cache component to a separate component.

This component would provide only one public static method:
`VarExporter::export($value, bool &$isStaticValue = null): string`.

This method returns `$value` serialized as plain PHP code. Running this code creates the same exact data structure that `$value` contained. This is exactly like `serialize()` and `unserialize()`, from which all semantics are preserved (`__sleep`, `__wakeup` and `Serializable`).

The reason to use this method *vs* `serialize()` or even igbinary is performance: thanks to OPcache, the resulting code is significantly faster and more memory efficient than using `unserialize()` or `igbinary_unserialize()`.

Unlike `var_export()`, this works on any serializable PHP value.

It also provides a few improvements over `var_export()`/`serialize()`:
- the output is PSR-2 compatible
- the output can be re-indented without messing up with any `\r` or `\n` in the data
- missing classes throw a `ReflectionException` instead of being unserialized to a `PHP_Incomplete_Class` object
- references involving `SplObjectStorage`, `ArrayObject` or `ArrayIterator` instances are preserved
- `Reflection*`, `IteratorIterator` and `RecursiveIteratorIterator` classes throw an exception when being serialized (their unserialized version is broken anyway, see  https://bugs.php.net/76737.)

Commits
-------

7831ad75e5 [VarExporter] a new component to serialize values to plain PHP code
2018-08-27 18:42:24 +02:00
Nicolas Grekas 7831ad75e5 [VarExporter] a new component to serialize values to plain PHP code 2018-08-27 18:34:07 +02:00
Nicolas Grekas 7b4e5cc50b Don't "replace" symfony/contracts 2018-08-22 08:18:58 +02:00
Nicolas Grekas d0a97b40ae Merge branch '3.4' into 4.1
* 3.4:
  [DoctrineBridge] allow dev versions of Doctrine again
  bumped Symfony version to 3.4.15
  updated VERSION for 3.4.14
  updated CHANGELOG for 3.4.14
  bumped Symfony version to 2.8.45
  updated VERSION for 2.8.44
  update CONTRIBUTORS for 2.8.44
  updated CHANGELOG for 2.8.44
2018-08-01 18:22:14 +02:00
Nicolas Grekas 83dcbe9096 [DoctrineBridge] allow dev versions of Doctrine again 2018-08-01 17:25:41 +02:00
Michael Moravec cb91cdef91 Remove direct dependencies on doctrine/common 2018-08-01 14:08:31 +02:00
Fabien Potencier c1f23c859e Merge branch '4.1'
* 4.1:
  Fix tests
2018-07-19 08:48:32 +02:00
Fabien Potencier 480bf7e937 Merge branch '4.0' into 4.1
* 4.0:
  Fix tests
2018-07-19 08:48:25 +02:00
Fabien Potencier 62bb68d758 Merge branch '3.4' into 4.0
* 3.4:
  Fix tests
2018-07-19 08:48:16 +02:00
Fabien Potencier 682836da9c renamed Contract to Contracts 2018-07-13 19:06:58 +02:00
Kévin Dunglas aaf7e889f7
Fix tests 2018-07-13 14:52:14 +02:00
Nicolas Grekas 898203649f Added symfony/contracts: a set of abstractions extracted out of the components 2018-07-11 10:17:42 +02:00
Nicolas Grekas a32393ba37 Merge branch '4.1'
* 4.1:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
  [Workflow] Update phpdoc to fit a used className
  [PropertyInfo] added handling of nullable types in PhpDoc
  [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
  [Cache] provider does not respect option maxIdLength with versioning enabled
  [Form] Fix fixtures for forward compat
  [Lock] Fix SemaphoreStoreTest on OS X
  Ensure the class discriminator mechanism works with serialization groups as well
  fix handling of empty DI extension configs
2018-07-03 20:14:13 +02:00
Nicolas Grekas 6500560000 Merge branch '4.0' into 4.1
* 4.0:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
  [PropertyInfo] added handling of nullable types in PhpDoc
  [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
  [Cache] provider does not respect option maxIdLength with versioning enabled
2018-07-03 19:58:50 +02:00
Nicolas Grekas 4ce5a1bbc0 Merge branch '3.4' into 4.0
* 3.4:
  Add color support for Hyper terminal .
  [HttpFoundation] Fix tests: new message for status 425
  [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
  [PropertyInfo] added handling of nullable types in PhpDoc
  [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler
  [Cache] provider does not respect option maxIdLength with versioning enabled
2018-07-03 19:50:16 +02:00
Fabien Potencier 1aae2333d8 bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] added handling of nullable types in PhpDoc

While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. `?string`), and returns those in a `Nullable` wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found").

Correctly parse this syntax into a nullable type.

| 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

Commits
-------

38b369be3f [PropertyInfo] added handling of nullable types in PhpDoc
2018-07-02 14:52:55 +02:00
Oxan van Leeuwen 38b369be3f [PropertyInfo] added handling of nullable types in PhpDoc
While not specified in PSR-5, PhpDocumentor does support parsing
nullable types in the PHP 7.1 syntax (i.e. ?string), and returns those
in a Nullable wrapper. We currently don't handle this and neither throw
an error, which results in all kind of weird breakage when this syntax
is used (e.g. "class string|int not found").

Correctly parse this syntax into a nullable type.
2018-07-01 23:26:09 +02:00
Nicolas Grekas 5fe78a33d8 Revert "minor #27609 Remove direct dependencies on doctrine/common (Majkl578)"
This reverts commit 92c37b9711, reversing
changes made to bc8d4f627e.
2018-06-25 13:45:21 +02:00
Nicolas Grekas 0cfbed1bbb Merge branch '4.0' into 4.1
* 4.0:
  [DoctrineBridge] blacklist doctrine/common@dev
2018-06-25 13:31:22 +02:00
Nicolas Grekas 765b402851 Merge branch '3.4' into 4.0
* 3.4:
  [DoctrineBridge] blacklist doctrine/common@dev
2018-06-25 13:30:59 +02:00
Nicolas Grekas a22de07c30 [DoctrineBridge] blacklist doctrine/common@dev 2018-06-25 13:26:49 +02:00
Michael Moravec b0fa398187
Remove direct dependencies on doctrine/common 2018-06-19 13:41:48 +02:00
Fabien Potencier 016d556262 updated version to 4.2 2018-05-07 16:51:25 +02:00
Nicolas Grekas 7183c59c20 Merge branch '4.0'
* 4.0:
  Remove symfony/polyfill-ctype where not needed
  Use symfony/polyfill-ctype
  [Form] fixes instance variable phpdoc in FormRegistry class
  bumped Symfony version to 4.0.10
  updated VERSION for 4.0.9
  updated CHANGELOG for 4.0.9
  bumped Symfony version to 3.4.10
  updated VERSION for 3.4.9
  updated CHANGELOG for 3.4.9
2018-05-01 16:02:13 -07:00
Nicolas Grekas a488d555ff Merge branch '3.4' into 4.0
* 3.4:
  Remove symfony/polyfill-ctype where not needed
  Use symfony/polyfill-ctype
  [Form] fixes instance variable phpdoc in FormRegistry class
  bumped Symfony version to 3.4.10
  updated VERSION for 3.4.9
  updated CHANGELOG for 3.4.9
  Add CODE_OF_CONDUCT.md
  Added .github/CODEOWNERS
  bumped Symfony version to 2.8.40
  updated VERSION for 2.8.39
  updated CHANGELOG for 2.8.39
2018-05-01 16:00:51 -07:00
Nicolas Grekas e525248f66 Merge branch '2.8' into 3.4
* 2.8:
  Remove symfony/polyfill-ctype where not needed
  Use symfony/polyfill-ctype
  [Form] fixes instance variable phpdoc in FormRegistry class
2018-05-01 15:53:27 -07:00
Nicolas Grekas 087c667b83 Merge branch '2.7' into 2.8
* 2.7:
  Remove symfony/polyfill-ctype where not needed
  Use symfony/polyfill-ctype
  [Form] fixes instance variable phpdoc in FormRegistry class
2018-05-01 15:52:40 -07:00
Gert de Pagter afc09cc8a7 Use symfony/polyfill-ctype
Use the polyfill for every package that uses cytpe functions.
2018-05-01 15:30:49 -07:00
Samuel ROZE c9cfda990b [Messenger] Add a new Messenger component 2018-03-23 09:01:52 +01:00
Nicolas Grekas 75894936ac Merge branch '2.7' into 2.8
* 2.7:
  [HttpFoundation] fixed return type of method HeaderBag::get
  [HttpFoundation] Added "resource" type on Request::create docblock
  Revert "bug #25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"
  Revert "bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"
  [Validator] add missing parent isset and add test
2018-01-21 20:03:25 +01:00
Christian Flothmann 1a1aaa74d6 Revert "bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"
This reverts commit f1f18ad608, reversing
changes made to 8e8ee09747.
2018-01-20 13:12:25 +01:00
Fabien Potencier 420789c694 Merge branch '2.7' into 2.8
* 2.7:
  [Validator] Conflict with egulias/email-validator 2.0
2018-01-20 11:50:52 +01:00
Edi Modrić 72d8e8adb0 [Validator] Conflict with egulias/email-validator 2.0 2018-01-20 00:08:53 +01:00
Tobias Schultze 3a7099c0e2 Merge branch '3.3' into 3.4 2018-01-15 11:51:37 +01:00
Chris Wilkinson 939efd59b9 Remove polyfill-util dependency from fullstack and security 2018-01-13 12:56:38 +00:00
Fabien Potencier c37b6beb73 updated version to 4.1 2017-11-21 18:31:29 +01:00
Nicolas Grekas 8603bf1081 Merge branch '2.7' into 2.8
* 2.7:
  Bump phpunit-bridge requirement to 3.4|4.0
  [Form] Rename `FormConfigBuilder::$nativeRequestProcessor` private variable to `::$nativeRequestHandler`
  Add a "link" script to ease debugging Flex apps
  [Form] Add phpdoc to `RequestHandlerInterface::isFileUpload()` method
2017-11-21 10:57:39 +01:00
Nicolas Grekas 1c1a540d2f Bump phpunit-bridge requirement to 3.4|4.0 2017-11-21 10:30:35 +01:00
Nicolas Grekas 58aaa012ab Merge branch '3.4'
* 3.4:
  [Bridge/PhpUnit] Fix compat with phpunit 4.8 & bridge <=3.3.13
  Move deprecation under use statements
  Remove function_exists(__phpunit_run_isolated_test) checks
2017-11-19 22:10:49 +02:00