Commit Graph

32627 Commits

Author SHA1 Message Date
Christian Flothmann
893df5804e deprecate relative paths in makePathRelative() 2017-09-18 10:06:42 +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
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
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
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
Fabien Potencier
5bf241aa8e bug #23473 [Filesystem] mirror - fix copying content with same name as source/target. (gitlost)
This PR was squashed before being merged into the 2.7 branch (closes #23473).

Discussion
----------

[Filesystem] mirror - fix copying content with same name as source/target.

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

Uses `substr()` and lengths in `Filesystem::mirror()` rather than `str_replace()` to avoid multiple replacements.

Commits
-------

b524c84ce1 [Filesystem] mirror - fix copying content with same name as source/target.
2017-09-13 09:02:25 -07:00
gitlost
b524c84ce1 [Filesystem] mirror - fix copying content with same name as source/target. 2017-09-13 09:02:23 -07:00
Fabien Potencier
0256e5981c minor #24186 [EventDispatcher] Removed unnecessary getDefinition() call from RegisterListenersPass (derrabus)
This PR was merged into the 3.3 branch.

Discussion
----------

[EventDispatcher] Removed unnecessary getDefinition() call from RegisterListenersPass

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

In `RegisterListenersPass`, the definition of each tagged listener service is pulled from the builder although it is never used. This PR removes the line of code where this happens.

Commits
-------

d1f7024e14 Removed unnecessary getDefinition() call.
2017-09-13 07:16:15 -07:00
Fabien Potencier
76ccce7464 feature #24179 [TwigBundle] Add default templates directory and option to configure it (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] Add default templates directory and option to configure it

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

Feature freeze is coming so this one should be important for the new structure. Moving forward and alternative of https://github.com/symfony/symfony/pull/23339 but I'm proposing `templates/bundles/<BundleName>` instead of `templates/bundles/<BundleTwigNamespace>` to override bundles templates and easy migration from current `app/Resources/<BundleName>/views` convention. Also this fix the pending comments.

Summary:
 * Added new option to configure default path for templates directory:
```yaml
twig:
    default_path: '%kernel.project_dir%/templates' # default
```
 * Added new path convention to override bundle templates  `<default_path>/bundles/<BundleName>`:
```
# Examples:
templates/bundles/TwigBundle/Exception/error.html.twig - @Twig/Exception/error.html.twig
templates/bundles/FOSUserBundle/layout.html.twig - @FOSUser/layout.html.twig
```

Current templates in `<kernel.root_dir>/Resources/<BundleName>/views` have priority over the new one, and both have priority over the bundle `views` path.

Commits
-------

a1b391fb00 Add default templates directory and option to configure it
2017-09-13 07:15:26 -07:00
Alexander M. Turek
d1f7024e14 Removed unnecessary getDefinition() call. 2017-09-13 15:44:19 +02:00
Yonel Ceruto
a1b391fb00 Add default templates directory and option to configure it 2017-09-13 09:15:32 -04:00
Nicolas Grekas
005cf6b463 Merge branch '3.3' into 3.4
* 3.3:
  Fix travis php7.0
  Add support to environment variables APP_ENV/DEBUG in KernelTestCase
  [Routing] Cleanup apache fixtures
2017-09-13 13:45:41 +02:00
Nicolas Grekas
19e5ed1bcf Merge branch '2.8' into 3.3
* 2.8:
  Fix travis php7.0
2017-09-13 13:42:46 +02:00
Nicolas Grekas
86eb10c413 Fix travis php7.0 2017-09-13 13:41:56 +02:00
Nicolas Grekas
30a13baef3 fix oups 2017-09-13 13:33:28 +02:00
Nicolas Grekas
2df1cbc675 bug #24184 [DI] Resolve nested refs to aliases (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Resolve nested refs to aliases

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

Required now that we have most services private. Should make tests green again.

Commits
-------

8729f9f [DI] Resolve nested refs to aliases
2017-09-13 13:28:54 +02:00
Nicolas Grekas
8729f9fd6a [DI] Resolve nested refs to aliases 2017-09-13 13:21:02 +02:00
Nicolas Grekas
306bd48ac1 feature #24104 Make as many services private as possible (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Make as many services private as possible

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

- [x] review the list of currently public services and validate which one should be turned private (noted as such with the `container.private` tag in this PR)
- [x] rebase on top of #24103
- [x] implement the behavior described in https://github.com/symfony/symfony/issues/23822#issuecomment-327208485
- [x] add tests

List of services that will be kept public:

### Remaining public aliases

cache.app_clearer <- for the cache:pool:clear command to clear app pools
$commandId <- for non-lazy commands which are get() at runtime
router <- for the base controller
templating <- for the base controller

### Remaining public services

test.client <- for WebTestCase
security.password_encoder <- for use in ContainerAware classes
security.authentication_utils <- for use in ContainerAware classes
filesystem <- for use in ContainerAware classes
kernel <- for use in ContainerAware classes
translator <- for use in ContainerAware classes
validator <- for use in ContainerAware classes
cache_clearer <- for the cache:clear command
cache_warmer <- required to bootstrap the kernel
cache.app <- for userland only
cache.global_clearer <- for the cache:pool:clear command to clear all pools
cache.system <- for userland only
data_collector.dump <- required to have dump() work very early when booting the kernel
event_dispatcher <- required to wire console apps
form.factory <- for the base controller
http_kernel <- required to bootstrap the kernel
profiler <- used in tests
request_stack <- for the base controller
routing.loader <- used by routing
security.authorization_checker <- for the base controller
security.csrf.token_manager <- for the base controller
security.token_storage <- for the base controller
serializer <- for the base controller
session <- for the base controller
state_machine.abstract <- userland state machines
workflow.abstract <- userland workflows
twig <- for the base controller
twig.controller.exception <- controllers referenced by routing
twig.controller.preview_error <- controllers referenced by routing
var_dumper.cloner <- required to have dump() work very early when booting the kernel
web_profiler.controller.exception <- controllers referenced by routing
web_profiler.controller.profiler <- controllers referenced by routing
web_profiler.controller.router <- controllers referenced by routing

Commits
-------

1936491 Make as many services private as possible
2017-09-13 10:34:42 +02:00
Nicolas Grekas
1936491f9b Make as many services private as possible 2017-09-13 09:59:43 +02:00
Nicolas Grekas
3f4c47c23c bug #24177 [FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase (yceruto)
This PR was merged into the 3.3 branch.

Discussion
----------

[FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase

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

/cc @fabpot

Commits
-------

8d56744 Add support to environment variables APP_ENV/DEBUG in KernelTestCase
2017-09-13 09:26:10 +02:00
Yonel Ceruto
8d5674480f Add support to environment variables APP_ENV/DEBUG in KernelTestCase 2017-09-12 18:52:39 -04:00