Commit Graph

32643 Commits

Author SHA1 Message Date
Nicolas Grekas
701d41cc33 feature #24257 [HttpKernel][DI] Enable Kernel to implement CompilerPassInterface (nicolas-grekas)
This PR was squashed before being merged into the 3.4 branch (closes #24257).

Discussion
----------

[HttpKernel][DI] Enable Kernel to implement CompilerPassInterface

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

In the same spirit as #13761 that allowed DI exts to be also compiler passes, and as #23812 that allowed the kernel to listen to events, in our new bundle-less world, should we allow the kernel to register itself as a compiler pass? That would make some scenario possible (like having a `TestKernel` that turns some services public.)

Commits
-------

6973a1a [HttpKernel][DI] Enable Kernel to implement CompilerPassInterface
2017-09-20 15:13:22 +02:00
Nicolas Grekas
6973a1ae3b [HttpKernel][DI] Enable Kernel to implement CompilerPassInterface 2017-09-20 15:13:20 +02:00
Nicolas Grekas
2f86474267 feature #23834 [DI] Add "PHP fluent format" for configuring the container (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Add "PHP fluent format" for configuring the container

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

This PR allows one to write DI configuration using just PHP, with full IDE auto-completion.
Example:
```php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo;

return function (ContainerConfigurator $c) {

    $c->import('basic.php');

    $s = $c->services()->defaults()
        ->public()
        ->private()
        ->autoconfigure()
        ->autowire()
        ->tag('t', array('a' => 'b'))
        ->bind(Foo::class, ref('bar'))
        ->private();

    $s->set(Foo::class)->args([ref('bar')])->public();
    $s->set('bar', Foo::class)->call('setFoo')->autoconfigure(false);

};
```

Commits
-------

814cc31 [DI] Add "PHP fluent format" for configuring the container
2017-09-20 15:06:57 +02:00
Nicolas Grekas
20ecf91d52 feature #24180 [Routing] Add PHP fluent DSL for configuring routes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] Add PHP fluent DSL for configuring routes

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

If we add a PHP DSL for DI config (#23834), we must have a similar one for routing. Here it is. See fixtures.

So, you always start with a `RoutingConfigurator $routes`, which allows you to:
```php
$routes->add($name, $path); // adds a route
$routes->import($resource, $type = null, $ignoreErrors = false); // imports routes
$routes->collection($name = ''); // starts a collection, all *names* might be prefixed
```

then
- for "import" and "collection", you can `->prefix($path)`;
- for "add" and "collection", you can fluently "add" several times;
- for "collection" you add sub"`->collection()`";
- and on all, you can configure the route(s) with:
```php
->defaults(array $defaults)
->requirements(array $requirements)
->options(array $options)
->condition($condition)
->host($pattern)
->schemes(array $schemes)
->methods(array $methods)
->controller($controller)
```

Commits
-------

f433c9a [Routing] Add PHP fluent DSL for configuring routes
2017-09-20 15:01:12 +02:00
Nicolas Grekas
814cc31e57 [DI] Add "PHP fluent format" for configuring the container 2017-09-20 09:09:19 +02:00
Nicolas Grekas
f433c9a79d [Routing] Add PHP fluent DSL for configuring routes 2017-09-20 08:48:50 +02:00
Nicolas Grekas
aad62c427c minor #24228 [Serializer] Add local cache to normalizers (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Add local cache to normalizers

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

Should help making the Serializer a bit faster.

Commits
-------

b0c5cf0 [Serializer] Add local cache to normalizers
2017-09-20 07:22:30 +02:00
Nicolas Grekas
779e8edf44 feature #24232 [Bridge\Doctrine] Add "DoctrineType::reset()" method (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Bridge\Doctrine] Add "DoctrineType::reset()" method

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

Works with https://github.com/doctrine/DoctrineBundle/pull/695

Commits
-------

dce1eb9 [Bridge\Doctrine] Add "DoctrineType::reset()" method
2017-09-20 07:20:06 +02:00
Nicolas Grekas
0e73d7126e fixes 2017-09-19 23:53:27 +02:00
Nicolas Grekas
6f8336dcfa bug #24266 [DI] Fix private-by-default BC layer (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix private-by-default BC layer

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

Spotted while merging 3.4 into master and by looking at the cross-versions CI.

Commits
-------

ff2ab58 [DI] Fix private-by-default BC layer
2017-09-19 23:31:54 +02:00
Nicolas Grekas
ff2ab5831a [DI] Fix private-by-default BC layer 2017-09-19 23:28:23 +02:00
Nicolas Grekas
ad4bc6b647 feature #24238 [DI] Turn services and aliases private by default, with BC layer (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Turn services and aliases private by default, with BC layer

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

With this PR, all services and aliases are made private by default.
This is done in a BC way, thanks to the layer introduced in #24104.

We will require bundles to explicitly opt-in for "public", either using "defaults", or stating `public="true"` explicitly. Same in DI extension, where calling `->setPublic(true)` will be required in 4.0.

Commits
-------

9948b09 [DI] Turn services and aliases private by default, with BC layer
2017-09-19 18:13:26 +02:00
Nicolas Grekas
9948b09c6d [DI] Turn services and aliases private by default, with BC layer 2017-09-19 11:28:48 +02:00
Nicolas Grekas
55a76911f4 bug #24241 [WebProfiler] Fix z-index for sticky ajax window (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfiler] Fix z-index for sticky ajax window

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Forgotten in #23154

Before
![image](https://user-images.githubusercontent.com/1047696/30522978-f49c3c5c-9bd8-11e7-8bac-e7a690d5c34d.png)

After
![image](https://user-images.githubusercontent.com/1047696/30522965-d000e6fe-9bd8-11e7-92a8-52699c6619f8.png)

In case you hover the time panel.

Commits
-------

081c1e4 [WebProfiler] Fix z-index for pinned AJAX block
2017-09-18 16:25:27 +02:00
Nicolas Grekas
12bb22c4eb minor #24231 [DebugBundle] Fix the var-dumper requirement in composer.json (skalpa)
This PR was merged into the 3.4 branch.

Discussion
----------

[DebugBundle] Fix the var-dumper requirement in composer.json

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

The v3.4 of the debug bundle calls `VarCloner::setMinDepth()` and thus requires v3.4+ of the var-dumper component. However, the composer file has not been updated in 30cd70d.

I upped the var-dumper requirement to `~3.4|~4.0`.

Commits
-------

d761a76 Require v3.4+ of the var-dumper component
2017-09-18 09:44:12 +02:00
Roland Franssen
081c1e4f81 [WebProfiler] Fix z-index for pinned AJAX block 2017-09-17 18:42:13 +02:00
Nicolas Grekas
c4159b12c7 Merge branch '3.3' into 3.4
* 3.3:
  CS fixes
2017-09-17 12:10:45 +02:00
Nicolas Grekas
d94b9ac308 CS fixes 2017-09-17 12:10:12 +02:00
Nicolas Grekas
dce1eb95ff [Bridge\Doctrine] Add "DoctrineType::reset()" method 2017-09-16 18:00:00 +02:00
Pascal Luna
d761a7614a Require v3.4+ of the var-dumper component 2017-09-16 14:21:39 +01:00
Maxime Steinhausser
9208244e1f feature #23648 [Form] Add input + regions options to TimezoneType (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Add input  + regions options to TimezoneType

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/8223

I want to use `\DateTimeZone` as a model format, with only european timezones in the form available. Hence the new options.

Commits
-------

183307b741 [Form] Add input  + regions options to TimezoneType
2017-09-16 12:26:42 +02:00
Nicolas Grekas
b0c5cf0d9d [Serializer] Add local cache to normalizers 2017-09-16 12:19:29 +02:00
Roland Franssen
183307b741 [Form] Add input + regions options to TimezoneType 2017-09-16 10:56:09 +02:00
Fabien Potencier
40a3466268 Merge branch '3.3' into 3.4
* 3.3:
  CS: recover no_break_comment
  [DI] Fix non-instantiables auto-discovery
2017-09-15 10:11:35 -07:00
Fabien Potencier
e48617b467 Merge branch '2.8' into 3.3
* 2.8:
  CS: recover no_break_comment
2017-09-15 10:08:21 -07:00
Fabien Potencier
6edfa4b2df Merge branch '2.7' into 2.8
* 2.7:
  CS: recover no_break_comment
2017-09-15 09:59:28 -07:00
Fabien Potencier
b973ecf8ee minor #24215 CS: recover no_break_comment (keradus)
This PR was merged into the 2.7 branch.

Discussion
----------

CS: recover no_break_comment

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

rule was excluded in #24123, yet without any information about it
it was not excluded in original form of given PR, it's not part of any commitlog nor any comment, title claims to touch only other rules.

this rule shall not be excluded, it's part of PSR and is applied for most places.
I added missing ones.

Commits
-------

4e9d1600ee CS: recover no_break_comment
2017-09-15 09:58:02 -07:00
Maxime Steinhausser
b7492045f3 feature #24185 [Form] Display general forms information on debug:form (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Display general forms information on debug:form

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

![debug-form-defaults](https://user-images.githubusercontent.com/2028198/30436620-998103ca-993a-11e7-9873-31f042327374.png)

When we run `bin/console debug:form` (without argument) all possible Form Component information is displayed.

Commits
-------

12d1a7f810 Display form defaults on debug:form
2017-09-15 18:33:15 +02:00
Yonel Ceruto
12d1a7f810 Display form defaults on debug:form 2017-09-15 18:14:52 +02:00
Maxime Steinhausser
c7e84ccfee feature #23747 [Serializer][FrameworkBundle] Add a DateInterval normalizer (Lctrs)
This PR was squashed before being merged into the 3.4 branch (closes #23747).

Discussion
----------

[Serializer][FrameworkBundle] Add a DateInterval normalizer

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

Could be useful for API needing to submit a duration.

Most code have been adapted from @MisatoTremor's DateInterval form type. Credits to him.

Commits
-------

6185cb1991 [Serializer][FrameworkBundle] Add a DateInterval normalizer
2017-09-15 18:08:41 +02:00
Jérôme Parmentier
6185cb1991 [Serializer][FrameworkBundle] Add a DateInterval normalizer 2017-09-15 18:08:37 +02:00
Nicolas Grekas
46811fdd01 bug #24199 [DI] Fix non-instantiables auto-discovery (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[DI] Fix non-instantiables auto-discovery

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

Commits
-------

8b7c7c1 [DI] Fix non-instantiables auto-discovery
2017-09-15 15:18:29 +02:00
Nicolas Grekas
e3fa71c9f5 Merge branch '3.3' into 3.4
* 3.3:
  fix merge
2017-09-15 12:58:45 +02:00
Nicolas Grekas
cdb53266b3 fix merge 2017-09-15 12:58:39 +02:00
Dariusz
4e9d1600ee CS: recover no_break_comment 2017-09-15 12:36:22 +02:00
Nicolas Grekas
4b31b47f08 Merge branch '3.3' into 3.4
* 3.3:
  [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
  [Filesystem] mirror - fix copying content with same name as source/target.
  Removed unnecessary getDefinition() call.
  .php_cs.dist - simplify config
  [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2017-09-15 12:12:22 +02:00
Nicolas Grekas
ebbcb7b1be Merge branch '2.8' into 3.3
* 2.8:
  [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
  [Filesystem] mirror - fix copying content with same name as source/target.
  .php_cs.dist - simplify config
  [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2017-09-15 12:08:59 +02:00
Nicolas Grekas
6f924755a6 Merge branch '2.7' into 2.8
* 2.7:
  [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
2017-09-15 11:59:38 +02:00
Nicolas Grekas
800f306589 minor #24123 [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction (SpacePossum)
This PR was squashed before being merged into the 2.7 branch (closes #24123).

Discussion
----------

[CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction

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

Hi all and congratulations on the 1 billion of downloads! awesome :D

This is a courtesy call (or PR) from the PHP-CS-Fixer community.
As always I don't expect this PR to be merged nor do I've any strong feelings about why not.

The goal of this PR is to determine if the following new rules should be added to the Symfony ruleset by default. If so `fabbot.io` will (at some point) start reporting violations of these rules.
Please be aware that if the rules are accepted but this PR is not, any new PR's might contain a part of the fixes as proposed in this PR as fabbot.io will suggest to the authors of the new PR's to update the CS, consequently this might create noise.

Here are the rules:

```
    'no_unneeded_curly_braces' => true,
    'no_unneeded_final_method' => true,
    'semicolon_after_instruction' => true,
    'yoda_style' => true,
```

The first three are done in the first commit.
The `yoda_style` in the last.

I know the `yoda`-style fixing has a long history about it and some people have strong opinions on it. Please consider two things before commenting about Yoda
- this PR is not meant to determine the Symfony code style, I'm sure Symfony has other channels for these kind of discussions
- if you don't like Yoda style, please consider heading over to https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/2446 and review my PR. If it gets merged you'll have a free tool to change all Yoda expressions in your code to non-Yoda (you can do it around as well as you can see in both PR's).

Thank you for your time!

Commits
-------

3e90138 [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
2017-09-15 11:46:59 +02:00
SpacePossum
3e90138214 [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction 2017-09-15 11:46:57 +02:00
Nicolas Grekas
1e4d4ef888 Merge branch '2.7' into 2.8
* 2.7:
  [Filesystem] mirror - fix copying content with same name as source/target.
  .php_cs.dist - simplify config
  [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2017-09-15 11:26:12 +02:00
Nicolas Grekas
816ad889b1 feature #24193 [FrameworkBundle] Reset stopwatch between requests (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Reset stopwatch between requests

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

Follow-up to #24155. This PR ensures that the stopwatch is reset between requests.

Commits
-------

7c3bdd9 Reset stopwatch.
2017-09-15 10:38:28 +02:00
Fabien Potencier
20be9fe2fe feature #24160 [HttpKernel] Deprecate bundle inheritance (fabpot)
This PR was squashed before being merged into the 3.4 branch (closes #24160).

Discussion
----------

[HttpKernel] Deprecate bundle inheritance

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

Commits
-------

89893c1204 [HttpKernel] deprecated bundle inheritance
ee9f4c3dad fixed CS
2017-09-15 00:29:19 -07:00
Fabien Potencier
89893c1204 [HttpKernel] deprecated bundle inheritance 2017-09-14 20:39:22 -07:00
Fabien Potencier
ee9f4c3dad fixed CS 2017-09-14 19:10:51 -07:00
Fabien Potencier
70bfb50e70 feature #24155 [FrameworkBundle][HttpKernel] Add DI tag for resettable services (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle][HttpKernel] Add DI tag for resettable services

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

This PR uses #24033 to introduce a DI tag for resettable services.

TODO after merge:
* Add an interface, make the "method" attribute optional and enable autoconfiguration.
* Consider adding a config option to enable/disable this feature.
* Configure leaking services of the core bundles as resettable.

Commits
-------

d9a6b76dbd A DI tag for resettable services.
2017-09-14 13:35:56 -07:00
Alexander M. Turek
d9a6b76dbd A DI tag for resettable services. 2017-09-14 22:28:48 +02:00
Alexander M. Turek
7c3bdd9139 Reset stopwatch. 2017-09-14 11:29:18 +02:00
Nicolas Grekas
8b7c7c179b [DI] Fix non-instantiables auto-discovery 2017-09-14 10:50:29 +02:00
Fabien Potencier
30e3b6d27e feature #23625 Feature #23583 Add current and fallback locales in WDT / Profiler (nemoneph)
This PR was merged into the 3.4 branch.

Discussion
----------

Feature #23583  Add current and fallback locales in WDT / Profiler

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

The goal of this PR is to add informations about the locale and the fallback locales in the translation WDT panel / and profiler

Commits
-------

98a8a6c735 Feature #23583  Add current and fallback locales in WDT / Profiler
2017-09-13 09:05:29 -07:00