Commit Graph

45034 Commits

Author SHA1 Message Date
Nicolas Grekas 13dd18c8a6 feature #31587 [Routing][Config] Allow patterns of resources to be excluded from config loading (tristanbes)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing][Config] Allow patterns of resources to be excluded from config loading

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

The PR will fix the following RFC: #31516

Like resource loading for services, this PR offers a way to exclude patterns of resources like:

```yml
// config/routes/annotations.yaml
controllers:
    resource: ../../src/Controller/*
    type: annotation
    exclude: '../src/Controller/{DebugEmailController}.php'
```

All the annotation routes inside `Controller/` will be loaded in this example except all the one present inside the `Controller/DebugEmailController.php`

Commits
-------

332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading
2019-11-04 11:53:20 +01:00
Nicolas Grekas 29fd51f272 feature #32256 [DI] Add compiler pass and command to check that services wiring matches type declarations (alcalyn, GuilhemN, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Add compiler pass and command to check that services wiring matches type declarations

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

PR replacing https://github.com/symfony/symfony/pull/27825.

It adds a `lint:container` command asserting the type hints used in your code are correct.

Commits
-------

8230a1543e Make it really work on real apps
4b3e9d4c96 Fix comments, improve the feature
a6292b917b [DI] Add compiler pass to check arguments type hint
2019-11-04 11:27:29 +01:00
Fabien Potencier 08a218c79f bug #34218 [Security] Fix SwitchUserToken wrongly deauthenticated (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fix SwitchUserToken wrongly deauthenticated

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

Commits
-------

e47b31c43c [Security] Fix SwitchUserToken wrongly deauthenticated
2019-11-03 13:01:14 +01:00
Fabien Potencier 0c784d2879 feature #32061 Add new Form WeekType (dFayet)
This PR was merged into the 4.4 branch.

Discussion
----------

Add new Form WeekType

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

----
#### Update

After the first try, I've updated the field to have more options, and be more "straight".
The field acts like the `DateTimeType` or `TimeType`,  various fields type (pure text, html5 type, select boxes), data validation, ....

For that I took the choice to update the `DateTimeToStringTransformer` and `DateTimeToArrayTransformer` to make them work with weeks format.

I was not sure if it was better to update them or create new ones, WDYT?

Before addind tests and docs, it would be nice to have your first thoughts/comments 😊

Do you need/want a small test repo?

Commits
-------

c4a2f026e0 Add new Form WeekType
2019-11-03 12:59:10 +01:00
Fabien Potencier ef66ad3890 feature #33954 Form theme: support Bootstrap 4 custom switches (romaricdrigon)
This PR was merged into the 4.4 branch.

Discussion
----------

Form theme: support Bootstrap 4 custom switches

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | /
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12464

Hello,

At the moment, Symfony form theme supports [custom checkboxes](https://getbootstrap.com/docs/4.3/components/forms/#checkboxes) through an extra class in `label_attr`.
Bootstrap4 introduced also [custom switches](https://getbootstrap.com/docs/4.3/components/forms/#switches), which has exactly the same HTML markup, but use a different class. This PR slightly modify `bootstrap_4_layout` to handle it.

![image](https://user-images.githubusercontent.com/919405/66651725-0eaa3100-ec34-11e9-8b68-94324730ac80.png)

Some reasons why I think supporting those have its place in Symfony:
 - those are getting common in UI right now, it is a common use case
 - it is complementary to normal checkboxes, and works the same way: required attribute, validation error, and so on are supported immediately
 - implementing it yourself in your form theme is actually tricky, because of the way checkbox are handled (ie., `form_label` called inside `form_widget` with a `{ widget: parent() }`). You have to overwrite the whole fragment, otherwise you get an infinite recursion.

Finally, some screenshots and code examples.

Custom checkbox (as at the moment):
![image](https://user-images.githubusercontent.com/919405/66652982-41a1f400-ec37-11e9-813f-4b39087e89e7.png)
```php
    ->add('test', CheckboxType::class, [
        'label_attr' => [
            'class' => 'checkbox-custom',
        ],
    ])
```
Custom switch (proposed):
![image](https://user-images.githubusercontent.com/919405/66652902-1919fa00-ec37-11e9-98f3-9340b01b2335.png)
```php
    ->add('test', CheckboxType::class, [
        'label_attr' => [
            'class' => 'switch-custom',
        ],
    ])
```

Commits
-------

99f59e262f Supporting Bootstrap 4 custom switches
2019-11-03 12:57:04 +01:00
Fabien Potencier 25baf75edb Fix CS 2019-11-03 12:51:47 +01:00
Fabien Potencier 71873fc770 feature #33854 [DI] Add ability to choose behavior of decorations on non existent decorated services (mtarld)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Add ability to choose behavior of decorations on non existent decorated services

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #33522
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12442

# Handling decorations on non existent decorated services
Handle decorations on non existent decorated services by either throwing the service not found exception, silently ignoring services (decorator & decorated) all together or leave the decorated service to null (current behavior)

Something almost similar to how missing services as parameters are handles.

## Yaml configuration
```yaml
decorator:
    decorates: decorated
    decoration_on_invalid: ignore
```
Available values: `exception`, `ignore`, `null`. `exception` if nothing is specified.

## Xml configuration
```xml
<service id="decorator" decorates="decorated" decoration-on-invalid="ignore" />
```
Available values: `exception`, `ignore`, `null`. `exception` if nothing is specified.

## Behavior
- `exception`: Throws a `ServiceNotFoundException` telling that the decorator's dependency is missing
- `ignore`: Remove decorator definition. Decorator and decorated will not be available at all.
- `null`: Keep decorator but set decorated to null. Therefore, decorator `__construct` should be written with a nullable decorated dependency (`public function __contruct(?DecoratedInterface $decorated) {}`) and check should be done in other methods

Commits
-------

f167c77eaf Handle non existent decorated services
2019-11-03 12:49:07 +01:00
Robin Chalas e47b31c43c [Security] Fix SwitchUserToken wrongly deauthenticated 2019-11-02 08:21:17 +01:00
Fabien Potencier bbbbb2189a minor #34215 Fix typo (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix typo

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

327a13cac0 Fix typo
2019-11-01 17:43:39 +01:00
Fabien Potencier 327a13cac0 Fix typo 2019-11-01 17:09:13 +01:00
Romaric Drigon 99f59e262f Supporting Bootstrap 4 custom switches 2019-11-01 16:05:06 +01:00
dFayet c4a2f026e0 Add new Form WeekType 2019-11-01 15:48:13 +01:00
Tobias Schultze 3936b78830 feature #34185 [Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger]  extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #32077 and #31848
| License       | MIT
| Doc PR        |

as discussed with @weaverryan sending messages for retry and failure directly to transport instead of redispatching on the bus makes things much cleaner

Commits
-------

d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry and failure directly to transport instead of redispatching on the bus
2019-11-01 13:36:19 +01:00
Fabien Potencier 9eedb45b1a feature #34156 Adding DoctrineClearEntityManagerWorkerSubscriber to reset EM in worker (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

Adding DoctrineClearEntityManagerWorkerSubscriber to reset EM in worker

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes & no :)
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #34073
| License       | MIT
| Doc PR        | symfony/symfony-docs#12575
| DoctrineBundle PR | doctrine/DoctrineBundle#1043

Hi!

I've seen a few developers get "bit" by an issue recently: after running `messenger:consume`, the 2nd, 3rd, 4th, etc message that are handled are getting out-of-date data from Doctrine. The reason is simple:

A) Consume the 1st message, it queries for `Foo id=1` to do something
B) 10 minutes go by
C) Consume the 2nd message. It also queries for `Foo id=1`, but because this is already in the identity map, Doctrine re-uses the data that is now *10* minutes old.

Even though one worker process handles many messages, the system should (as much as possible) isolate each handler from each other. This is one very practical place we can help people. Also, checking the code, I don't think clearing the entity manager will cause any issues for an EM whose Connection has not been "connected" yet (i.e. it will not cause a connection to be established).

We would wire this in DoctrineBundle, and could make it disable-able... in case that's something that's needed.

Commits
-------

e7b98880aa Adding DoctrineClearEntityManagerWorkerSubscriber to reset entity manager in worker
2019-10-31 22:43:51 +01:00
Ryan Weaver e7b98880aa Adding DoctrineClearEntityManagerWorkerSubscriber to reset entity manager in worker 2019-10-31 13:26:56 -04:00
Tobias Schultze d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry
and failure directly to transport instead of redispatching on the bus
2019-10-31 15:47:36 +01:00
Tobias Schultze cf10c02765 minor #34155 Revert SyncTransport simplification and fix properly (weaverryan)
This PR was squashed before being merged into the 4.4 branch (closes #34155).

Discussion
----------

Revert SyncTransport simplification and fix properly

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34115 (and also related to #34066)
| License       | MIT
| Doc PR        | Not needed

In #34069, I made `SyncTransport` simpler by removing that transport class and making the whole things a config trick. I felt GREAT about that solution... until i realized two big problems:

1) It kills using env vars for `sync://` because we read the config values at build time - #34115 - that could probably be fixed by adding a factory, but then there is also the next problem

2) If someone routed a message to `[async, sync]` (weird, but allowed), my #34069 config solution basically maps this internally to `[async]`, which actually causes the message to *not* be handled immediately. Basically, my solution only worked if you route a message ONLY to one sync transport, but fails if you route to multiple transports.

So... this fixes things in a less-cool, but sensible way:

A) The first commit reverts #34069 exactly
B) The second commit solves the issue that we need to know if a message is being handled in a "worker" context or not, so middleware can decide if they should reset things before/after handling things. Previously we were using `ReceivedStamp` to know this. But because `SyncTransport` also "receives" the message and adds this stamp, it's not enough. To fix this, I added a new `ConsumedByWorkerStamp` that clearly means: "This message is being handled by a worker" (and so, you might want to "reset" some things before/after handling).

Thanks!

Commits
-------

01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context"
38f19a960c Revert "[Messenger] Removing "sync" transport and replacing it with much nicer config trick"
2019-10-31 15:10:54 +01:00
Nicolas Grekas aea43b27b0 minor #34166 [VarDumper] Do not dump the EventDispatcher (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Do not dump the EventDispatcher

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

Commits
-------

31c402a003 [VarDumper] Do not dump the EventDispatcher
2019-10-30 22:27:22 +01:00
Nicolas Grekas 38bd52e9be feature #34133 [Cache] add DeflateMarshaller - remove phpredis compression (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] add DeflateMarshaller - remove phpredis compression

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

phpredis compression doesn't play well with lua scripting as used in #33939
Let's remove it and provide a `DeflateMarshaller` instead.

Ppl can use it via decoration:
```yaml
services:
    Symfony\Component\Cache\Marshaller\DeflateMarshaller:
        decorates: cache.default_marshaller
        arguments: ['@Symfony\Component\Cache\Marshaller\DeflateMarshaller.inner']
```

It's not enabled by default because that might break pools that are shared between different apps.

/cc @andrerom FYI

Commits
-------

452c863639 [Cache] add DeflateMarshaller - remove phpredis compression
2019-10-30 17:54:40 +01:00
Nicolas Grekas 8cf0698e85 bug #34163 [DI] fix regexp for anonymous services with no class set (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix regexp for anonymous services with no class set

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

Follows #33782

Commits
-------

a302d2050e [DI] fix regexp for anonymous services with no class set
2019-10-30 17:53:52 +01:00
Nicolas Grekas cc357ad70c [Validator] fix merge 2019-10-30 14:47:18 +01:00
Nicolas Grekas 94beae00b1 Merge branch '4.3' into 4.4
* 4.3:
  [4.3] Remove unused local variables
2019-10-30 14:23:44 +01:00
Nicolas Grekas e8b31ff608 minor #34176 [4.3] Remove unused local variables (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[4.3] Remove unused local variables

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

Follow up of https://github.com/symfony/symfony/pull/34105 on 4.3.

Commits
-------

58161b8eec [4.3] Remove unused local variables
2019-10-30 14:18:51 +01:00
Nicolas Grekas 301ec496ea [Lock][HttpFoundation] Hot fix 2019-10-30 14:15:17 +01:00
Thomas Calvet 58161b8eec [4.3] Remove unused local variables 2019-10-30 13:58:49 +01:00
Nicolas Grekas 0b5b6fa79f Merge branch '4.3' into 4.4
* 4.3:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [HttpClient] always return the empty string when the response cannot have a body
  [TwigBundle][exception] Added missing css variable to highlight line in trace
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:55:29 +01:00
Nicolas Grekas 1aaf58b55a Merge branch '3.4' into 4.3
* 3.4:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:53:54 +01:00
Nicolas Grekas 27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| Q             | A
| ------------- | ---
| Branch?       | 3.4  <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

<!--
Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin 3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas 1a92f44a33 bug #34144 [Serializer] Improve messages for unexpected resources values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

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

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce276c7 [Serializer] Improve messages for unexpected resources values
2019-10-30 13:39:30 +01:00
Nicolas Grekas c424c5adb7 bug #34186 [HttpClient] always return the empty string when the response cannot have a body (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] always return the empty string when the response cannot have a body

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

This will fix tests on 4.4 also.

Commits
-------

f78e14332e [HttpClient] always return the empty string when the response cannot have a body
2019-10-30 13:01:49 +01:00
Nicolas Grekas f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Fabien Potencier 6bb7751fc1 feature #34177 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN

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

```yaml
framework:
    session:
        handler_id: 'redis://localhost'
        handler_id: '%env(REDIS_URL)%'
        handler_id: '%env(DATABASE_URL)%'
        handler_id: 'file://%kernel.project_dir%/var/sessions'
```

etc.

the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)

Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)

Commits
-------

de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
2019-10-30 11:42:43 +01:00
Nicolas Grekas de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN 2019-10-30 10:56:04 +01:00
Christian Flothmann 9e7ab8c003 feature #32107 [Validator] Add AutoMapping constraint to enable or disable auto-validation (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #32107).

Discussion
----------

[Validator] Add AutoMapping constraint to enable or disable auto-validation

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

As discussed in #32070 and #32015, it's sometimes mandatory to prevent some classes or properties to be auto mapped (auto-validated). This PR introduces a new constraint, `@AutoMapping` allowing to do exactly that. Examples:

Class:

```php
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @Assert\AutoMapping(false)
 */
class DoctrineLoaderNoAutoMappingEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=20, unique=true)
     */
    public $maxLength;
}
```

Property:

```php
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class DoctrineLoaderEntity extends DoctrineLoaderParentEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=10)
     * @Assert\AutoMapping(false)
     */
    public $noAutoMapping;
}
```

The rules are the following:

* If the constraint is present on a property, and set to true, auto-mapping is always on, regardless of the config, and of any class level annotation
* If the constraint is present on a property, and set to false, auto-mapping is always off, regardless of the config, and of any class level annotation
* If the constraint is present on a class, and set to true, auto-mapping is always on except if a the annotation has been added to a specific property, and regardless of the config
* If the constraint is present on a class, and set to false, auto-mapping is always off except if a the annotation has been added to a specific property, and regardless of the config

Commits
-------

f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation
2019-10-30 08:50:31 +01:00
Kévin Dunglas f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation 2019-10-30 08:50:22 +01:00
Robin Chalas 8e2bc5fe0a minor #34180 [DI] Fix "!tagged" related upgrade/changelog notes (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Fix "!tagged" related upgrade/changelog notes

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

Commits
-------

81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes
2019-10-30 00:18:42 +01:00
Robin Chalas 81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes 2019-10-29 21:21:43 +01:00
Yonel Ceruto 2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

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

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau 5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas d08273236c feature #34170 Re-allow to use "tagged" in service definitions (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

Re-allow to use "tagged" in service definitions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+.

Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009)

Commits
-------

7b7dc0df9a Re-allow to use "tagged" in service definitions
2019-10-29 15:17:53 +01:00
Kévin Dunglas 7b7dc0df9a
Re-allow to use "tagged" in service definitions 2019-10-29 15:11:25 +01:00
Nicolas Grekas 380e0fc984 feature #34043 [Lock] Add missing lock connection string in FrameworkExtension (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Add missing lock connection string in FrameworkExtension

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

This PR adds support to missing DSN in Lock component

```
framework:
  lock: sqlite:/tmp/db
  lock: mysql:host=localhost;dbname=test
  lock: zookeeper://localhost:2181
```

The PR also removes intermediate "internal" services `.lock_connection.*` in favor of factory `StoreFactory::createStore`. Which remove duplicate code.

This PR also deprecate unused services `lock.store.*` and  `lock.store.*.abstract`

Commits
-------

2db24cf582 Add missing lock connection string in FrameworkExtension
2019-10-29 14:57:27 +01:00
Nicolas Grekas 8ec1f14c47 Merge branch '4.3' into 4.4
* 4.3:
  [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:52:16 +01:00
Nicolas Grekas 2326f2882c bug #34167 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() (dunglas)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

This parameter was already deprecated in Symfony 4. Allowing to not pass it in Symfony 4.3 without triggering a deprecation allows to support both HttpFoundation 4.3 and 4.4, otherwise it's not possible.

Needed to make API Platform compatible with Symfony 5 (https://github.com/api-platform/core/pull/3009)

Commits
-------

e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:51:20 +01:00
Kévin Dunglas e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00
Grégoire Pineau 31c402a003 [VarDumper] Do not dump the EventDispatcher 2019-10-29 14:41:12 +01:00
Jérémy Derussé 2db24cf582
Add missing lock connection string in FrameworkExtension 2019-10-29 14:34:12 +01:00
Nicolas Grekas e2c625e78b feature #34057 [Lock][Cache] Allows URL DSN in PDO adapters (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock][Cache] Allows URL DSN in PDO adapters

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

This PR duplicate a feature from PdoSessionHandler that convert URL DSN ( ie. mysql://localhost/test) into PDO DSN (ie. mysql:host=localhost;dbname=test)

that would ease configuration by using the same well-known variable
```
framework:
  lock: '%env(DATABASE_URL)%'
```

note: I applied the same change on Cache component for consistency.

Commits
-------

474daf976e Allows URL DSN in Lock and Cache
2019-10-29 14:07:00 +01:00
Nicolas Grekas a302d2050e [DI] fix regexp for anonymous services with no class set 2019-10-29 12:56:37 +01:00