Commit Graph

29600 Commits

Author SHA1 Message Date
Guilhem N
313fec952f [PropertyInfo] Make classes final 2017-02-18 09:10:28 +01:00
Fabien Potencier
d47571f5ec feature #21530 [DependencyInjection] Add "instanceof" section for local interface-defined configs (nicolas-grekas, dunglas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] Add "instanceof" section for local interface-defined configs

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

This is a direction follow up of #21357 on which we're working together with @dunglas. From the description posted there:

There is some work being done to include features of [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle) in the core of Symfony. The goal of all those PRs is to improve the developper experience of the framework, allow to develop faster while preserving all benefits of using Symfony (strictness, modularity, extensibility...) and make it easier to learn for newcomers.

This PR implements the tagging feature of ActionBundle in a more generic way. It will help to get rid of `AppBundle` in the the standard edition and to register automatically some classes including commands.

Here is an example of config (that can be embedded in the standard edition) to enable those features:

```yaml
# config/services.yml
services:
    _defaults:
        autowire: ['get*', 'set*'] # Enable constructor, getter and setter autowiring for all services defined in this file

    _instanceof:
        Symfony\Component\Console\Command: # Add the console.command tag to all services defined in this file having this type
            tags: ['console.command']
            # Set tags but also other settings like "public", "autowire" or "shared" here

        Twig_ExtensionInterface:
            tags: ['twig.extension']

        Symfony\Component\EventDispatcher\EventSubscriberInterface:
            tags: ['kernel.event_subscriber']

    App\: # Register all classes in the src/Controller directory as services
        psr4: ../src/{Controller,Command,Twig,EventSubscriber}
```

It's part of our 0 config initiative: controllers and commands will be automatically registered as services and "autowired", allowing the user to create and inject new services without having to write a single line of YAML or XML.
When refactoring changes are also automatically updated and don't require to update config files. It's a big win for rapid application development and prototyping.

Of course, this is fully compatible with the actual way of defining services and it's possible to switch (or mix) approaches very easily. It's even possible to start prototyping using 0config features then switch to explicit services definitions when the project becomes mature.

Commits
-------

773eca7794 [DependencyInjection] Tests + refacto for "instanceof" definitions
2fb601983f [DependencyInjection] Add "instanceof" section for local interface-defined configs
2017-02-17 10:45:15 -08:00
Kévin Dunglas
773eca7794 [DependencyInjection] Tests + refacto for "instanceof" definitions 2017-02-17 19:36:36 +01:00
Nicolas Grekas
2fb601983f [DependencyInjection] Add "instanceof" section for local interface-defined configs 2017-02-17 19:36:34 +01:00
Fabien Potencier
7259d4e649 feature #21643 [Yaml] deprecate parsing mappings without keys (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] deprecate parsing mappings without keys

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

c02dca3483 [Yaml] deprecate parsing mappings without keys
2017-02-17 08:15:48 -08:00
Christian Flothmann
c02dca3483 [Yaml] deprecate parsing mappings without keys 2017-02-17 16:52:41 +01:00
Christophe Coevoet
0a3cd973ae Merge branch '3.2'
* 3.2:
  consistently parse omitted keys as the colon
  bumped Symfony version to 3.2.5
  updated VERSION for 3.2.4
  update CONTRIBUTORS for 3.2.4
  updated CHANGELOG for 3.2.4
2017-02-17 12:56:33 +01:00
Christophe Coevoet
6ea510f7b4 bug #21647 [Yaml] consistently parse omitted keys as the colon (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

[Yaml] consistently parse omitted keys as the colon

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

Before the changes made in #20335, an empty mapping key was parsed as `:`. This behaviour is not correct according to the spec, but we should keep the parser behaviour consistent to not break backward compatibility (I will deprecate it in a different PR on `master`).

Commits
-------

e2ebecc0cb consistently parse omitted keys as the colon
2017-02-17 12:55:10 +01:00
Christian Flothmann
e2ebecc0cb consistently parse omitted keys as the colon 2017-02-17 11:55:39 +01:00
Nicolas Grekas
444b37d575 bug #21639 [DI] Set getter edges as lazy (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Set getter edges as lazy

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

Fixes tests

Commits
-------

279f6a2 [DI] Set getter edges as lazy
2017-02-17 07:19:49 +01:00
Fabien Potencier
fb8abdc9fc bumped Symfony version to 3.2.5 2017-02-16 16:56:16 -08:00
Fabien Potencier
141569be5b Merge pull request #21640 from fabpot/release-3.2.4
released v3.2.4
2017-02-16 16:00:43 -08:00
Fabien Potencier
d6e241da8f updated VERSION for 3.2.4 2017-02-16 15:59:56 -08:00
Fabien Potencier
2a3f237685 update CONTRIBUTORS for 3.2.4 2017-02-16 15:59:54 -08:00
Fabien Potencier
cbb0328b51 updated CHANGELOG for 3.2.4 2017-02-16 15:59:47 -08:00
Fabien Potencier
d7aec48fa8 Merge branch '3.2'
* 3.2:
  Revert "bug #21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"
  Static code analysis with Php Inspections (EA Extended)
  [VarDumper] Added missing persistent stream cast
  remove unused translation file
  reverted usage of isNan
2017-02-16 14:50:29 -08:00
Fabien Potencier
ea12123bcf Merge branch '2.8' into 3.2
* 2.8:
  Revert "bug #21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"
  Static code analysis with Php Inspections (EA Extended)
  [VarDumper] Added missing persistent stream cast
2017-02-16 14:46:52 -08:00
Fabien Potencier
f53672f82b Merge branch '2.7' into 2.8
* 2.7:
  Revert "bug #21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"
  Static code analysis with Php Inspections (EA Extended)
  [VarDumper] Added missing persistent stream cast
2017-02-16 14:43:37 -08:00
Nicolas Grekas
279f6a2512 [DI] Set getter edges as lazy 2017-02-16 23:39:11 +01:00
Fabien Potencier
68d6415955 Revert "bug #21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)"
This reverts commit 3441b1586f, reversing
changes made to d1f4cb27fd.
2017-02-16 14:39:07 -08:00
Fabien Potencier
a5c099c829 minor #21537 Static code analysis with Php Inspections (EA Extended) (kalessil)
This PR was squashed before being merged into the 2.7 branch (closes #21537).

Discussion
----------

Static code analysis with Php Inspections (EA Extended)

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

- Unnecessary proxy methods and methods duplicating  parents ones removed;
- Type casings instead of PHP4 functions;
- Usage of copy instead of file combining file get/put contents;
- One time use variables cleaned up;
- Superfluous functions calls in loop termination conditions fixed;

Commits
-------

3feeca74d0 Static code analysis with Php Inspections (EA Extended)
2017-02-16 14:27:03 -08:00
Vladimir Reznichenko
3feeca74d0 Static code analysis with Php Inspections (EA Extended) 2017-02-16 14:26:15 -08:00
Fabien Potencier
8f65fc7ec1 minor #21636 fixed test (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

fixed test

Commits
-------

2d67c0653e fixed test
2017-02-16 13:52:43 -08:00
Fabien Potencier
2d67c0653e fixed test 2017-02-16 13:29:17 -08:00
Fabien Potencier
38490dac21 bug #21634 [VarDumper] Added missing persistent stream cast (lyrixx)
This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Added missing persistent stream cast

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

Commits
-------

cab9f7eb8f [VarDumper] Added missing persistent stream cast
2017-02-16 11:29:17 -08:00
Grégoire Pineau
cab9f7eb8f [VarDumper] Added missing persistent stream cast 2017-02-16 18:03:48 +01:00
Fabien Potencier
1639edbb19 minor #21633 [Security] remove unused translation file (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

[Security] remove unused translation file

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

With Symfony 3, translation files have been moved to the Security Core
component.

Commits
-------

ea0c1cd6e7 remove unused translation file
2017-02-16 09:01:17 -08:00
Christian Flothmann
ea0c1cd6e7 remove unused translation file
With Symfony 3, translation files have been moved to the Security Core
component.
2017-02-16 17:54:26 +01:00
Fabien Potencier
c24c4d544d reverted usage of isNan 2017-02-16 08:34:18 -08:00
Fabien Potencier
c5bdfc542d minor #21631 [DI] Don't try to instantiate reflection class if it doesn't exist (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Don't try to instantiate reflection class if it doesn't exist

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Introduced in https://github.com/symfony/symfony/pull/21419 so master only.
It breaks on bundles that ~~do not use the convention for naming their `Configuration`~~ do not have configuration, e.g. SecurityBundle's FirewallEntryPointExtension for which tests are actually broken (see travis).

Commits
-------

f9b917a60a [DI] Don't instantiate unexisting reflection class
2017-02-16 07:56:23 -08:00
Fabien Potencier
b5c6766b2d reverted usage of isNan 2017-02-16 07:37:45 -08:00
Fabien Potencier
e090b85af3 feature #20677 [DX][SecurityBundle] UserPasswordEncoderCommand: ask user class choice question (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DX][SecurityBundle] UserPasswordEncoderCommand: ask user class choice question

| 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

Typing the user class is quite annoying so I'd suggest to ask the user to select it using a choice question.

This changes however requires to inject configured encoders' user classes. Making the command a service and providing it in the constructor from the extension is probably the cleanest way, but it deprecates:

-  registering the command by convention (registered as a service now, so potential commands extending this one should do the same)
-  relying on the fact the command extends `ContainerAwareCommand` and implements `ContainerAwareInterface` (will not extends/implements it anymore in 4.0 because it's not required anymore)

Commits
-------

366aefd75f [SecurityBundle] UserPasswordEncoderCommand: ask user class choice question
2017-02-16 07:35:46 -08:00
Maxime Steinhausser
366aefd75f [SecurityBundle] UserPasswordEncoderCommand: ask user class choice question 2017-02-16 16:01:42 +01:00
Robin Chalas
f9b917a60a [DI] Don't instantiate unexisting reflection class 2017-02-16 15:59:55 +01:00
Fabien Potencier
c3230f0a97 minor #20896 [Console] Enhance MarkdownDescriptor (ogizanagi)
This PR was squashed before being merged into the 3.3-dev branch (closes #20896).

Discussion
----------

[Console] Enhance MarkdownDescriptor

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

In order to add usefulness to this descriptor, this PR allows to jump to a command description by clicking on the command name on the application summary.

It's not a generic approach but IMHO a quick win that should work at least for Github flavoured markdown.

The markdown format should also avoid using `Application::getLongVersion` as the markdown document title, as it may contain tags (and unnecessary information using the framework).

Lastly, the markdown format is now cleaned from tags initially used for console output formatting and only keeps properly escaped ones.

Commits
-------

ef5b087b4f Do not output formatting tags
6896865bcc [Console] MarkdownDescriptor: Don't use getLongVersion
fc2395e237 [Console] MarkdownDescriptor: Link to commands anchors
2017-02-16 06:18:56 -08:00
Fabien Potencier
6580a49706 Merge branch '3.2'
* 3.2:
  Permit empty suffix on Windows
  fixed CS
  [FrameworkBundle] Remove unused import
  [Console][Table] fixed render when using multiple rowspans.
  add docblocks for Twig url and path function to improve ide completion
  check for circular refs caused by method calls
  [Serializer] fix upper camel case conversion (see #21399)
  [DI] Auto register extension configuration classes as a resource
  [Console] Updated phpdoc on return types
2017-02-16 06:15:30 -08:00
Fabien Potencier
b3ba37d862 Merge branch '2.8' into 3.2
* 2.8:
  Permit empty suffix on Windows
  [Console][Table] fixed render when using multiple rowspans.
  add docblocks for Twig url and path function to improve ide completion
  check for circular refs caused by method calls
  [Serializer] fix upper camel case conversion (see #21399)
  [DI] Auto register extension configuration classes as a resource
  [Console] Updated phpdoc on return types
2017-02-16 06:07:22 -08:00
Fabien Potencier
e103e1d1db Merge branch '2.7' into 2.8
* 2.7:
  Permit empty suffix on Windows
  [Console][Table] fixed render when using multiple rowspans.
  add docblocks for Twig url and path function to improve ide completion
  check for circular refs caused by method calls
  [Serializer] fix upper camel case conversion (see #21399)
  [DI] Auto register extension configuration classes as a resource
  [Console] Updated phpdoc on return types
2017-02-16 06:06:24 -08:00
Fabien Potencier
3860b0b392 optimized code 2017-02-16 05:36:15 -08:00
Fabien Potencier
02166d0101 fixed CS 2017-02-16 05:35:07 -08:00
Fabien Potencier
923d50b625 feature #21283 [Form][FrameworkBundle] Move FormPass to the Form component (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form][FrameworkBundle] Move FormPass to the Form component

| 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

So that anyone using only Form and DI can use it for registering form types/type guessers.
Follows #19443, related to #21284

Commits
-------

e68a6d963c [FrameworkBundle][Form] Move FormPass to the Form component
2017-02-16 05:34:28 -08:00
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
3441b1586f bug #21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] check for circular refs caused by method calls

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

Before we check for circular references, dependencies coming from method calls are not part of the dependency graph. That why the pass is not able to detect circular references like the one described in #19362 during compilation of the container.

If we add another check after all the optimisation passes have been processed, we should be able to detect these circular references too.

Commits
-------

fe4f7eccf7 check for circular refs caused by method calls
2017-02-16 05:23:11 -08:00
Fabien Potencier
d1f4cb27fd bug #21400 [Serializer] fix upper camel case conversion (see #21399) (markusu49)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] fix upper camel case conversion (see #21399)

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

Improve upper camel case support of CamelCaseToSnakeCaseConverter (`ThisIsATest` now converts to `this_is_a_test` instead of `_this_is_a_test`).

Commits
-------

81e771ca1a [Serializer] fix upper camel case conversion (see #21399)
2017-02-16 05:20:16 -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
be854e16d5 bug #21599 [Console][Table] fixed render when using multiple rowspans. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console][Table] fixed render when using multiple rowspans.

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

Commits
-------

17e459e688 [Console][Table] fixed render when using multiple rowspans.
2017-02-16 04:36:16 -08:00
Fabien Potencier
1901432c57 bug #21613 [Process] Permit empty suffix on Windows (Bilge)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21613).

Discussion
----------

[Process] Permit empty suffix on Windows

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

It is a fallacy to assume the blank suffix is not applicable on Windows systems, especially in a world where we often emulate Linux systems with solutions such as CYGWIN, MinGW and MSYS.

Commits
-------

412db4ca51 Permit empty suffix on Windows
2017-02-16 04:33:38 -08:00
Bilge
412db4ca51 Permit empty suffix on Windows 2017-02-16 04:33:37 -08:00