Commit Graph

34596 Commits

Author SHA1 Message Date
Fabien Potencier
b95a05a8c4 bug #25268 [DI] turn $private to protected in dumped container, to make cache:clear BC (nicolas-grekas)
This PR was merged into the 4.0 branch.

Discussion
----------

[DI] turn $private to protected in dumped container, to make cache:clear BC

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

Turning this property to protected changes nothing to its visibility in practice as the class is final anyway,
but when migrating to SF4.0 from 3.4, the `cache:clear` command chokes with "Compile Error: Access level to srcDevDebugProjectContainer::$privates must be protected".

Let's make it protected to remove this WTF.

Commits
-------

c98d967b0c [DI] turn $private to protected in dumped container, to make cache:clear BC
2017-12-04 08:50:56 -08:00
Amrouche Hamza
890edf7c38
[FrameworkBundle] Fix a bug where a color tag will be shown when passing an antislash 2017-12-04 17:41:23 +01:00
Nicolas Grekas
17d84f6a87 [DI] Fix missing unset leading to false-positive circular ref 2017-12-04 17:04:41 +01:00
Nicolas Grekas
eb2a15229a [DI] Fix deep-inlining of non-shared refs 2017-12-04 16:44:12 +01:00
Amrouche Hamza
e8351d8f54
[Workflow] Introduce a Workflow interface 2017-12-04 16:23:01 +01:00
Christian Flothmann
b23b957ae9 parse newlines in quoted multiline strings 2017-12-04 15:51:35 +01:00
Yonel Ceruto
c330965cfb Fix collision between view properties and form fields 2017-12-04 09:06:01 -05:00
Yonel Ceruto
888b48a89c Fix collision between view properties and form fields 2017-12-04 08:54:58 -05:00
Nicolas Grekas
0ec119be88 Merge branch '3.3' into 3.4
* 3.3:
  [SecurityBundle] Fix compat with HttpFoundation >=3.4
2017-12-04 14:34:28 +01:00
Niels Keurentjes
6a2f518e74 Disallow viewing dot-files in Profiler
The file viewer in the profiler should not open files that were meant
to be hidden, like specifically .env files, but similarly files like
.htaccess that might expose server configuration knowledge.
2017-12-04 14:14:51 +01:00
Nicolas Grekas
c9f72e2807 [SecurityBundle] Fix compat with HttpFoundation >=3.4 2017-12-04 13:50:51 +01:00
Nicolas Grekas
5ed5dcf994 Merge branch '4.0'
* 4.0:
  SCA with Php Inspections (EA Extended)
  Add test case for #25264
  Fixed the null value exception case.
  Remove rc/beta suffix from composer.json files
  Ensure services & aliases can be referred to with `__toString`able objects
  Throw an exception is expression language is not installed
  [DI] Cast ids to string, as done on 3.4
  Fail as early and noisily as possible
  [Console][DI] Fail gracefully
  [FrameworkBundle] Fix visibility of a test helper
  [link] clear the cache after linking
  [DI] Trigger deprecation when setting a to-be-private synthetic service
  [Intl] Correct Typehint
  [link] Prevent warnings when running link with 2.7
  [Validator] ExpressionValidator should use OBJECT_TO_STRING to allow value in message
  do not eagerly filter comment lines
  [WebProfilerBundle], [TwigBundle] Fix Profiler breaking XHTML pages (Content-Type: application/xhtml+xml)
2017-12-04 13:32:14 +01:00
Nicolas Grekas
1da85910c7 Merge branch '3.4' into 4.0
* 3.4:
  SCA with Php Inspections (EA Extended)
  Add test case for #25264
  Fixed the null value exception case.
  Remove rc/beta suffix from composer.json files
  Throw an exception is expression language is not installed
  Fail as early and noisily as possible
  [Console][DI] Fail gracefully
  [FrameworkBundle] Fix visibility of a test helper
  [link] clear the cache after linking
  [DI] Trigger deprecation when setting a to-be-private synthetic service
  [link] Prevent warnings when running link with 2.7
  [Validator] ExpressionValidator should use OBJECT_TO_STRING to allow value in message
  do not eagerly filter comment lines
  [WebProfilerBundle], [TwigBundle] Fix Profiler breaking XHTML pages (Content-Type: application/xhtml+xml)
2017-12-04 13:31:58 +01:00
Nicolas Grekas
0b0542d45e bug #25285 [DI] Throw an exception if Expression Language is not installed (sroze)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Throw an exception if Expression Language is not installed

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

The [`PhpDumper` already has this check](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L1688-L1690) but it is missing here.

Commits
-------

75b21e9 Throw an exception is expression language is not installed
2017-12-04 13:20:58 +01:00
Nicolas Grekas
abd76ba4c9 Merge branch '3.3' into 3.4
* 3.3:
  Fail as early and noisily as possible
  [FrameworkBundle] Fix visibility of a test helper
  [link] clear the cache after linking
  [link] Prevent warnings when running link with 2.7
  [Validator] ExpressionValidator should use OBJECT_TO_STRING to allow value in message
  do not eagerly filter comment lines
  [WebProfilerBundle], [TwigBundle] Fix Profiler breaking XHTML pages (Content-Type: application/xhtml+xml)
2017-12-04 13:17:59 +01:00
Nicolas Grekas
5b997f1f21 Merge branch '2.8' into 3.3
* 2.8:
  [FrameworkBundle] Fix visibility of a test helper
  [link] clear the cache after linking
  [link] Prevent warnings when running link with 2.7
  [Validator] ExpressionValidator should use OBJECT_TO_STRING to allow value in message
2017-12-04 13:17:10 +01:00
Nicolas Grekas
874d418a8f Merge branch '2.7' into 2.8
* 2.7:
  [FrameworkBundle] Fix visibility of a test helper
  [link] clear the cache after linking
  [link] Prevent warnings when running link with 2.7
  [Validator] ExpressionValidator should use OBJECT_TO_STRING to allow value in message
2017-12-04 13:15:49 +01:00
Nicolas Grekas
2adb67bb42 minor #24960 SCA with Php Inspections (EA Extended) (kalessil)
This PR was squashed before being merged into the 3.4 branch (closes #24960).

Discussion
----------

SCA with Php Inspections (EA Extended)

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

- Greedy regex characters set fixed
- Potential race-conditions fixed

Commits
-------

4d39a2d SCA with Php Inspections (EA Extended)
2017-12-04 13:09:04 +01:00
Vladimir Reznichenko
4d39a2d8dc SCA with Php Inspections (EA Extended) 2017-12-04 13:09:02 +01:00
Kuba Werłos
369075a282 Fix for missing whitespace control modifier in form layout 2017-12-04 13:08:37 +01:00
Nicolas Grekas
5f5edf26f2 bug #25241 [Yaml] do not eagerly filter comment lines (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[Yaml] do not eagerly filter comment lines

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

Trying to be clever by filtering commented lines inside
`getNextEmbedBlock()` does not work as expected. The `#` may as well be
part of a multi-line quoted string where it must not be treated as the
beginning of a comment. Thus, we only must ensure that a comment-like
line does not skip the process of getting the next line of the embed
block.

Commits
-------

d594038 do not eagerly filter comment lines
2017-12-04 13:05:43 +01:00
Nicolas Grekas
86fb66fedd bug #25284 [DI] Cast ids to string, as done on 3.4 (nicolas-grekas, sroze)
This PR was merged into the 4.0 branch.

Discussion
----------

[DI] Cast ids to string, as done on 3.4

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

As reported on slack, we're now missing cast-to-string.
This PR puts them explicitly at the places where 3.4 has a call to the removed "normalizeId" method.

![2017-12-03 09-25-38](https://user-images.githubusercontent.com/243674/33524777-29f5c716-d823-11e7-8ca3-806e83595f5a.png)

Commits
-------

11c6b38 Ensure services & aliases can be referred to with `__toString`able objects
483dd13 [DI] Cast ids to string, as done on 3.4
2017-12-04 11:39:17 +01:00
Nicolas Grekas
f056b4ef5b minor #25270 Fail as early and noisily as possible (greg0ire)
This PR was merged into the 3.3 branch.

Discussion
----------

Fail as early and noisily as possible

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

An alternative would be to use a custom error handler

Commits
-------

3bdeda0 Fail as early and noisily as possible
2017-12-04 11:36:39 +01:00
Nicolas Grekas
86b0598810 bug #25297 [Validator] Fixed the @Valid(groups={"group"}) against null exception case (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed the @Valid(groups={"group"}) against null exception case

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

When `@Valid(groups={"group"})` has non-empty groups and the value is `null`, validator throws `Cannot validate values of type "NULL" automatically. Please provide a constraint.` at `RecursiveContextualValidator:164`.

I don't really understand, why everything is okay for `@Valid()` without groups, but hope that my fix is correct anyway.

Commits
-------

56f24d0 Fixed the null value exception case.
2017-12-04 11:35:03 +01:00
Nicolas Grekas
8c27dd4851 minor #25302 [DependencyInjection] Add tests to #25264 (Jean85)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] Add tests to #25264

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | adds tests for #25264
| License       | MIT

As asked by @nicolas-grekas in https://github.com/symfony/symfony/issues/25253#issuecomment-348644502, I've added a test about his PR #25264.

Commits
-------

93441c1 Add test case for #25264
2017-12-04 11:34:29 +01:00
Samuel ROZE
561cd7e317 Add tests on the ContainerBag 2017-12-04 10:48:22 +01:00
Alessandro Lai
93441c1a85
Add test case for #25264 2017-12-04 10:23:02 +01:00
Nicolas Grekas
0e18d3ec2b [DI][FrameworkBundle] Add PSR-11 "ContainerBag" to access parameters as-a-service 2017-12-04 09:41:54 +01:00
Fabien Potencier
5b8cf03dcb minor #25292 Remove rc/beta suffix from composer.json files (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove rc/beta suffix from composer.json files

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

We don't need that anymore.

Commits
-------

9fb6a88580 Remove rc/beta suffix from composer.json files
2017-12-03 17:35:40 -08:00
Tobias Schultze
8e7eac60a3 feature #24637 [FrameworkBundle] Improve the DX of TemplateController when using SF 4 (dunglas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] Improve the DX of TemplateController when using SF 4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Tiny DX improvement when using modern Symfony.

Allow to write:

```yaml
# config/routes.yaml
index:
    path: /
    defaults:
      _controller: 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController'
      template: 'homepage.html.twig'
```

Instead of:

```yaml
index:
    path: /
    defaults:
      _controller: 'Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction'
      template: 'homepage.html.twig'
```
I was thinking about doing the same for `RedirectController`, but it's not that easy because it contains two methods.

Commits
-------

6d150550cc [FrameworkBundle] Improve the DX of TemplateController when using SF 4
2017-12-04 02:13:27 +01:00
Valentin
56f24d08c9 Fixed the null value exception case. 2017-12-04 02:10:25 +03:00
Gabriel Ostrolucký
d2c85328bc [Translator] Parse PHP constants in YAML translation files 2017-12-03 23:47:57 +01:00
Gabriel Ostrolucký
b82f301b05 [Serializer] Parse PHP constants in YAML mappings 2017-12-03 23:37:47 +01:00
Gabriel Ostrolucký
6040e5f859 [Routing] Parse PHP constants in YAML routing files 2017-12-03 23:09:33 +01:00
Nicolas Grekas
9fb6a88580 Remove rc/beta suffix from composer.json files 2017-12-03 22:15:09 +01:00
Nicolas Grekas
8cbfa1eaf3 [FrameworkBundle] debug:autowiring: don't list FQCN when they are aliased 2017-12-03 17:25:13 +01:00
Samuel ROZE
11c6b386c6
Ensure services & aliases can be referred to with __toStringable objects 2017-12-03 13:36:40 +00:00
Nicolas Grekas
c98d967b0c [DI] turn $private to protected in dumped container, to make cache:clear BC 2017-12-03 14:10:40 +01:00
Samuel ROZE
75b21e9c86
Throw an exception is expression language is not installed 2017-12-03 13:07:37 +00:00
Nicolas Grekas
483dd134f4 [DI] Cast ids to string, as done on 3.4 2017-12-03 12:09:35 +01:00
Grégoire Paris
3bdeda048b
Fail as early and noisily as possible
Today, I tried using SYMFONY_PHPUNIT_VERSION=6 because I don't really
care about the minor version. I got lots of warnings, followed by
hard-to-understand error messages. This will silence the first warning
and will throw an exception instead.
2017-12-03 00:45:47 +01:00
Fabien Potencier
c927c481aa bug #25255 [Console][DI] Fail gracefully (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console][DI] Fail gracefully

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/flex/issues/212, #25280
| License       | MIT
| Doc PR        | -

I already experienced this issue a few times without spending time digging it:
sometimes, you call `cache:clear`, and the command quits without any output, and with 255 status code.

The reason is the `@include` in `Kernel`, which makes everything silent, especially fatal errors (thanks PHP...)
So if the to-be-removed container is broken for some fatal reason, the failure is really bad.

To fix that, here are two measures:
- use `include_once` instead of `require_once` in the dumped container: that's OK there to actually not immediately load the file, any hard failure will happen later anyway, and any soft failure will allow the `cache:clear` command to complete (like when you remove a package)
- register `Application::renderException()` as the main PHP exception handler, via `Debug::ErrorHandler` when it's available

End result when it fails:
![image](https://user-images.githubusercontent.com/243674/33494543-e1d07202-d6c3-11e7-9677-bc2ae72fbba9.png)

instead of a blank output.

Commits
-------

4a5a3f52ab [Console][DI] Fail gracefully
2017-12-02 15:04:03 -08:00
Nicolas Grekas
4a5a3f52ab [Console][DI] Fail gracefully 2017-12-02 19:20:11 +01:00
Fabien Potencier
a603ba0bee feature #25178 [Routing] Allow to set name prefixes from the configuration (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #25178).

Discussion
----------

[Routing] Allow to set name prefixes from the configuration

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

This allows setting name prefixes to routes while importing them. Typically, we can then import multiple times a similar file. This was originally requested by 🎸 @chrisguitarguy in https://github.com/symfony/symfony/issues/19612

```yaml
app:
    resource: ../controller/routing.yml

api:
    resource: ../controller/routing.yml
    name_prefix: api_
    prefix: /api
```

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://symfony.com/schema/routing
        http://symfony.com/schema/routing/routing-1.0.xsd">

    <import resource="../controller/routing.xml" />
    <import resource="../controller/routing.xml" prefix="/api" name-prefix="api_" />

</routes>
```

Commits
-------

880d7e7436 [Routing] Allow to set name prefixes from the configuration
2017-12-02 08:31:40 -08:00
Samuel ROZE
880d7e7436 [Routing] Allow to set name prefixes from the configuration 2017-12-02 08:31:39 -08:00
Fabien Potencier
6eedbb5660 minor #25271 [FrameworkBundle] Fix visibility of a test helper (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix visibility of a test helper

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

23b5758198 [FrameworkBundle] Fix visibility of a test helper
2017-12-02 08:24:41 -08:00
Kévin Dunglas
23b5758198
[FrameworkBundle] Fix visibility of a test helper 2017-12-02 16:57:48 +01:00
Fabien Potencier
9f1acc1b04 bug #25264 [DI] Trigger deprecation when setting a to-be-private synthetic service (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Trigger deprecation when setting a to-be-private synthetic service

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

Commits
-------

28175767d2 [DI] Trigger deprecation when setting a to-be-private synthetic service
2017-12-01 17:39:23 -08:00
Fabien Potencier
de3a25a474 minor #25257 [link] clear the cache after linking (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #25257).

Discussion
----------

[link] clear the cache after linking

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Clearing the cache after linking prevents fatal errors when a container already exists.

Commits
-------

05c3c81a20 [link] clear the cache after linking
2017-12-01 17:33:23 -08:00
Kévin Dunglas
05c3c81a20 [link] clear the cache after linking 2017-12-01 17:33:21 -08:00