Commit Graph

4016 Commits

Author SHA1 Message Date
Robin Chalas
ac8256ba9c [TwigBridge] Fix deprecation on twig 2.9 2019-04-27 00:25:38 +02:00
Nicolas Grekas
1d55f800e4 [PhpUnitBridge] fix reading phpunit.xml on bootstrap 2019-04-23 16:37:24 +02:00
Fabien Potencier
7e56ef1a3d bug #31085 [DoctrineBridge] Unique mapping setting is optional (ksaveras)
This PR was squashed before being merged into the 4.3-dev branch (closes #31085).

Discussion
----------

[DoctrineBridge] Unique mapping setting is optional

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

```sh
Executed script cache:clear  [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!   // Clearing the cache for the dev environment with debug
!!   // true
!!
!!
In DoctrineLoader.php line 71:

  [ErrorException]
  Notice: Undefined index: unique

Exception trace:
 () at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/doctrine-bridge/Validator/DoctrineLoader.php:71
 Symfony\Bridge\Doctrine\Validator\DoctrineLoader->loadClassMetadata() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/validator/Mapping/Loader/LoaderChain.php:54
 Symfony\Component\Validator\Mapping\Loader\LoaderChain->loadClassMetadata() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php:105
 Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory->getMetadataFor() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/CacheWarmer/ValidatorCacheWarmer.php:63
 Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer->doWarmUp() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/CacheWarmer/AbstractPhpFileCacheWarmer.php:51
 Symfony\Bundle\FrameworkBundle\CacheWarmer\AbstractPhpFileCacheWarmer->warmUp() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php:96
 Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:194
 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:129
 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Application.php:930
 Symfony\Component\Console\Application->doRunCommand() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Console/Application.php:87
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/framework-bundle/Console/Application.php:73
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/ksaveras/Projects/mokytojas.local/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/ksaveras/Projects/mokytojas.local/bin/console:40

cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

./bin/console ca:cl
```

Commits
-------

fde4dc9922 [DoctrineBridge] Unique mapping setting is optional
2019-04-22 11:07:11 +02:00
Ksaveras Šakys
fde4dc9922 [DoctrineBridge] Unique mapping setting is optional 2019-04-22 11:07:01 +02:00
Grégoire Paris
6c3c199b4e
Treat undefined env var as strict mode
An undefined SYMFONY_DEPRECATION_HELPER environment variable translates
to false, and that was previously interpreted as 0, which means strict
mode.
This restores backwards compatibility with the previous behavior, which
got broken in 1c73f9cfed .
2019-04-18 22:11:24 +02:00
Nicolas Grekas
899985e1d5 Merge branch '4.2'
* 4.2:
  [DI] Check service IDs are valid
2019-04-16 13:20:43 +02:00
Nicolas Grekas
3fd01abf11 Merge branch '3.4' into 4.2
* 3.4:
  [DI] Check service IDs are valid
2019-04-16 13:19:53 +02:00
Nicolas Grekas
d2fb589392 [DI] Check service IDs are valid 2019-04-16 13:13:42 +02:00
Nicolas Grekas
d140648929 Merge branch '4.2'
* 4.2:
  Prevent destructors with side-effects from being unserialized
2019-04-16 11:37:27 +02:00
Nicolas Grekas
4b18b32133 Merge branch '3.4' into 4.2
* 3.4:
  Prevent destructors with side-effects from being unserialized
2019-04-16 11:36:45 +02:00
Nicolas Grekas
d77e445697 security #cve-2019-10912 [Cache][PHPUnit Bridge] Prevent destructors with side-effects from being unserialized (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache][PHPUnit Bridge] Prevent destructors with side-effects from being unserialized

| 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        | -

Reported for `FilesystemCommonTrait` at https://www.intigriti.com/company/submission/CfDJ8Pja6NZvkpNCmx5vVyiGSn7yW8c1j4H0-cnAhIk6fbstOMm028X-XD1kmSuQkGB2n0cRyyVrA2yAiLN_I0EVilaKVLSiSa0UXZJGfN1h85vmk5c2dBBpu619r1YQEIjcXA

Commits
-------

4fb9752816 Prevent destructors with side-effects from being unserialized
2019-04-16 11:03:16 +02:00
Nicolas Grekas
278a7ece35 Merge branch '4.2'
* 4.2:
  bumped Symfony version to 4.2.7
  updated VERSION for 4.2.6
  updated CHANGELOG for 4.2.6
  bumped Symfony version to 3.4.26
  updated VERSION for 3.4.25
  update CONTRIBUTORS for 3.4.25
  updated CHANGELOG for 3.4.25
  Workaround for \DateInterval::createFromDateString()
  [DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion.
  Missing Lithuanian translations added to validator component.
2019-04-16 09:33:54 +02:00
Amrouche Hamza
9ade232533 [DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion. 2019-04-15 11:42:18 +02:00
Nicolas Grekas
08577f4398 [PhpUnitBridge] fix PHP 5.5 support 2019-04-12 17:26:05 +02:00
Nicolas Grekas
770c7ddec4 [PhpUnitBridge] CS fix 2019-04-12 16:49:44 +02:00
Amrouche Hamza
b34738bba6
[PhpUnitBridge] ClockMock does not mock gmdate() 2019-04-12 16:09:30 +02:00
Nicolas Grekas
2f73c2f66b fix 2019-04-12 15:55:35 +02:00
Nicolas Grekas
0cf183375a Merge branch '4.2'
* 4.2:
  [TwigBridge] fix tests
  [FrameworkBundle] Fix Controller deprecated when using composer --optimized
2019-04-12 15:50:47 +02:00
Nicolas Grekas
1d02ef2ccb Merge branch '3.4' into 4.2
* 3.4:
  [TwigBridge] fix tests
2019-04-12 15:50:35 +02:00
Nicolas Grekas
b11585e31f [PhpUnitBridge] fixes 2019-04-12 15:46:34 +02:00
Nicolas Grekas
33c6681585 [TwigBridge] fix tests 2019-04-12 15:39:20 +02:00
Grégoire Paris
1c73f9cfed
[PhpUnitBridge] Url encoded deprecations helper config 2019-04-11 23:10:50 +02:00
Fabien Potencier
9d3c86fdb6 Merge branch '4.2'
* 4.2:
  [serializer] validate that the specified callbacks and max_depth_handler are actually callable
  [Serializer] Respect ignored attributes in cache key of normalizer
  fix resetting the COLUMN environment variable
  Fix TestRunner compatibility to PhpUnit 8
  Fix dark themed componnents
  prevent mixup of the object to populate
2019-04-08 16:11:46 +02:00
Christian Flothmann
ec41d76624 Merge branch '3.4' into 4.2
* 3.4:
  [Serializer] Respect ignored attributes in cache key of normalizer
  fix resetting the COLUMN environment variable
  Fix TestRunner compatibility to PhpUnit 8
  prevent mixup of the object to populate
2019-04-08 13:36:05 +02:00
Alexander Schranz
a0c66a399d Fix TestRunner compatibility to PhpUnit 8 2019-04-08 09:56:31 +02:00
Christian Flothmann
44eb7a0485 fix backwards compatibility breaks 2019-04-07 23:31:58 +02:00
Christian Flothmann
2efd7b2149 Merge branch '4.2'
* 4.2:
  fix tests
  fix PHPUnit 4.8 compatibility
  [Debug] Fixed error handling when an error is already handled when another error is already handled (5)
  sync validator translations
2019-04-07 21:49:19 +02:00
Christian Flothmann
27df966705 fix tests 2019-04-07 21:30:26 +02:00
Jules Pietri
a234c8913e [DoctrineBridge] Deprecated using IdReader when optimization is not possible 2019-04-07 15:30:06 +02:00
Fabien Potencier
3df05e0877 feature #30962 [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader (HeahDude)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader

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

#EUFOSSA

Big thanks to @stof for the help with writing the test!

## Description
It happens that the `IdReader` is created by the `DoctrineType` and cached for each entity class case.
But the type already resolves whether or not it should use it, only when we can optimize query thanks to a single id field when defining the `choice_value` option: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L188.

This PR is a first step to optimize the choice loading process.

Commits
-------

287c39b9ea [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader
2019-04-07 12:26:36 +02:00
Jules Pietri
287c39b9ea [DoctrineBridge] Deprecated implicit optimization in DoctrineChoiceLoader 2019-04-07 12:14:41 +02:00
Nicolas Grekas
4447f87c2e Merge branch '4.2'
* 4.2:
  fix translating file validation error message
  [Validator] Add missing Hungarian translations
  Improving deprecation message of the Twig templates directory src/Resources/views
  [3.4] [Validator] Add missing french validation translations.
  [Validator] Only traverse arrays that are cascaded into
  Handle case where no translations were found
  [Validator] Translate unique collection message to Hungarian
  fix tests
  Run test in separate process
  Use a class name that does not actually exist
  [Profiler] Fix dark theme elements color
  fix horizontal spacing of inlined Bootstrap forms
  [Translator] Warm up the translations cache in dev
  turn failed file uploads into form errors
2019-04-07 11:58:10 +02:00
Nicolas Grekas
ecb52bc9f1 Merge branch '3.4' into 4.2
* 3.4:
  fix translating file validation error message
  [Validator] Add missing Hungarian translations
  [3.4] [Validator] Add missing french validation translations.
  [Validator] Only traverse arrays that are cascaded into
  Handle case where no translations were found
  [Validator] Translate unique collection message to Hungarian
  fix tests
  Run test in separate process
  Use a class name that does not actually exist
  fix horizontal spacing of inlined Bootstrap forms
  [Translator] Warm up the translations cache in dev
  turn failed file uploads into form errors
2019-04-07 11:56:43 +02:00
Valentin
388d8f548c [Routing] UrlHelper to get absolute URL for a path 2019-04-07 11:24:57 +02:00
Yonel Ceruto
89a00b315d Improving deprecation message of the Twig templates directory src/Resources/views 2019-04-07 10:37:45 +02:00
Fabien Potencier
e5f14b7d28 feature #30908 [Workflow] Added workflow_transition_blockers twig function (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Workflow] Added workflow_transition_blockers twig function

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

EUFOSSA

---

also related to https://github.com/symfony/symfony/issues/26689

I'm not a big fan of the current name. What should I pick?

cc @javiereguiluz

Commits
-------

a2f99757f1 [Workflow] Added workflow_transition_blockers twig function
2019-04-06 20:23:30 +02:00
Fabien Potencier
4c78e60ad5 feature #30893 Add "input" option to NumberType (fancyweb, Bernhard Schussek)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Add "input" option to NumberType

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

This PR replaces #24793 in (partially) fixing how Doctrine's DECIMAL type is handled by the Form component.

Previously, DECIMAL was mapped to the regular NumberType. That confuses Doctrine's change detection, depending on the DB platform.

Examples:

| DB | DB value | Doctrine entity before submit | Form input | Doctrine entity after submit
| --- | --- | --- | --- | ---
| SQLite | 8.000 | '8' | 8 | 8
| SQLite | 8.123 | '8.123' | 8.123 | 8.123
| PostgreSQL | 8.000 | '8.000' | 8 | 8
| PostgreSQL | 8.123 | '8.123' | 8.123 | 8.123

The value in the Doctrine entity changes before and after submit. Hence Doctrine believes an update is necessary.

This PR introduces an `input` option to NumberType (similar to DateType), that can be set to `'number'` (default) or `'string'`. If set to `'string'`, the conversion is as follows:

| DB | DB value | Doctrine entity before submit | Form input | Doctrine entity after submit
| --- | --- | --- | --- | ---
| SQLite | 8.000 | **'8'** | 8 | **'8.000'**
| SQLite | 8.123 | '8.123' | 8.123 | '8.123'
| PostgreSQL | 8.000 | '8.000' | 8 | '8.000'
| PostgreSQL | 8.123 | '8.123' | 8.123 | '8.123'

You see that this does not completely solve this issue for SQLite. However, @Ocramius and I agree that this is something to be fixed by Doctrine, since Doctrine is providing the database abstraction.

That fix should be done in the SqlitePlatform object in Doctrine as part of another PR and should be backwards compatible with the current Doctrine version (i.e. opt in via configuration).

Compared to #24793, this PR does not introduce a new type but instead makes the NumberType more flexible. Also, this PR does not introduce the `force_full_scale` option since that should be solved by Doctrine as described above.

Commits
-------

3f25734647 Added new option "input" to NumberType
fb2b37a8f3 add force_full_scale option to handle all cases
40f25121c3 [DoctrineBridge] Add decimal form type
2019-04-06 20:17:43 +02:00
dFayet
8a9c2c86ef [Profiler] Fix dark theme elements color 2019-04-06 20:06:03 +02:00
Christophe Coevoet
07d90f987e Move doctrine/collections to an optional dep in doctrine-bridge
The EntityType does not need to convert the array to a collection if
the project does not care about using doctrine/collections. So this
can become an optional dependency.
2019-04-06 20:02:40 +02:00
Christian Flothmann
7113a53e19 fix horizontal spacing of inlined Bootstrap forms 2019-04-06 19:28:56 +02:00
Grégoire Pineau
a2f99757f1 [Workflow] Added workflow_transition_blockers twig function 2019-04-06 19:16:15 +02:00
Bernhard Schussek
3f25734647 Added new option "input" to NumberType 2019-04-06 16:48:06 +02:00
Fabien Potencier
f527acfac7 Merge branch '4.2'
* 4.2: (45 commits)
  [Form] various minor fixes
  Ensure the parent process is always killed
  bugfix: the terminal state was wrong and not reseted
  [Console] Fix inconsistent result for choice questions in non-interactive mode
  Define null return type for Constraint::getDefaultOption()
  [Routing] Fix: annotation loader ignores method's default values
  [HttpKernel] Fix DebugHandlersListener constructor docblock
  Skip Glob brace test when GLOB_BRACE is unavailable
  bumped Symfony version to 4.2.6
  updated VERSION for 4.2.5
  updated CHANGELOG for 4.2.5
  bumped Symfony version to 3.4.25
  updated VERSION for 3.4.24
  update CONTRIBUTORS for 3.4.24
  updated CHANGELOG for 3.4.24
  [EventDispatcher] cleanup
  fix testIgnoredAttributesInContext
  Re-generate icu 64.1 data
  Improve PHPdoc / IDE autocomplete for config tree builder
  [Bridge][Twig] DebugCommand - fix escaping and filter
  ...
2019-04-06 16:04:46 +02:00
Thomas Calvet
fb2b37a8f3 add force_full_scale option to handle all cases 2019-04-06 15:35:03 +02:00
Thomas Calvet
40f25121c3 [DoctrineBridge] Add decimal form type 2019-04-06 15:35:03 +02:00
Fabien Potencier
5e61b75893 [Twig] removed TemplatedEmail::template() 2019-04-03 20:45:56 +02:00
Nicolas Grekas
4fb9752816 Prevent destructors with side-effects from being unserialized 2019-04-02 17:51:53 +02:00
Yonel Ceruto
05e2e1e088 Add template file link 2019-04-01 18:40:03 -04:00
SpacePossum
b7120c5e49 [Bridge][Twig] DebugCommand - fix escaping and filter 2019-04-01 10:18:15 +02:00
Fabien Potencier
6bc2ae4018 feature #30320 [Form][TwigBridge] Add row_attr to form theme (alexander-schranz)
This PR was squashed before being merged into the 4.3-dev branch (closes #30320).

Discussion
----------

[Form][TwigBridge] Add row_attr to form theme

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | waiting for confirmation to implement
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Currently you need to copy the whole form_row block if you just want to add a class to the form_row div. Instead we could introduce a `row_attr` which can then simple be set the following in the theme e.g.:

```twig
{% block form_row %}
    {% set row_attr = { class: 'form__field' } %}
    {{ parent() }}
{% endblock %}
```

or in php:

```
$builder->add('test', TextType::class, ['row_attr' => ['class' => 'form__field']]);
```

Commits
-------

7ab1b00e02 [Form][TwigBridge] Add row_attr to form theme
2019-03-31 13:48:32 +02:00
Alexander Schranz
7ab1b00e02 [Form][TwigBridge] Add row_attr to form theme 2019-03-31 13:48:18 +02:00
Fabien Potencier
7554cf6f1d feature #27735 [Validator][DoctrineBridge][FWBundle] Automatic data validation (dunglas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator][DoctrineBridge][FWBundle] Automatic data validation

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes<!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to 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        | https://github.com/symfony/symfony-docs/pull/11132

This feature automatically adds some validation constraints by inferring existing metadata. To do so, it uses the PropertyInfo component and Doctrine metadata, but it has been designed to be easily extendable.

Example:

```php
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class Dummy
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(type="integer")
     */
    public $id;

    /**
     * @ORM\Column(nullable=true)
     */
    public $columnNullable;

    /**
     * @ORM\Column(length=20)
     */
    public $columnLength;

    /**
     * @ORM\Column(unique=true)
     */
    public $columnUnique;
}

$manager = $this->managerRegistry->getManager();
$manager->getRepository(Dummy::class);

$firstOne = new Dummy();
$firstOne->columnUnique = 'unique';
$firstOne->columnLength = '0';

$manager->persist($firstOne);
$manager->flush();

$dummy = new Dummy();
$dummy->columnNullable = 1; // type mistmatch
$dummy->columnLength = '012345678901234567890'; // too long
$dummy->columnUnique = 'unique'; // not unique

$res = $this->validator->validate($dummy);
dump((string) $res);

/*
Object(App\Entity\Dummy).columnUnique:\n
    This value is already used. (code 23bd9dbf-6b9b-41cd-a99e-4844bcf3077f)\n
Object(App\Entity\Dummy).columnLength:\n
    This value is too long. It should have 20 characters or less. (code d94b19cc-114f-4f44-9cc4-4138e80a87b9)\n
Object(App\Entity\Dummy).id:\n
    This value should not be null. (code ad32d13f-c3d4-423b-909a-857b961eb720)\n
Object(App\Entity\Dummy).columnNullable:\n
    This value should be of type string. (code ba785a8c-82cb-4283-967c-3cf342181b40)\n
*/
```

It also works for DTOs:

```php

class MyDto
{
    /** @var string */
    public $name;
}

$dto = new MyDto();
$dto->name = 1; // type error

dump($validator->validate($dto));

/*
Object(MyDto).name:\n
    This value should be of type string. (code ba785a8c-82cb-4283-967c-3cf342181b40)\n
*/
```

Supported constraints currently are:

* `@NotNull` (using PropertyInfo type extractor, so supports Doctrine metadata, getters/setters and PHPDoc)
* `@Type` (using PropertyInfo type extractor, so supports Doctrine metadata, getters/setters and PHPDoc)
* `@UniqueEntity` (using Doctrine's `unique` metadata)
* `@Length` (using Doctrine's `length` metadata)

Many users don't understand that the Doctrine mapping doesn't validate anything (it's just a hint for the schema generator). It leads to usability and security issues (that are not entirely fixed by this PR!!).
Even the ones who add constraints often omit important ones like `@Length`, or `@Type` (important when building web APIs).
This PR aims to improve things a bit, and ease the development process in RAD and when prototyping. It provides an upgrade path to use proper validation constraints.

I plan to make it opt-in, disabled by default, but enabled in the default Flex recipe. (= off by default when using components, on by default when using the full stack framework)

TODO:

* [x] Add configuration flags
* [x] Move the Doctrine-related DI logic from the extension to DoctrineBundle: doctrine/DoctrineBundle#831
* [x] Commit the tests

Commits
-------

2d64e703c2 [Validator][DoctrineBridge][FWBundle] Automatic data validation
2019-03-31 13:41:16 +02:00
SpacePossum
7bdb06641d [Bridge][Twig] DebugCommand - fix escaping and filter 2019-03-31 13:33:18 +02:00
Christian Flothmann
578d842bcd fix tests 2019-03-27 10:09:36 +01:00
Fabien Potencier
0c9d684d0a [Mime] added BodyRendererInterface 2019-03-27 08:07:59 +01:00
Fabien Potencier
f5386ffb2a [Mime] fixed serialization of Message instances 2019-03-27 07:58:31 +01:00
Christian Flothmann
dccf1ee354 fix PHP 5.3 compatibility 2019-03-26 21:16:42 +01:00
Grégoire Pineau
4d58beb7c8 [Workflow] Deprecate MultipleStateMarkingStore and SingleStateMarkingStore in favor of MethodMarkingStore 2019-03-22 15:53:11 +01:00
Fabien Potencier
522594a69d Merge branch '4.2'
* 4.2:
  [Phpunit] fixed support for PHP 5.3
  Response prepare method update
  [Workflow] Added missing license header
  Fix case when multiple loaders are providing paths for the same namespace
  Check if Client exists when test.client does not exist, to provide clearer exception message
  throw TypeErrors to prepare for type hints in 5.0
  [Form] Preventing validation of children if parent with Valid constraint has no validation groups
  [Form] Added ResetInterface to CachingFactoryDecorator
  Remove deprecated usage
  [Tests] fixed compatbility of assertEquals(): void
  Fixed usage of TranslatorInterface in form extension (fixes #30591)
  [Intl][4.2] Fix test
  [Intl] Fix test
  [Validator] Add the missing translations for the Arabic (ar) locale
  [Intl] Add compile binary
  Fix DebugCommand when chain loader is involved
  [Form] Fixed some phpdocs
2019-03-22 09:16:47 +01:00
Fabien Potencier
7e5dfcff7b Merge branch '3.4' into 4.2
* 3.4:
  [Phpunit] fixed support for PHP 5.3
  Response prepare method update
  [Workflow] Added missing license header
  Check if Client exists when test.client does not exist, to provide clearer exception message
  [Form] Preventing validation of children if parent with Valid constraint has no validation groups
  [Tests] fixed compatbility of assertEquals(): void
  [Intl] Fix test
  [Validator] Add the missing translations for the Arabic (ar) locale
  [Intl] Add compile binary
  [Form] Fixed some phpdocs
2019-03-22 09:16:34 +01:00
Fabien Potencier
606b8af8ec [Phpunit] fixed support for PHP 5.3 2019-03-22 09:11:54 +01:00
Fabien Potencier
7e30c971ab fixed CS 2019-03-22 07:07:54 +01:00
Kévin Dunglas
2d64e703c2
[Validator][DoctrineBridge][FWBundle] Automatic data validation 2019-03-21 13:05:54 +01:00
Yonel Ceruto
393d7280e5 Fix case when multiple loaders are providing paths for the same namespace 2019-03-20 11:45:54 -04:00
Fabien Potencier
1479a26a0b feature #28920 [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN

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

PR green and ready. From UPGRADE files:

 EventDispatcher
---------------

 * The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated

HttpKernel
----------

 * Renamed `FilterControllerArgumentsEvent` to `ControllerArgumentsEvent`
 * Renamed `FilterControllerEvent` to `ControllerEvent`
 * Renamed `FilterResponseEvent` to `ResponseEvent`
 * Renamed `GetResponseEvent` to `RequestEvent`
 * Renamed `GetResponseForControllerResultEvent` to `ViewEvent`
 * Renamed `GetResponseForExceptionEvent` to `ExceptionEvent`
 * Renamed `PostResponseEvent` to `TerminateEvent`

Security
---------

 * The `ListenerInterface` is deprecated, turn your listeners into callables instead.
 * The `Firewall::handleRequest()` method is deprecated, use `Firewall::callListeners()` instead.

Commits
-------

75369dabb8 [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN
2019-03-20 13:34:13 +01:00
Fabien Potencier
2de59a1362 bug #30440 [TwigBridge] Fix DebugCommand when chain loader is involved (yceruto)
This PR was merged into the 4.2 branch.

Discussion
----------

[TwigBridge] Fix DebugCommand when chain loader is involved

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

Better diff: https://github.com/symfony/symfony/pull/30440/files?utf8=%E2%9C%93&diff=unified&w=1

Commits
-------

f647b4a29d Fix DebugCommand when chain loader is involved
2019-03-20 09:06:40 +01:00
Christian Flothmann
f18751bd98 throw TypeErrors to prepare for type hints in 5.0 2019-03-19 22:07:50 +01:00
Kévin Dunglas
224c891e10 [FrameworkBundle] Deprecate the Templating component integration 2019-03-19 18:23:24 +01:00
Fabien Potencier
6fa4d2b0cf feature #28330 [MonologBridge] Add monolog processors adding route and command info (trakos)
This PR was squashed before being merged into the 4.3-dev branch (closes #28330).

Discussion
----------

[MonologBridge] Add monolog processors adding route and command info

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

This PR adds two simple processors that add context to every log entry.

RouteProcessor adds routing information:
`app.INFO: Some log text {"someContext":"ctx"} {"route":{"controller":"App\\Controller\\SomeController::number","route":"index","route_params":[]}`

ConsoleCommandProcessors adds current command information:
`app.INFO: Some log text {"someContext":"ctx"} {"command":{"name":"app:some-command","arguments":{"command":"app:some-command","some-argument":10}}}`

For ConsoleCommandProcessor I've decided against including command options by default, because there's a lot of default ones:
`"options":{"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":"dev","no-debug":false}`. This behavior can be changed with a constructor argument.

Commits
-------

669f6b2726 [MonologBridge] Add monolog processors adding route and command info
2019-03-17 08:08:51 +01:00
Piotr Stankowski
669f6b2726 [MonologBridge] Add monolog processors adding route and command info 2019-03-17 08:08:42 +01:00
Fabien Potencier
cbb0b81ebd feature #30339 [Monolog] Disable DebugLogger in CLI (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Monolog] Disable DebugLogger in CLI

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   |
| Fixed tickets | #30333 https://github.com/symfony/monolog-bundle/issues/165 #25876
| License       | MIT
| Doc PR        |

<details>
<summary>Considering this code:</summary>

```php
namespace App\Command;

use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class LeakCommand extends Command
{
    protected static $defaultName = 'leak';

    private $logger;

    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;

        parent::__construct();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $reportedAt = time();
        while (true) {
            $this->logger->info('Hello');

            if (time() - $reportedAt >= 1) {
                $output->writeln(sprintf('%dMb', memory_get_usage() / 1024 / 1024));
                $reportedAt = time();
            }
        }
    }
}
```

</details>

Without the patch
```
>…/dev/labs/symfony/website-skeleton(monolog %) bin/console leak
7Mb
28Mb
51Mb
76Mb
97Mb
````

With the patch
```
>…/dev/labs/symfony/website-skeleton(monolog %) bin/console leak
6Mb
6Mb
6Mb
6Mb
```

Commits
-------

17533da49c [Monolog] Disable DebugLogger in CLI
2019-03-17 07:59:53 +01:00
Nicolas Grekas
75369dabb8 [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN 2019-03-14 08:32:46 +01:00
Yonel Ceruto
f647b4a29d Fix DebugCommand when chain loader is involved 2019-03-12 11:49:41 -04:00
Nicolas Grekas
c17a5b25b5 [TwigBridge] remove deprecation triggered when using Twig 2.7 2019-03-10 18:07:42 +01:00
Nicolas Grekas
bed7694132 Merge branch '4.2'
* 4.2: (27 commits)
  cs fix
  cs fix
  [PHPUnit-Bridge] override some environment variables
  [TwigBridge] Remove use spaceless tag
  Upgrade zookeeper ext
  [translation] Update defaut format from yml to yaml
  Change default log level for output streams
  update docblock to match the actual behavior
  Don't resolve the Deprecation error handler mode until a deprecation is triggered
  compatibility with phpunit8
  Make 'headers' key optional for encoded messages
  [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
  Fix undefined variable fromConstructor when passing context to getTypes
  Added translations for chineese language.
  Allow 3rd argument to be null
  Remove whitespace (tab on blank line)
  [Monolog] Really reset logger when calling logger::reset()
  [Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method
  Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
  Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
  ...
2019-03-10 11:14:34 +01:00
Nicolas Grekas
a5951cef91 Merge branch '3.4' into 4.2
* 3.4:
  cs fix
  cs fix
  [PHPUnit-Bridge] override some environment variables
  [TwigBridge] Remove use spaceless tag
  [translation] Update defaut format from yml to yaml
  Change default log level for output streams
  update docblock to match the actual behavior
  compatibility with phpunit8
  [Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
  Added translations for chineese language.
2019-03-10 11:08:12 +01:00
Nicolas Grekas
42626744b2 bug #30496 [PHPUnit-Bridge] override some Composer environment variables (nicoweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[PHPUnit-Bridge] override some Composer environment variables

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

Override `COMPOSER_VENDOR_DIR` and `COMPOSER_BIN_DIR` with their default values in PHPUnit Bridge: #30467

Commits
-------

628502645e [PHPUnit-Bridge] override some environment variables
2019-03-10 10:59:01 +01:00
nicoweb
628502645e [PHPUnit-Bridge] override some environment variables 2019-03-10 10:48:28 +01:00
Nicolas Grekas
2ee178b5c5 [TwigBridge] Remove use spaceless tag 2019-03-10 10:14:34 +01:00
Emmanuel BORGES
f3a5b74dfd Don't resolve the Deprecation error handler mode until a deprecation is triggered 2019-03-08 18:11:28 +01:00
Oskar Stark
53c5f41f37 [Form] Allow to disable and customize PercentType symbol 2019-03-05 11:00:13 +01:00
Ken Stanley
9aeaea06fc Add ‘symbol’ option to PercentType 2019-03-05 09:34:20 +01:00
Fabien Potencier
a07627ea9a fixed tests 2019-03-02 15:55:10 +01:00
Fabien Potencier
ee787d17b4 [Mime] added classes for generating MIME messages 2019-03-02 15:10:47 +01:00
Grégoire Pineau
08a20ee0ba [Monolog] Really reset logger when calling logger::reset() 2019-02-28 18:49:31 +01:00
Fabien Potencier
d2e9a7051f feature #22048 [Security] deprecate the Role and SwitchUserRole classes (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Security] deprecate the Role and SwitchUserRole classes

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

In #20801, we deprecated the `RoleInterface`. The next logical step would be to also deprecate the `Role` class. However, we currently have the `SwitchUserRole` class (a sub-class of `Role`) that acts as an indicator to check whether or not the authenticated user switched to another user.

This PR proposes an alternative solution to the usage of the special `SwitchUserRole` class by storing the original token inside the `UsernamePasswordToken`. This PR is not complete, but rather acts as a proof of concept of how we could get rid of the `Role` and the `SwitchUserRole` classes.

Please share your opinions whether you think this is a valid approach and I will be happy to finalise the PR.

Commits
-------

d7aaa615b9 deprecate the Role and SwitchUserRole classes
2019-02-25 17:04:33 +01:00
Grégoire Pineau
17533da49c [Monolog] Disable DebugLogger in CLI 2019-02-24 14:22:28 +01:00
Nicolas Grekas
3969948cbc Merge branch '4.2'
* 4.2:
  fix merge
2019-02-23 16:42:19 +01:00
Nicolas Grekas
5b23a2b257 fix merge 2019-02-23 16:42:05 +01:00
Nicolas Grekas
a0c566504c Merge branch '4.2'
* 4.2: (26 commits)
  Apply php-cs-fixer rule for array_key_exists()
  [Cache] fix warming up cache.system and apcu
  [Security] Change FormAuthenticator if condition
  handles multi-byte characters in autocomplete
  speed up tests running them without debug flag
  [Translations] added missing Croatian validators
  Fix getItems() performance issue with RedisCluster (php-redis)
  [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
  IntegerType: reject submitted non-integer numbers
  be keen to newcomers
  [HttpKernel] Fix possible infinite loop of exceptions
  fixed CS
  [Validator] Added missing translations for Afrikaans
  do not validate non-submitted form fields in PATCH requests
  Update usage example in ArrayInput doc block.
  [Console] Prevent ArgvInput::getFirstArgument() from returning an option value
  [Validator] Fixed duplicate UUID
  fixed CS
  [EventDispatcher] Fix unknown priority
  Avoid mutating the Finder when building the iterator
  ...
2019-02-23 16:22:31 +01:00
Nicolas Grekas
87f3c36d60 Merge branch '3.4' into 4.2
* 3.4: (24 commits)
  Apply php-cs-fixer rule for array_key_exists()
  [Security] Change FormAuthenticator if condition
  handles multi-byte characters in autocomplete
  speed up tests running them without debug flag
  [Translations] added missing Croatian validators
  Fix getItems() performance issue with RedisCluster (php-redis)
  [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
  IntegerType: reject submitted non-integer numbers
  be keen to newcomers
  [HttpKernel] Fix possible infinite loop of exceptions
  fixed CS
  [Validator] Added missing translations for Afrikaans
  do not validate non-submitted form fields in PATCH requests
  Update usage example in ArrayInput doc block.
  [Console] Prevent ArgvInput::getFirstArgument() from returning an option value
  [Validator] Fixed duplicate UUID
  fixed CS
  [EventDispatcher] Fix unknown priority
  Avoid mutating the Finder when building the iterator
  [Validator] Add the missing translations for the Greek (el) locale
  ...
2019-02-23 16:17:42 +01:00
Nicolas Grekas
b0a3208588 Apply php-cs-fixer rule for array_key_exists() 2019-02-23 16:06:07 +01:00
Fabien Potencier
e9a2c3d753 feature #30345 [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler (lyrixx)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler

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

see also https://github.com/symfony/monolog-bundle/pull/297

from that:
![image](https://user-images.githubusercontent.com/408368/53246085-f63ed380-36af-11e9-9bff-2e42f8af141c.png)

to that:
![image](https://user-images.githubusercontent.com/408368/53246115-0787e000-36b0-11e9-93ef-e47ed058adbf.png)

with some configuration:

```yaml
diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml
index b1998da..66ae2db 100644
--- a/config/packages/dev/monolog.yaml
+++ b/config/packages/dev/monolog.yaml
@@ -17,3 +17,6 @@ monolog:
             type: console
             process_psr_3_messages: false
             channels: ["!event", "!doctrine", "!console"]
+            console_formater_options:
+                format: "%%datetime%% %%start_tag%%%%level_name%%%%end_tag%% <comment>[%%channel%%]</> %%message%%%%context%%\n"
+                multiline: false
```

Commits
-------

5e494db04c [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler
2019-02-23 11:19:35 +01:00
Christian Flothmann
057d177378 rename parent_form() to form_parent()
We got some feedback on the blog post that form_parent() would be better
for consistency with all the existing form_*() functions. I think that
user has a point about that.
2019-02-23 10:52:13 +01:00
Christian Flothmann
d7aaa615b9 deprecate the Role and SwitchUserRole classes 2019-02-23 00:57:00 +01:00
Oskar Stark
c008ee046a be keen to newcomers 2019-02-22 15:44:53 +01:00
Grégoire Pineau
5e494db04c [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler 2019-02-22 14:32:09 +01:00
Fabien Potencier
6207f19317 feature #30267 [Form] add option to render NumberType as type="number" (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] add option to render NumberType as type="number"

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

Commits
-------

42e8f5e3a2 add option to render NumberType as type="number"
2019-02-21 09:19:09 +01:00
Christian Flothmann
42e8f5e3a2 add option to render NumberType as type="number" 2019-02-21 08:09:42 +01:00
Nicolas Grekas
374c8b0063 Merge branch '4.2'
* 4.2:
  [Console] Fix command testing with missing inputs
  [Validator] Sync no/nb translation files
  [Translation] Added a script to display the status of translations
  [Validator] Added missing translations for Norwegian (\"no\") locale #30179
  [Security\Guard] bump lowest version of security-core
  [TwigBridge] Fix test
  Remove unnecessary ProgressBar stdout writes (fixes flickering)
  [Validator] improve translations for albanian ("sq") locale
  [VarDumper] fix serializing Stub instances
  [Validator] Added missing use statement for UnexpectedTypeException
  Don't resolve the Deprecation error handler mode until a deprecation is triggered
  bug #30245 fix lost namespace in eval (fizzka)
  fix lost namespace in eval
  [Twig] removed usage of non-namespaced classes
  added missing dot
  Update validators.lt.xlf
  #30172 Add the missing validation translations for the Luxembourgish …
  [Debug][ErrorHandler] Preserve next error handler
2019-02-19 19:29:52 +01:00
Fabien Potencier
caa2579e0a Merge branch '3.4' into 4.2
* 3.4:
  [TwigBridge] Fix test
  Remove unnecessary ProgressBar stdout writes (fixes flickering)
  [Validator] improve translations for albanian ("sq") locale
  [VarDumper] fix serializing Stub instances
  Don't resolve the Deprecation error handler mode until a deprecation is triggered
  bug #30245 fix lost namespace in eval (fizzka)
  [Twig] removed usage of non-namespaced classes
  added missing dot
  Update validators.lt.xlf
  #30172 Add the missing validation translations for the Luxembourgish …
  [Debug][ErrorHandler] Preserve next error handler
2019-02-18 07:49:49 +01:00
Robin Chalas
ad752b1a48 [TwigBridge] Fix test 2019-02-17 19:45:33 +01:00
Nicolas Grekas
eb3299341f bug #30247 Don't resolve the Deprecation error handler mode until a deprecation is triggered (ossinkine)
This PR was merged into the 3.4 branch.

Discussion
----------

Don't resolve the Deprecation error handler mode until a deprecation is triggered

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

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->
If an error happens before `.env.test` is loaded the mode is set to 0 and cached so SYMFONY_DEPRECATIONS_HELPER is not read from `.env.test`.

Commits
-------

1090b8cb6e Don't resolve the Deprecation error handler mode until a deprecation is triggered
2019-02-16 19:51:27 +01:00
Gocha Ossinkine
1090b8cb6e Don't resolve the Deprecation error handler mode until a deprecation is triggered 2019-02-16 19:50:26 +01:00
Fabien Potencier
5a154538c7 minor #30233 [Twig] removed usage of non-namespaced classes (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[Twig] removed usage of non-namespaced classes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to 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

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

bd719cd7e1 [Twig] removed usage of non-namespaced classes
2019-02-16 12:52:47 +01:00
Fabien Potencier
bd719cd7e1 [Twig] removed usage of non-namespaced classes 2019-02-16 12:50:39 +01:00
Christian Flothmann
346491c672 Merge branch '4.2'
* 4.2:
  fix tests by adapting Twig namespace changes
2019-02-15 19:54:52 +01:00
Christian Flothmann
348193609f Merge branch '3.4' into 4.2
* 3.4:
  fix tests by adapting Twig namespace changes
2019-02-15 19:54:27 +01:00
Christian Flothmann
bbc2656619 fix tests by adapting Twig namespace changes 2019-02-15 18:05:19 +01:00
Christian Flothmann
d42e054d2c (finally) fix version dependent Form tests 2019-02-14 17:03:15 +01:00
Christian Flothmann
b09761778a Merge branch '4.2'
* 4.2:
  allow to skip tests based on the supported version
  Update validators.bg.xlf
  Update validators.ca.xlf
  fixed CS
  Updated validators.eu.xlf with missing translations
  fixed typo
  backported a translation
  [Validator] added missing translation for UK validator
  Validator: add the Persian translations
  Update validators.sq.xlf
  fixed CS
  forward valid numeric values to transform()
  add constraint validators before optimizations
2019-02-14 16:32:59 +01:00
Christian Flothmann
c58d4c2e22 Merge branch '3.4' into 4.2
* 3.4:
  allow to skip tests based on the supported version
  Update validators.bg.xlf
  Update validators.ca.xlf
  fixed CS
  Updated validators.eu.xlf with missing translations
  fixed typo
  backported a translation
  [Validator] added missing translation for UK validator
  Validator: add the Persian translations
  Update validators.sq.xlf
  fixed CS
  forward valid numeric values to transform()
  add constraint validators before optimizations
2019-02-14 16:32:36 +01:00
Christian Flothmann
be23926bf8 allow to skip tests based on the supported version
Writing tests for Form related features in the Doctrine and Twig bridges
as well as the FrameworkBundle is a pain as soon as these tests are run
with more recent versions of the Form component. This is due to the fact
that our tests in the bridges and bundle extend test cases from the
component. The tests in the component are expanded with every feature
that gets added there. However, these new features are not present in
the other packages in older version and we thus need to be able to skip
them somehow.
2019-02-14 15:58:36 +01:00
Christian Flothmann
6bfc5f0901 properly move test methods 2019-02-14 10:58:14 +01:00
Christian Flothmann
1fe359995b fix tests 2019-02-13 22:52:06 +01:00
Fabien Potencier
c6a2c3348f feature #28812 [Form] add a convenience method to get the parent form in Twig templates (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] add a convenience method to get the parent form in Twig templates

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

Commits
-------

cb60642d15 add a convenience method to get the parent form in Twig templates
2019-02-13 08:55:41 +01:00
Fabien Potencier
09275d4e27 feature #28635 [Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type (webnet-fr)
This PR was squashed before being merged into the 4.3-dev branch (closes #28635).

Discussion
----------

[Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes. Travis-ci isn't green because it tests the components separately. Fabbot.io requires license headers in files where they were not present before.
| Fixed tickets | #27698
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/10065

Hi, this is an alternative to #27775.

`translation_parameters` is separated to `label_translation_parameters`, `help_translation_parameters`, `attr_translation_parameters`.

Commits
-------

b3f3c5361f [Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type
2019-02-13 08:24:11 +01:00
Webnet team
b3f3c5361f [Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type 2019-02-13 08:24:03 +01:00
Fabien Potencier
3c2dc44af6 Merge branch '4.2'
* 4.2: (25 commits)
  Add missing ID_id validators translation
  fixed CS
  Added missing translations in validators.tr.xlf
  Update validators.es.xlf
  Update validators.hu.xlf
  [Validator] Add the missing translations for the Welsh (cy) locale
  [Validator] Add missing DE validator translations
  [Validator] Add the missing translations for the Dutch (nl) locale
  Add missing PL translation
  Add missing translations.
  Add missing translations for IT to Validator
  minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
  [Validator] Add the missing translations for the Arabic (ar) locale
  add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
  [Validator] Add the missing translations for the French (fr) locale
  [Validator] Add some missing contents to the English translation
  use PropertyAccessorInterface instead of PropertyAccessor
  Fix KernelTestCase compatibility for PhpUnit 8 (bis)
  add xabbuh as code owner of the Form component
  [Validator] Added a missing translation
  ...
2019-02-12 21:07:40 +01:00
Fabien Potencier
1614a52b28 Merge branch '3.4' into 4.2
* 3.4: (25 commits)
  Add missing ID_id validators translation
  fixed CS
  Added missing translations in validators.tr.xlf
  Update validators.es.xlf
  Update validators.hu.xlf
  [Validator] Add the missing translations for the Welsh (cy) locale
  [Validator] Add missing DE validator translations
  [Validator] Add the missing translations for the Dutch (nl) locale
  Add missing PL translation
  Add missing translations.
  Add missing translations for IT to Validator
  minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
  [Validator] Add the missing translations for the Arabic (ar) locale
  add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
  [Validator] Add the missing translations for the French (fr) locale
  [Validator] Add some missing contents to the English translation
  use PropertyAccessorInterface instead of PropertyAccessor
  Fix KernelTestCase compatibility for PhpUnit 8 (bis)
  add xabbuh as code owner of the Form component
  [Validator] Added a missing translation
  ...
2019-02-12 21:06:11 +01:00
Patrick Landolt
bb4b53bc45
Update composer.json 2019-02-11 18:30:33 +01:00
Nicolas Grekas
41cc6d2676 Merge branch '4.2'
* 4.2:
  New extensions were released supporting PHP 7.3
  Remove "internal" annotation from datacollector serialization methods
  replace mocks with real objects in tests
  [DependencyInjection] fix #29930 add $lazyLoad flag to the generated factory code for lazy non-shared services
  escape function does not always take a string
  Fix phpunit 8 compatibility
  render integer types with grouping as text input
  ignore _method forms in NativeRequestHandler
  don't lose int precision with not needed type casts
2019-02-08 14:07:06 +01:00
Nicolas Grekas
17ac014306 Merge branch '3.4' into 4.2
* 3.4:
  Remove "internal" annotation from datacollector serialization methods
  replace mocks with real objects in tests
  Fix phpunit 8 compatibility
  render integer types with grouping as text input
  ignore _method forms in NativeRequestHandler
  don't lose int precision with not needed type casts
2019-02-08 14:06:27 +01:00
Nicolas Grekas
f331c54dbc bug #30061 [Form] render integer types with grouping as text input (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] render integer types with grouping as text input

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

Commits
-------

d6a5fde521 render integer types with grouping as text input
2019-02-08 13:13:01 +01:00
Nicolas Grekas
b45cbf6e9e [PhpUnitBridge] fix PHP 5.3 compat 2019-02-06 09:03:17 +01:00
Christian Flothmann
d6a5fde521 render integer types with grouping as text input 2019-02-04 20:23:31 +01:00
Alexander M. Turek
8b330de7f7 PHPUnit Bridge: Rollback to traditional array syntax. 2019-01-30 14:30:37 +01:00
Nicolas Grekas
32aa969dff Merge branch '4.2'
* 4.2:
  [Routing] dont redirect routes with greedy trailing vars with no explicit slash
  skip native serialize among child and parent serializable objects
  [Routing] backport tests from 4.1
  [MonologBridge] Remove unused local variable
  Remove unreachable code
  Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
  Support use of hyphen in asset package name
  Fix format strings for deprecation notices
  Remove a harmless duplicate array key from VarDumper
  [VarDumper] Fixed search bar
  Remove gendered pronouns
  Replace gender by eye color in tests
  [Security] dont do nested calls to serialize()
2019-01-29 10:50:57 +01:00
Nicolas Grekas
adbdec838a Merge branch '4.1' into 4.2
* 4.1:
  [Routing] dont redirect routes with greedy trailing vars with no explicit slash
  skip native serialize among child and parent serializable objects
  [Routing] backport tests from 4.1
  [MonologBridge] Remove unused local variable
  Remove unreachable code
  Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
  Support use of hyphen in asset package name
  Remove gendered pronouns
  Replace gender by eye color in tests
  [Security] dont do nested calls to serialize()
2019-01-29 10:49:29 +01:00
Samuel NELA
5580473740 [MonologBridge] Remove unused local variable 2019-01-28 21:24:44 +01:00
Nicolas Grekas
98bc3e7917 minor #29724 [PHPUnitBridge] Static access in closure (greg0ire, nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PHPUnitBridge] Static access in closure

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

#29718 bumps php to 5.5 . This is what we could simplify if it gets merged, thanks to this "new" PHP feature: https://3v4l.org/sJOWr

EDIT: it was merged, this can be reviewed.

Commits
-------

97f3023963 Use the scope of an instance
9df76ebbe5 Extract closures into static functions
2019-01-27 19:07:22 +01:00
Nicolas Grekas
97f3023963 Use the scope of an instance 2019-01-27 19:04:53 +01:00
Grégoire Paris
9df76ebbe5
Extract closures into static functions 2019-01-27 18:08:35 +01:00
Nicolas Grekas
f4682c3ab9 feature #28721 [Form] deprecate some options for single_text widgets (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] deprecate some options for single_text widgets

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

Commits
-------

89ff331865 deprecate some options for single_text widgets
2019-01-27 15:37:17 +01:00
Christian Flothmann
aa354cef57 remove accidentally added changelog entries
The `help_html` option is neither part of the Twig bridge nor of the
FrameworkBundle. It is provided by the Form component.
2019-01-27 10:18:12 +01:00
Nicolas Grekas
0f947130f2 Merge branch '4.1' into 4.2
* 4.1:
  fix merge
2019-01-25 16:37:00 +01:00
Nicolas Grekas
23e9985ee0 fix merge 2019-01-25 16:35:59 +01:00
Nicolas Grekas
4edfbb5975 Merge branch '4.2'
* 4.2:
  [HttpFoundation] Check file exists before unlink
  [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0'
  [Cache] PDO-based cache pool table autocreation does not work
  [Translation] Concatenated translation messages
  [Form] ensure compatibility with older PHPUnit mocks
  [Serializer] Docblock about throwing exceptions on serializer
  [Cache] fix used variable name
  [Debug][ErrorHandler] Preserve our error handler when a logger set another one
  [Form] Changed UrlType input type to text when default_protocol is not null
  [Bugfix] MemcachedSessionHandler::close() must close connection
  Always pass $key to NullAdapter->createCacheItem
2019-01-25 15:35:46 +01:00
Nicolas Grekas
62c595a649 Merge branch '4.1' into 4.2
* 4.1:
  [HttpFoundation] Check file exists before unlink
  [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0'
  [Translation] Concatenated translation messages
  [Form] ensure compatibility with older PHPUnit mocks
  [Serializer] Docblock about throwing exceptions on serializer
  [Debug][ErrorHandler] Preserve our error handler when a logger set another one
  [Form] Changed UrlType input type to text when default_protocol is not null
  [Bugfix] MemcachedSessionHandler::close() must close connection
2019-01-25 15:35:16 +01:00
Nicolas Grekas
02fe23d064 Merge branch '3.4' into 4.1
* 3.4:
  [HttpFoundation] Check file exists before unlink
  [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0'
  [Translation] Concatenated translation messages
  [Form] ensure compatibility with older PHPUnit mocks
  [Serializer] Docblock about throwing exceptions on serializer
  [Debug][ErrorHandler] Preserve our error handler when a logger set another one
  [Form] Changed UrlType input type to text when default_protocol is not null
  [Bugfix] MemcachedSessionHandler::close() must close connection
2019-01-25 15:34:37 +01:00
Mathieu Piot
33f5f855d6 [Form][TwigBridge] Add help_html option 2019-01-25 11:36:18 +01:00
Nicolas Grekas
e3b010fe16 bug #29926 [Form] Changed UrlType input type to text when default_protocol is not null (MatTheCat)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Changed UrlType input type to text when default_protocol is not null

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

replaces #29691

Commits
-------

2791edf1fb [Form] Changed UrlType input type to text when default_protocol is not null
2019-01-25 11:08:56 +01:00
Nicolas Grekas
d8af8b6edd Merge branch '4.2'
* 4.2:
  Bump phpunit bridge cache id
  [appveyor] fix create-project phpunit
  Fix HttpKernel Debug requirement
  Fix heredoc
  use final annotation to allow mocking the class
  synchronise the form builder docblock
  Grammar fix in exception message
  fix tests
  forward the parse error to the calling code
  Avoid dots in generated class names.
  [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
  ensure compatibility with older PHPUnit mocks
  [Security] Do not mix usage of password_*() functions and sodium_*() ones
2019-01-24 22:40:22 +01:00
Nicolas Grekas
61bf16c71d Merge branch '4.1' into 4.2
* 4.1:
  Bump phpunit bridge cache id
  [appveyor] fix create-project phpunit
  Fix HttpKernel Debug requirement
  Fix heredoc
  use final annotation to allow mocking the class
  synchronise the form builder docblock
  Grammar fix in exception message
  fix tests
  forward the parse error to the calling code
  [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
  ensure compatibility with older PHPUnit mocks
  [Security] Do not mix usage of password_*() functions and sodium_*() ones
2019-01-24 22:39:51 +01:00
Nicolas Grekas
aff17e2cc4 Merge branch '3.4' into 4.1
* 3.4:
  Bump phpunit bridge cache id
  [appveyor] fix create-project phpunit
  Fix HttpKernel Debug requirement
  Fix heredoc
  use final annotation to allow mocking the class
  synchronise the form builder docblock
  Grammar fix in exception message
  fix tests
  forward the parse error to the calling code
  [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
  ensure compatibility with older PHPUnit mocks
  [Security] Do not mix usage of password_*() functions and sodium_*() ones
2019-01-24 22:39:39 +01:00
Nicolas Grekas
aad0c58d6c [appveyor] fix create-project phpunit 2019-01-24 22:26:46 +01:00
Christian Flothmann
419d3db86c synchronise the form builder docblock 2019-01-22 15:49:00 +01:00
Mathieu Lechat
2791edf1fb [Form] Changed UrlType input type to text when default_protocol is not null 2019-01-18 10:39:23 +01:00
Christian Flothmann
89ff331865 deprecate some options for single_text widgets 2019-01-17 00:04:01 +01:00
Christian Flothmann
cb60642d15 add a convenience method to get the parent form in Twig templates 2019-01-17 00:02:21 +01:00
Fabien Potencier
18b9e45f4a fixed CS 2019-01-16 22:53:45 +01:00
Fabien Potencier
51a359c079 Merge branch '4.2' into short-array-master
* 4.2:
  fixed CS
  fixed CS
  fixed tests
  fixed CS
  fixed CS
  fixed CS
  fixed short array CS in comments
  fixed CS in ExpressionLanguage fixtures
  fixed CS in generated files
  fixed CS on generated container files
  fixed CS on Form PHP templates
  fixed CS on YAML fixtures
  fixed fixtures
  switched array() to []
2019-01-16 22:53:39 +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
Fabien Potencier
c0323bd24b Merge branch '4.1' into 4.2
* 4.1:
  fixed tests
  fixed CS
  fixed CS
  fixed CS
  fixed short array CS in comments
  fixed CS in ExpressionLanguage fixtures
  fixed CS in generated files
  fixed CS on generated container files
  fixed CS on Form PHP templates
  fixed CS on YAML fixtures
  fixed fixtures
  switched array() to []
2019-01-16 21:31:39 +01:00
Fabien Potencier
44056b002a fixed CS 2019-01-16 20:07:26 +01:00
Fabien Potencier
d58b5c3b76 fixed CS 2019-01-16 19:35:49 +01:00
Fabien Potencier
572864b223 Merge branch '3.4' into 4.1
* 3.4:
  fixed CS
  fixed short array CS in comments
  fixed CS in ExpressionLanguage fixtures
  fixed CS in generated files
  fixed CS on generated container files
  fixed CS on Form PHP templates
  fixed CS on YAML fixtures
  fixed fixtures
  switched array() to []
2019-01-16 19:21:11 +01:00
Fabien Potencier
37ab4cd056 fixed CS 2019-01-16 14:43:35 +01:00
Fabien Potencier
1429267f9c fixed short array CS in comments 2019-01-16 14:27:11 +01:00
Fabien Potencier
ec7dcb2784 fixed CS in generated files 2019-01-16 13:48:01 +01:00
Fabien Potencier
33a001e460 switched array() to [] 2019-01-16 10:39:14 +01:00
Fabien Potencier
1aecafc442 Merge branch '4.2'
* 4.2:
  the string "0" is a valid service identifier
  remove unreachable code
2019-01-16 10:27:39 +01:00
Fabien Potencier
cf8cc199fb Merge branch '4.1' into 4.2
* 4.1:
  the string "0" is a valid service identifier
  remove unreachable code
  updated MimeType extensions
2019-01-16 10:27:29 +01:00
Fabien Potencier
55c871d56a Merge branch '3.4' into 4.1
* 3.4:
  the string "0" is a valid service identifier
  remove unreachable code
  updated MimeType extensions
2019-01-16 10:27:19 +01:00
Fabien Potencier
eb75781ccd simplified PHPUnit exception expectations 2019-01-16 07:59:14 +01:00
Christian Flothmann
16f97b9769 remove unreachable code
Since our version constraint is `^1.37.1|^2.6.2` any Twig version that
is below 2.4.5 must be a Twig 1.x release.
2019-01-15 14:09:02 +01:00
Fabien Potencier
508602d995 Merge branch '4.2'
* 4.2:
  bump required Twig version
  fix compatibility with Twig >= 2.6.1
  [Form] SA fix
  fix compatibility with PHPUnit 4.8
  remove return type hint for PHP 5 compatibility
  SCA: minor code tweaks
  Component CssSelector tests
  [DebugClassLoader] Readd findFile() method
  [Console] Fix composer.json suggest/provide
  Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
  Fixed exception wording
  Fix SwiftMailerHandler to support Monolog's latest reset functionality
2019-01-14 16:34:34 +01:00
Fabien Potencier
6d37740cfd Merge branch '4.1' into 4.2
* 4.1:
  bump required Twig version
  fix compatibility with Twig >= 2.6.1
  [Form] SA fix
  fix compatibility with PHPUnit 4.8
  remove return type hint for PHP 5 compatibility
  SCA: minor code tweaks
  Component CssSelector tests
  [DebugClassLoader] Readd findFile() method
  [Console] Fix composer.json suggest/provide
  Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
  Fixed exception wording
  Fix SwiftMailerHandler to support Monolog's latest reset functionality
2019-01-14 16:33:52 +01:00
Fabien Potencier
175f6b5a84 Merge branch '3.4' into 4.1
* 3.4:
  bump required Twig version
2019-01-14 16:30:23 +01:00
Christian Flothmann
37e8ccba0f bump required Twig version 2019-01-14 16:05:06 +01:00
Christian Flothmann
00b73da791 Merge branch '3.4' into 4.1
* 3.4:
  fix compatibility with Twig >= 2.6.1
  [Form] SA fix
  fix compatibility with PHPUnit 4.8
  remove return type hint for PHP 5 compatibility
  Component CssSelector tests
  [DebugClassLoader] Readd findFile() method
  [Console] Fix composer.json suggest/provide
  Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
  Fixed exception wording
  Fix SwiftMailerHandler to support Monolog's latest reset functionality
2019-01-14 12:04:47 +01:00
Christian Flothmann
40089fb28f fix compatibility with Twig >= 2.6.1 2019-01-14 11:10:57 +01:00
Fabien Potencier
3ea4901516 bug #29837 Fix SwiftMailerHandler to support Monolog's latest reset functionality (Seldaek)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix SwiftMailerHandler to support Monolog's latest reset functionality

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

Monolog 1.24 added the ResettableInterface which is meant to support resetting handlers. Reset should also flush as if the request was ending, and it can be used for long running workers for example in between each job that is processed. Due to SwiftMailer's spool however the emails in case of errors are right now only sent at the very end of the worker's lifetime.

For older Monolog versions, this will be ignored, and is thus harmless.

Commits
-------

ada2d83b67 Fix SwiftMailerHandler to support Monolog's latest reset functionality
2019-01-13 17:54:10 +01:00
Christian Flothmann
4d21ab4e7b Merge branch '4.2'
* 4.2:
  account for the short array syntax in Twig
2019-01-11 15:23:08 +01:00
Christian Flothmann
2dddea4d0d Merge branch '4.1' into 4.2
* 4.1:
  account for the short array syntax in Twig
2019-01-11 15:22:29 +01:00
Christian Flothmann
c325155e10 Merge branch '3.4' into 4.1
* 3.4:
  account for the short array syntax in Twig
2019-01-11 15:09:01 +01:00
Jordi Boggiano
ada2d83b67
Fix SwiftMailerHandler to support Monolog's latest reset functionality 2019-01-10 16:10:12 +01:00
Christian Flothmann
59a4dc609d account for the short array syntax in Twig 2019-01-10 09:15:17 +01:00
Christian Flothmann
3860d685f4 Merge branch '4.2'
* 4.2:
  update years in license files
  Fix: Adjust DocBlock
  \"ParserTest->getParserTestData()\" -> only some more tests
  access the container getting it from the kernel
  Replace slave and master by replica and primary
  Fix erasing cookies issue
  [Lock] Pedantic improvements for lock
  [EventDispatcher] Fixed phpdoc on interface
  update year in license files
  [VarExporter] fix exporting array indexes
  [SecurityBundle] Fix traceable voters
  [Console] Fix help text for single command applications
  Fix random test failure on lock
  improve error message when using test client without the BrowserKit component
  Fixed minor typos in an error message
  [Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
  Fixed minor typos
  Fix: Method can also return null
  [Stopwatch] Fixed phpdoc for category name
2019-01-03 10:16:58 +01:00
Christian Flothmann
3007e36a5c Merge branch '4.1' into 4.2
* 4.1:
  Fix: Adjust DocBlock
  \"ParserTest->getParserTestData()\" -> only some more tests
  access the container getting it from the kernel
  [Lock] Pedantic improvements for lock
  [EventDispatcher] Fixed phpdoc on interface
  update year in license files
  [Console] Fix help text for single command applications
  Fix random test failure on lock
  improve error message when using test client without the BrowserKit component
  [Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
  Fixed minor typos
  Fix: Method can also return null
  [Stopwatch] Fixed phpdoc for category name
2019-01-03 10:07:35 +01:00
Christian Flothmann
4973a5e9e1 Merge branch '3.4' into 4.1
* 3.4:
  Fix: Adjust DocBlock
  \"ParserTest->getParserTestData()\" -> only some more tests
  [Lock] Pedantic improvements for lock
  [EventDispatcher] Fixed phpdoc on interface
  update year in license files
  [Console] Fix help text for single command applications
  Fix random test failure on lock
  improve error message when using test client without the BrowserKit component
  [Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
  Fixed minor typos
  Fix: Method can also return null
  [Stopwatch] Fixed phpdoc for category name
2019-01-03 10:05:57 +01:00
George Mponos
59313095d3 [PHPUnit bridge] Bump php version of PHPUnit-bridge 2019-01-01 19:13:57 +01:00
Christian Flothmann
6c895b9757 update year in license files 2019-01-01 14:45:19 +01:00
Javier Eguiluz
9b400bc720 Fixed minor typos 2018-12-28 12:28:01 +01:00
Nicolas Grekas
edb12b48c7 Merge branch '4.2'
* 4.2:
  [Twig] Remove spaces to fix whitespace in tags
  [Twig] Replace for-loops with blocks for attributes
  fixed CS
  [Tests] Change to willThrowException
  [Console] fix PHPDoc in Command
  Update FileLoaderLoadException.php
  Fix wrong calls to clearstatcache
  Add Vietnamese translation for validators
  Allow running PHPUnit with "xdebug.scream" ON
  [VarDumper] Add descriptors tests
  [Cache] fix bad optim
  [Yaml] detect circular references
  [DI] fix reporting bindings on overriden services as unused
  [Routing] minor fix or previous PR
2018-12-24 11:03:37 +01:00
Nicolas Grekas
8943f20770 minor #29636 [Twig] Remove spaces to fix whitespace in tags (royklutman)
This PR was squashed before being merged into the 4.2 branch (closes #29636).

Discussion
----------

[Twig] Remove spaces to fix whitespace in tags

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| License       | MIT

`form_help` tags in forms have double spaces between its `id` als `class` attributes.

Fixed this by removing unnecessary spaces.

This issue was introduced in `4.2`.

Commits
-------

82acc89840 [Twig] Remove spaces to fix whitespace in tags
2018-12-24 11:02:30 +01:00
Roy Klutman
82acc89840 [Twig] Remove spaces to fix whitespace in tags 2018-12-24 11:02:23 +01:00
Nicolas Grekas
5ee0c04fd7 Merge branch '4.1' into 4.2
* 4.1:
  [Twig] Replace for-loops with blocks for attributes
  fixed CS
  [Tests] Change to willThrowException
  [Console] fix PHPDoc in Command
  Update FileLoaderLoadException.php
  Fix wrong calls to clearstatcache
  Add Vietnamese translation for validators
  Allow running PHPUnit with "xdebug.scream" ON
  [VarDumper] Add descriptors tests
  [Yaml] detect circular references
  [DI] fix reporting bindings on overriden services as unused
  [Routing] minor fix or previous PR
2018-12-24 11:01:29 +01:00
Nicolas Grekas
ed1500fb4b Merge branch '3.4' into 4.1
* 3.4:
  [Twig] Replace for-loops with blocks for attributes
  [DI] fix reporting bindings on overriden services as unused
2018-12-24 10:43:03 +01:00
Roy Klutman
0cd8088a6d [Twig] Replace for-loops with blocks for attributes 2018-12-24 10:23:42 +01:00
Nicolas Grekas
df4ad4e7d4 Merge branch '4.2'
* 4.2: (27 commits)
  [VarExporter] dont call userland code with uninitialized objects
  Fix typos in doc blocks
  [Debug] ignore underscore vs backslash namespaces in DebugClassLoader
  [TwigBridge][Form] Prevent multiple rendering of form collection prototypes
  [FrameworkBundle] fix describing routes with no controllers
  [DI] move RegisterServiceSubscribersPass before DecoratorServicePass
  Update ValidationListener.php
  [Yaml] ensures that the mb_internal_encoding is reset to its initial value
  [Messenger] Restore message handlers laziness
  [WebLink] Fixed documentation link
  [Security] getTargetPath of TargetPathTrait must return string or null
  [Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument
  Optimize perf by replacing call_user_func with dynamic vars
  [Cache] Fix dsn parsing
  [Routing] fix dumping same-path routes with placeholders
  [WebProfilerBundle][TwigBundle] CSS fixes
  Add a docblock for FormFactoryInterface
  [Security] defer log message in guard authenticator
  [Validator] Added IBAN format for Vatican City State
  merge conflicts
  ...
2018-12-13 13:43:21 +01:00
Nicolas Grekas
b88728a13a Merge branch '4.1' into 4.2
* 4.1:
  Fix typos in doc blocks
  [Debug] ignore underscore vs backslash namespaces in DebugClassLoader
  [TwigBridge][Form] Prevent multiple rendering of form collection prototypes
  [FrameworkBundle] fix describing routes with no controllers
  [DI] move RegisterServiceSubscribersPass before DecoratorServicePass
  Update ValidationListener.php
  [Yaml] ensures that the mb_internal_encoding is reset to its initial value
  [WebLink] Fixed documentation link
  [Security] getTargetPath of TargetPathTrait must return string or null
  [Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument
  Optimize perf by replacing call_user_func with dynamic vars
  [Routing] fix dumping same-path routes with placeholders
  [Security] defer log message in guard authenticator
  [Validator] Added IBAN format for Vatican City State
  merge conflicts
  filter out invalid Intl values
  filter out invalid language values
  [Validator] Fixed grouped composite constraints
  [Form] Filter arrays out of scalar form types
  Fix HeaderBag::get phpdoc
2018-12-13 13:39:50 +01:00
Nicolas Grekas
547bf26eee Merge branch '3.4' into 4.1
* 3.4:
  [Debug] ignore underscore vs backslash namespaces in DebugClassLoader
  [TwigBridge][Form] Prevent multiple rendering of form collection prototypes
  [FrameworkBundle] fix describing routes with no controllers
  [DI] move RegisterServiceSubscribersPass before DecoratorServicePass
  Update ValidationListener.php
  [Yaml] ensures that the mb_internal_encoding is reset to its initial value
  [WebLink] Fixed documentation link
  [Security] getTargetPath of TargetPathTrait must return string or null
  [Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument
  [Security] defer log message in guard authenticator
  merge conflicts
  Fix HeaderBag::get phpdoc
2018-12-13 13:30:33 +01:00
Thomas Baumgartner
ffd272243b [TwigBridge][Form] Prevent multiple rendering of form collection prototypes 2018-12-12 18:31:24 +01:00
Fabien Potencier
a9694f7022 feature #28931 [PhpUnitBridge] Added ClassExistsMock (ro0NL)
This PR was squashed before being merged into the 4.3-dev branch (closes #28931).

Discussion
----------

[PhpUnitBridge] Added ClassExistsMock

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/10528

I've thought about this before, and bumped into it again when trying to test #28898

This PR allows to mock `class|interface|trait_exists` to enable specific code path testing

Commits
-------

62caec1a79 [PhpUnitBridge] Added ClassExistsMock
2018-12-10 05:16:00 +01:00
Roland Franssen
62caec1a79 [PhpUnitBridge] Added ClassExistsMock 2018-12-10 05:15:53 +01:00
Gabriel Ostrolucký
0c6ef01713 Optimize perf by replacing call_user_func with dynamic vars 2018-12-09 23:58:21 +01:00
Vlad Gregurco
30609bfa70 [PhpUnitBridge] install PHPUnit 7 on PHP 7.1 and fix require for PHPUnit 6 2018-12-08 17:47:06 +02:00
Nicolas Grekas
e6fa538387 Merge branch '4.2'
* 4.2:
  [TwigBridge] Deprecating legacy Twig paths in DebugCommand and simplifications
  [Cache] Fixed Memcached adapter doClear()to call flush()
  Fixes sprintf(): Too few arguments in Translator
  fix TransChoiceTokenParser deprecation message
  [DoctrineBridge] Conflict with Messenger <4.2
  [Contracts] extract LocaleAwareInterface out of TranslatorInterface
2018-12-06 11:00:21 +00:00