Commit Graph

29538 Commits

Author SHA1 Message Date
Fabien Potencier
846d24ae36 feature #21293 [FrameworkBundle][Serializer] Move SerializerPass to the Serializer (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Serializer] Move SerializerPass to the Serializer

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

Part of #21284

Commits
-------

95cf5084c0 [FrameworkBundle][Serializer] Move SerializerPass to the Serializer
2017-02-16 05:30:28 -08:00
Fabien Potencier
a27accf8e5 minor #21315 [DI][FrameworkBundle] Show autowired methods in descriptors (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI][FrameworkBundle] Show autowired methods in descriptors

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

so we can see the autowired methods using `debug:container`.

Commits
-------

482435c501 [DI][FrameworkBundle] Show autowired methods in descriptors
2017-02-16 05:25:28 -08:00
Fabien Potencier
b056d40fb3 feature #21450 [Security] Lazy load guard authenticators and authentication providers (chalasr)
This PR was squashed before being merged into the 3.3-dev branch (closes #21450).

Discussion
----------

[Security] Lazy load guard authenticators and authentication providers

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

Authentication stops on the first authenticator that fails or succeeds, let's instantiate them only if actually needed.

Commits
-------

cd6422ae73 [SecurityBundle] Lazy load authentication providers
b8a23ded63 [Security][Guard] Lazy load authenticators
2017-02-16 04:58:04 -08:00
Fabien Potencier
7c9a5c1475 feature #21484 [DI] Deprecate underscore-services in YamlFileLoader (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Deprecate underscore-services in YamlFileLoader

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

As discussed when introducing `_defaults`

Commits
-------

7781082587 [DI] Deprecate underscore-services in YamlFileLoader
2017-02-16 04:51:31 -08:00
Fabien Potencier
a70ee67a88 minor #21615 [DI][FrameworkBundle] ServiceLocator: fix XmlDescriptor to use dashes (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI][FrameworkBundle] ServiceLocator: fix XmlDescriptor to use dashes

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

As reported by @stof, I should have used dashes, not underscores. My bad...

Commits
-------

1417f112a7 [DI][FrameworkBundle] ServiceLocator: fix XML descriptor to use dashes
2017-02-16 04:32:11 -08:00
Maxime Steinhausser
1417f112a7 [DI][FrameworkBundle] ServiceLocator: fix XML descriptor to use dashes 2017-02-14 23:21:16 +01:00
Fabien Potencier
0976c86f3d minor #21600 [DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors

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

This simply ensures the new feature is properly considered by the different dumpers, and updates the console descriptors to support the new `ServiceLocatorArgument`.

I also added the number of elements in an array/iterator/service_locator argument when using the `TextDescriptor` in this PR.

(fabbot is complaining about the new yaml tags support)

Commits
-------

aa9074d25a [DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors
2017-02-14 19:51:53 +01:00
Fabien Potencier
00d20ead28 feature #21270 [DependencyInjection] Use glob pattern to load config files (pierredup)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] Use glob pattern to load config files

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

This relates to #21173, but I'm not sure if it completely fixes the issue.

This allows to use a glob pattern to load config files, which makes the following possible:

```
# config.yml
imports:
    - { resource: "*.yml" }
    - { resource: "folder/*.yml" }
    - { resource: "/etc/myapp/*.{yml,xml}" }
```

It can also be used in a container extension, if a bundle uses a lot of configs:

```
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('*.yml');
$loader->load('routing/*');
```

Commits
-------

519180ef56 Use glob pattern to load config file
2017-02-14 19:46:56 +01:00
Fabien Potencier
1079668d4b feature #19815 [WebProfilerBundle] Make the IP address in the profiler header clickable (jameshalsall)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[WebProfilerBundle] Make the IP address in the profiler header clickable

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

Commits
-------

52606a19cf [WebProfilerBundle] Make the IP address in the profiler header clickable to view requests by IP
2017-02-14 19:35:04 +01:00
Nicolas Grekas
db995dfaf8 Merge branch '3.2'
* 3.2: (27 commits)
  Improve tracking of environment variables in the case of private services
  [DI] Align AutowirePass with 2.8
  property constraints can be added in child classes
  added test for staticClassLoader in LazyLoadingMetadatafactory
  fixed PHPUnit setUp and tearDown method visibility
  spelling fixes
  Readd Symfony version status in the toolbar
  [Security] LdapUserProvider should not throw an exception if the UID key does not exist in an LDAP entry
  make sure that null can be the invalid value
  [VarDumper] Improve dump of AMQP* Object
  Fix annotations cache folder path
  [FrameworkBundle] Wire ArrayCache for annotation reader at bootstrap
  Ignore missing 'debug.file_link_formatter' service in Debug bundle
  [VarDumper] Fixed dumping of terminated generator
  bumped Symfony version to 3.2.4
  updated VERSION for 3.2.3
  updated CHANGELOG for 3.2.3
  bumped Symfony version to 2.8.18
  updated VERSION for 2.8.17
  updated CHANGELOG for 2.8.17
  ...
2017-02-14 17:35:24 +01:00
Nicolas Grekas
975411d7f0 Merge branch '2.8' into 3.2
* 2.8:
  property constraints can be added in child classes
  added test for staticClassLoader in LazyLoadingMetadatafactory
  spelling fixes
  Readd Symfony version status in the toolbar
  make sure that null can be the invalid value
  [VarDumper] Improve dump of AMQP* Object
  [VarDumper] Fixed dumping of terminated generator
  bumped Symfony version to 2.8.18
  updated VERSION for 2.8.17
  updated CHANGELOG for 2.8.17
  bumped Symfony version to 2.7.25
  updated VERSION for 2.7.24
  update CONTRIBUTORS for 2.7.24
  updated CHANGELOG for 2.7.24
  [FrameworkBundle] Simplify createPackageDefinition
  fix directory resource considers same timestamp not fresh
  return false early from directory resource
2017-02-14 17:27:43 +01:00
Nicolas Grekas
03194300ed Merge branch '2.7' into 2.8
* 2.7:
  property constraints can be added in child classes
  added test for staticClassLoader in LazyLoadingMetadatafactory
  spelling fixes
  make sure that null can be the invalid value
  bumped Symfony version to 2.7.25
  updated VERSION for 2.7.24
  update CONTRIBUTORS for 2.7.24
  updated CHANGELOG for 2.7.24
  [FrameworkBundle] Simplify createPackageDefinition
  fix directory resource considers same timestamp not fresh
  return false early from directory resource
2017-02-14 17:24:56 +01:00
Maxime Steinhausser
482435c501 [DI][FrameworkBundle] Show autowired methods in descriptors 2017-02-14 15:26:51 +01:00
Nicolas Grekas
298060d0a0 minor #21529 [FrameworkBundle] Simplify createPackageDefinition (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Simplify createPackageDefinition

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

Minor simplification.

Commits
-------

4b81393 [FrameworkBundle] Simplify createPackageDefinition
2017-02-14 13:45:10 +01:00
Nicolas Grekas
28a3524a0e minor #21605 [DI] Align AutowirePass with 2.8 (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[DI] Align AutowirePass with 2.8

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

Follow up a less than ideal [merge conflict resolution](https://github.com/symfony/symfony/pull/18691#issuecomment-218803903), found while reviewing AutowirePass in 2.8 and 3.2 and wondering about the delta. Should reduce future merge conflicts and help history tracking.

Commits
-------

dd5236a [DI] Align AutowirePass with 2.8
2017-02-14 13:24:27 +01:00
Nicolas Grekas
0b46a1b20c bug #21607 Improve tracking of environment variables in the case of private services (tgalopin)
This PR was merged into the 3.2 branch.

Discussion
----------

Improve tracking of environment variables in the case of private services

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

Recently, I stumbled upon an issue with environment variables that I had troubles to understand. Here it is:

I have two environment variables, defined in my `parameters.yml` with a default value of empty:

``` yaml
parameters:
    env(MAILJET_PUBLIC_KEY): ''
    env(MAILJET_PRIVATE_KEY): ''
```

I use these variables only in a private service:

``` xml
<service id="app.mailjet.transport" class="AppBundle\Mailjet\MailjetApiTransport" public="false">
    <argument type="service" id="csa_guzzle.client.mailjet_api"/>
    <argument>%env(MAILJET_PUBLIC_KEY)%</argument>
    <argument>%env(MAILJET_PRIVATE_KEY)%</argument>
</service>
```

This private service is not used by any other service for the moment.

As the service is private and not used by any other service, the `RemoveUnusedDefinitionsPass` removes it from the container. However, when the container dumper dumps the container, it checks if the environment variable was dumped. As the service is now gone, an expection is thrown (`EnvParameterException, Incompatible use of dynamic environment variables "MAILJET_PUBLIC_KEY", "MAILJET_PRIVATE_KEY" found in parameters.`).

Commits
-------

f380ba3 Improve tracking of environment variables in the case of private services
2017-02-14 13:23:27 +01:00
Titouan Galopin
f380ba3770 Improve tracking of environment variables in the case of private services 2017-02-14 12:44:34 +01:00
Nicolas Grekas
dd5236ad97 [DI] Align AutowirePass with 2.8 2017-02-14 10:20:20 +01:00
Pierre du Plessis
519180ef56 Use glob pattern to load config file 2017-02-14 07:56:25 +02:00
Maxime Steinhausser
aa9074d25a [DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors 2017-02-13 20:22:27 +01:00
Fabien Potencier
5c07ffada7 bug #21592 [Validator] property constraints can be added in child classes (angelk, xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] property constraints can be added in child classes

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

This reverts the changes done in #21053 (and applies the test written by @angelk in #21538). I think trying to "fix" #15950 with the changes from #21053 was a mistake. Child classes should be able to refine validation constraints (I basically agree with @ro0NL's reasoning in https://github.com/symfony/symfony/issues/21567#issuecomment-278729990.

Commits
-------

9513a8aa52 property constraints can be added in child classes
a266ff799c added test for staticClassLoader in LazyLoadingMetadatafactory
2017-02-13 19:48:02 +01:00
Fabien Potencier
43588ca288 minor #21594 fixed PHPUnit setUp and tearDown method visibility (fabpot)
This PR was merged into the 3.2 branch.

Discussion
----------

fixed PHPUnit setUp and tearDown method visibility

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

Commits
-------

4fd4cb900b fixed PHPUnit setUp and tearDown method visibility
2017-02-13 18:40:29 +01:00
Christian Flothmann
9513a8aa52 property constraints can be added in child classes 2017-02-13 18:37:45 +01:00
po_taka
a266ff799c added test for staticClassLoader in LazyLoadingMetadatafactory 2017-02-13 18:37:45 +01:00
Kévin Dunglas
b5d9b3b99e
[Serializer] Pass the context to AbstractObjectNormalizer::supportsDenormalization 2017-02-13 15:50:04 +01:00
Fabien Potencier
9ac3a7e010 feature #21383 [DependencyInjection] Add support for named arguments (dunglas, nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] Add support for named arguments

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

This PR introduces named arguments for services definitions. It's especially useful to inject parameters in an autowired service. It is (at least partially) an alternative to #21376 and #20738.

Usage:

```yml
services:
    _defaults: { autowire: true }
    Acme\NewsletterManager: { $apiKey: "%mandrill_api_key%" }

# Alternative (traditional) syntax
services:
    newsletter_manager:
        class: Acme\NewsletterManager
        arguments:
            $apiKey: "%mandrill_api_key%"
        autowire: true
```
```php
use Doctrine\ORM\EntityManager;
use Psr\Log\LoggerInterface;

namespace Acme;

class NewsletterManager
{
    private $logger;
    private $em;
    private $apiKey;

    public function __construct(LoggerInterface $logger, EntityManager $em, $apiKey)
    {
        $this->logger = $logger;
        $this->em = $em;
        $this->apiKey = $apiKey;
    }
}
```

Commits
-------

8a126c8537 [DI] Deprecate string keys in arguments
2ce36a6074 [DependencyInjection] Add a new pass to check arguments validity
6e501296f9 [DependencyInjection] Add support for named arguments
2017-02-13 15:38:11 +01:00
Fabien Potencier
17b43632b5 feature #19371 [Serializer] Give access to the context to support* methods (dunglas)
This PR was squashed before being merged into the 3.3-dev branch (closes #19371).

Discussion
----------

[Serializer] Give access to the context to support* methods

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

This is a current use case to want to access the context form the `supports*` methods. This PR fixes this limitation.

Maybe can it be considered a bug fix?

Commits
-------

6a7a16e517 [Serializer] Give access to the context to support* methods
2017-02-13 15:29:04 +01:00
Kévin Dunglas
6a7a16e517 [Serializer] Give access to the context to support* methods 2017-02-13 15:28:10 +01:00
Fabien Potencier
320529e646 feature #21553 [DI] Replace container injection by explicit service locators (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Replace container injection by explicit service locators

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

This adds a new `ServiceLocatorArgument` (`!service_locator`) argument type which takes a list of services, meant to be used as a concrete service locator in order to avoid the remaining needs for injecting the container when it's only a matter of dependency lazy-loading.

Config:
```yaml
App\FooBar: [!service_locator { key1: '@service1', key2: '@service2' }]
```

```xml
<service class="App\FooBar" public="false">
    <argument type="service-locator">
        <argument type="service" key="key1" id="service1"/>
        <argument type="service" key="key2" id="service2"/>
     </argument>
</service>
```

```php
new ServiceLocatorArgument(array('key1' => new Reference('service1'), 'key2' => new Reference('service2'));
```

Usage:
```php
$locator->has('key1') // true
$locator->has('service1') // false, the defined key must be used
$locator->get('key1'); // service1 instance
$locator->get('service1'); // exception
$locator->has('not-specified') // false
$locator->get('not-specified'); // exception
```

We have some concrete use cases in the core where this would be useful (see e.g. SecurityBundle's FirewallMap), same in userland/3rd party code (see related RFC).

Commits
-------

e7935c0adb [DI] Replace container injection by explicit service locators
2017-02-13 15:17:30 +01:00
Fabien Potencier
e43bd57508 feature #18834 [Serializer] Add the possibility to filter attributes (dunglas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Serializer] Add the possibility to filter attributes

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

This new features give the possibility to the end user to select select fields to normalize.

Exemple:

``` php
class Foo
{
    public $a = '1';
    public $b = '2';
    public $c = '3';
}

$normalizer = new \Symfony\Component\Serializer\Normalizer\ObjectNormalizer();
$normalizer->normalize(new Foo(), null, ['attributes' => ['a', 'c']]);
// ['a' => '1', 'c' => '3']
```

Denormalization is also supported. This feature works for any normalizer using the `Symfony\Component\Serializer\Normalizer\AbstractNormalizer` class.

The main use case is to permit to API clients to optimize responses length by dropping unnecessary information like in the following example:

```
http://exemple.com/cars?fields=a,c

{'a' => 1, 'c' => 2}
```

Thanks to this PR, support for this feature will be available out of the box in [API Platform](https://api-platform.com).

Commits
-------

b3826fb0e7 [Serializer] Add the possibility to filter attributes
2017-02-13 15:11:55 +01:00
Kévin Dunglas
b3826fb0e7
[Serializer] Add the possibility to filter attributes 2017-02-13 11:25:59 +01:00
Grégoire Pineau
a0f1e850c0 [Workflow] Updated changelog according to #20787 2017-02-13 11:25:18 +01:00
Grégoire Pineau
772d8e6066 feature #20787 [Workflow] Added an entered event (Padam87)
This PR was submitted for the 3.2 branch but it was merged into the 3.3-dev branch instead (closes #20787).

Discussion
----------

[Workflow] Added an entered event

| Q             | A
| ------------- | ---
| Branch?       |  3.2
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20774 (partially) ; #21433
| License       | MIT
| Doc PR        | -

Commits
-------

7a562bd81e [Workflow] Added an entered event
2017-02-13 11:05:08 +01:00
Adam Prager
7a562bd81e [Workflow] Added an entered event 2017-02-13 11:05:07 +01:00
Robin Chalas
e7935c0adb
[DI] Replace container injection by explicit service locators
[SecurityBundle] Avoid container injection in FirewallMap
2017-02-13 11:05:06 +01:00
Nicolas Grekas
8a126c8537
[DI] Deprecate string keys in arguments 2017-02-13 10:06:08 +01:00
Kévin Dunglas
2ce36a6074
[DependencyInjection] Add a new pass to check arguments validity 2017-02-13 10:03:44 +01:00
Kévin Dunglas
6e501296f9
[DependencyInjection] Add support for named arguments 2017-02-13 10:03:43 +01:00
Fabien Potencier
4fd4cb900b fixed PHPUnit setUp and tearDown method visibility 2017-02-13 07:56:25 +01:00
Fabien Potencier
91904af902 feature #21289 [DI] Add prototype services for PSR4-based discovery and registration (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Add prototype services for PSR4-based discovery and registration

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

Talking with @dunglas, we wondered if this could be a good idea, as a more general approach to folder-based service registration as done in [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle/blob/master/DependencyInjection/DunglasActionExtension.php).

So here is the implementation.

This allows one to define a set of services as such:
```yaml
services:
    App\:
        resources: ../src/{Controller,Command} # relative to the current file as usual
        autowire: true # or any other attributes really
```

This looks for php files in the "src" folder, derivates PSR-4 class names from them, and uses `class_exists` for final discovery. The resulting services are named after the classes found this way.

The "resource" attribute can be a glob to select only a subset of the classes/files.

This approach has several advantages over [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle/blob/master/DependencyInjection/DunglasActionExtension.php):
- it is resilient to missing parent classes (see test case)
- it loads classes using the normal code path (the autoloader), thus play well with them (e.g. if one registered a special autoloader).
- it is more predictable, because it uses discovered paths as the only source of ids/classes to register - vs relying on `get_declared_classes`, which would make things context sensitive.

Fits well with current initiatives to me.

Commits
-------

03470b788e [DI] Add "psr4" service attribute for PSR4-based discovery and registration
2017-02-13 06:22:10 +01:00
Nicolas Grekas
03470b788e [DI] Add "psr4" service attribute for PSR4-based discovery and registration 2017-02-12 23:09:17 +01:00
Fabien Potencier
6d3d17d2ea feature #21465 [Debug] Support @final on methods (GuilhemN)
This PR was squashed before being merged into the 3.3-dev branch (closes #21465).

Discussion
----------

[Debug] Support `@final` on methods

| 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/pull/21461#discussion_r98401148
| License       | MIT
| Doc PR        |

This adds support for `@final` on methods:
```php
class Foo {
    /**
     * @final since version 2.0.
     */
    public function bar()
    {
    }
}
```

ping @nicolas-grekas

Commits
-------

1b0a6b6c45 [Debug] Support  on methods
2017-02-12 20:33:57 +01:00
Guilhem N
1b0a6b6c45 [Debug] Support on methods 2017-02-12 20:33:56 +01:00
Fabien Potencier
033c41a6b9 minor #21090 Secure unserialize by restricting allowed classes when using PHP 7 (dbrumann)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Secure unserialize by restricting allowed classes when using PHP 7

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

While playing around with Symfony in a PHP 7.1 application I noticed a warning in how EnvParameterResoure uses unserialize. Since PHP 7.0 introduced the options argument which allows to restrict which classes can be unserialized for better security, it might make sense to use it here. As far as I can tell this is no BC break, it only provides an additional safety mechanism.

Commits
-------

b4201810b9 Conditionally add options to unserialize in PHP 7.0+.
2017-02-12 20:14:59 +01:00
Fabien Potencier
2c302cee19 bug #21458 [Config] Early return for DirectoryResource (robfrawley)
This PR was squashed before being merged into the 2.7 branch (closes #21458).

Discussion
----------

[Config] Early return for DirectoryResource

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | sure?
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets |
| Related PRs | #21440
| License       | MIT
| Doc PR        | n/a

Alternate PR  that implements an early return for `DirectoryResource` to increase the speed on large file sets. We can never return early with `true` without checking all assets within the resource, as the aforementioned referenced PR did; hence this PR takes the counter approach and returns `false` early where appropriate.

_Conversation about possible bug at https://github.com/symfony/symfony/pull/21458#discussion_r98366339._

Commits
-------

d5746ecfd2 fix directory resource considers same timestamp not fresh
96107e21f1 return false early from directory resource
2017-02-12 20:12:54 +01:00
Fabien Potencier
e7541d9552 bug #21562 [DoctrineBridge] make sure that null can be the invalid value (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[DoctrineBridge] make sure that null can be the invalid value

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

Commits
-------

c3702c2d8f make sure that null can be the invalid value
2017-02-12 20:07:00 +01:00
Fabien Potencier
6ea39990c3 feature #21505 [Config][DI] Add ComposerResource to track the runtime engine + deps (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Config][DI] Add ComposerResource to track the runtime engine + deps

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

So that the container is invalidated whenever a new PHP runtime is used, a PHP-extension is added, or vendors are changed.

Commits
-------

a960c761d1 [Config][DI] Add ComposerResource to track runtime + vendors
2017-02-12 12:59:14 +01:00
Fabien Potencier
915cca84b6 feature #21533 [DI] Deprecate (un)setting pre-defined services (ro0NL)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Deprecate (un)setting pre-defined services

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

This PR is the subset of #19668 that fixes #19192: it deprecates (un)setting pre-defined services.
This opens the path to some optimizations in the dumped container in 4.0.

Commits
-------

fdb2140b81 [DI] Deprecate (un)setting pre-defined services
2017-02-12 12:52:54 +01:00
Fabien Potencier
50be214200 bug #21556 [FrameworkBundle] Wire ArrayCache for annotation reader at bootstrap (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] Wire ArrayCache for annotation reader at bootstrap

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

Related to #21381 which disabled any cache at bootstrap.
Instead, this wires ArrayCache during bootstrapping, then swaps the cache provider for the real one.

Commits
-------

f90f53e915 [FrameworkBundle] Wire ArrayCache for annotation reader at bootstrap
2017-02-12 12:49:46 +01:00
Nicolas Grekas
f590c8d7ae bug #21584 [WebProfilerBundle] Readd Symfony version status in the toolbar (wouterj)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Readd Symfony version status in the toolbar

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

The Symfony version status (*"This Symfony version will no longer receive security fixes."* and the like) was no longer shown in the toolbar. This was removed in 9d89841e3a , but the commit description isn't that describing. I guess it's not done on purpose.

I think having this information is crucial for this feature to work: A yellow version doesn't mean anything specific, unless I see "This Symfony will only receive security fixes".

/cc @javiereguiluz

Commits
-------

d714c7e Readd Symfony version status in the toolbar
2017-02-11 12:37:09 +01:00