Commit Graph

44568 Commits

Author SHA1 Message Date
Nicolas Grekas
2f6dc5eed1 [PhpUnitBridge] fix uninitialized variable 2019-09-19 16:48:53 +02:00
Fabien Potencier
b5ff9966fe bug #33632 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631 (k0d3r1s)
This PR was squashed before being merged into the 4.4 branch (closes #33632).

Discussion
----------

[ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33631
| License       | MIT

This fixes exception thrown when trying to render ErrorException as an array

Commits
-------

063dc78b49 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631
2019-09-19 16:05:18 +02:00
k0d3r1s
063dc78b49 [ErrorRenderer] fix Cannot use object of type ErrorException as array exception #33631 2019-09-19 16:05:07 +02:00
Fabien Potencier
5b5b7de660 [Twig] Add missing check 2019-09-19 14:48:09 +02:00
Nicolas Grekas
6bf2dd9ee8 minor #33637 install from source to include components tests (xabbuh)
This PR was squashed before being merged into the 3.4 branch (closes #33637).

Discussion
----------

install from source to include components tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

5aa4328b08 Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
c792908217 install from source to include components tests
2019-09-19 10:05:35 +02:00
Christian Flothmann
5aa4328b08 Revert "bug #33618 fix tests depending on other components' tests (xabbuh)"
This reverts commit 47fb0900fb, reversing
changes made to 6fad4f1215.
2019-09-19 09:17:54 +02:00
Christian Flothmann
c792908217 install from source to include components tests 2019-09-19 09:02:46 +02:00
Yonel Ceruto
85d10114e0 minor #33633 [TwigBridge] Fix undefined constant and other minor issues (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Fix undefined constant and other minor issues

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

/cc @fabpot

Commits
-------

e9e004e Fix undefined constant and other minor issues
2019-09-18 15:23:15 -04:00
Christian Flothmann
672a544e8e Merge branch '4.3' into 4.4
* 4.3:
  ensure compatibility with type resolver 0.5
  Call AssertEquals with proper parameters
  [Twig] Fix Twig config extra keys
  fix tests depending on other components' tests
2019-09-18 20:25:57 +02:00
Yonel Ceruto
e9e004ea07 Fix undefined constant and other minor issues 2019-09-18 14:21:39 -04:00
Christian Flothmann
9d882e8ce2 Merge branch '3.4' into 4.3
* 3.4:
  ensure compatibility with type resolver 0.5
  Call AssertEquals with proper parameters
  [Twig] Fix Twig config extra keys
  fix tests depending on other components' tests
2019-09-18 18:13:55 +02:00
Fabien Potencier
6230465838 feature #33605 [Twig] Add NotificationEmail (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Twig] Add NotificationEmail

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | -

This PR is an extract of the new Notifier component. It's a default template to send standardized emails with the Mailer component, which can be used independently of the Notifier component.

Such emails look like the following:

<img width="618" alt="image" src="https://user-images.githubusercontent.com/47313/65018883-694cb780-d92a-11e9-940a-875ea68f9e5d.png">

More info on SpeakerDeck (be warned that names have change since my presentation): https://speakerdeck.com/fabpot/symfony-notifier?slide=7

It requires Twig 1.12 which should be released later this week.

Usage example:

```php
$email = (new NotificationEmail())
    ->from('fabien@example.com')
    ->to('fabien@example.org')
    ->subject('My first notification email via Symfony')
    ->markdown(<<<EOF
There is a **problem** on your website, you should investigate it right now.
Or just wait, the problem might solves itself automatically, we never know.
EOF
    )
    ->action('More info?', 'https://example.com/')
    ->importance('high')
    //->exception(new \LogicException('That does not work at all...'))
;
```

Instead of `markdown()`, you can also use `content()` for simple emails.

Note that you can use Inky tags in the content:

```php
$email = (new NotificationEmail())
    ->from('fabien@example.com')
    ->to('fabien@example.org')
    ->subject('My first notification email via Symfony')
    ->markdown(<<<EOF
There is a **problem** on your website, you should investigate it right now.
Or just wait, the problem might solves itself automatically, we never know.

Some Title
==========

<center>
    <button href="https://example.com/">Go?</button>
</center>

EOF
);
```

There is also the concept of a theme. By default, it uses the `default` theme,  which is an alias for the `zurb_2` theme.

You can use `setTheme()` to override the theme for a given instance, or override the themes globally via the following config in `twig.yaml`:

```yaml
twig:
    paths:
        templates/email: email
```

Then, create `templates/email/default/notification/body.html.twig` and `templates/email/default/notification/body.txt.twig`. Extends the existing template via `{% extends "@!email/default/notification/body.html.twig" %}` (note  the `!`).

Commits
-------

f6c6cf7dc9 [Twig] Add NotificationEmail
2019-09-18 17:30:43 +02:00
Fabien Potencier
f6c6cf7dc9 [Twig] Add NotificationEmail 2019-09-18 17:08:12 +02:00
Fabien Potencier
47fb0900fb bug #33618 fix tests depending on other components' tests (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix tests depending on other components' tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

cd2f3a6056 fix tests depending on other components' tests
2019-09-18 16:58:24 +02:00
Fabien Potencier
6fad4f1215 bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] ensure compatibility with type resolver 0.5

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

same as #33588 but for the `3.4` branch

Commits
-------

2d708b3e60 ensure compatibility with type resolver 0.5
2019-09-18 16:55:47 +02:00
Fred Cox
643c9ff257 Replace REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR 2019-09-18 17:03:24 +03:00
Christian Flothmann
2d708b3e60 ensure compatibility with type resolver 0.5 2019-09-18 15:36:31 +02:00
Nicolas Grekas
41a450b727 minor #33523 Fix lint commands frozen on empty stdin (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix lint commands frozen on empty stdin

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

Running e.g. `lint:yaml -` with no piped content makes the command hangs currently, this makes it fail instead. Also fixes the command help which we forgot to update

Commits
-------

b60e0c1454 Fix lint commands frozen on empty stdin
2019-09-18 14:09:11 +02:00
Nicolas Grekas
ac7b2b4611 minor #33550 [HttpFoundation] Call AssertEquals with proper parameters (mmokhi)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead (closes #33550).

Discussion
----------

[HttpFoundation] Call AssertEquals with proper parameters

Since `$response->getContent()` returns string and our first parameter is already string as well, in some cases (with different precisions) it may "compare strings" as "strings" and this is not what the test wants.
By changing the first parameter to actual number we force `AssertEquals` to compare them numerically rather than literally by string content.

| Q             | A
| ------------- | ---
| Branch?       | 3.4, 4.3, master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This is yet another catch of this type: https://github.com/symfony/symfony/pull/31612

Commits
-------

6a8ab6cb73 Call AssertEquals with proper parameters
2019-09-18 13:43:50 +02:00
mmokhi
6a8ab6cb73 Call AssertEquals with proper parameters
Since `$response->getContent()` returns string and our first parameter is already string as well, in some cases (with different precisions) it may "compare strings" as "strings" and this is not what the test wants.
By changing the first parameter to actual number we force `AssertEquals` to compare them numerically rather than literally by string content.
2019-09-18 13:43:43 +02:00
Nicolas Grekas
92ef476487 feature #33623 [DependencyInjection] Allow binding iterable and tagged services (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Allow binding iterable and tagged services

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

This will allow:
```yaml
services:
    _defaults:
        bind:
            iterable $rules: !tagged_iterator app.foo.rule
    _instanceof:
        App\Foo\Rule\RuleInterface:
            tags: ['app.foo.rule']
```

Commits
-------

2055a558fe [DependencyInjection] Allow binding iterable and tagged services
2019-09-18 13:27:34 +02:00
Grégoire Pineau
2055a558fe [DependencyInjection] Allow binding iterable and tagged services 2019-09-18 13:00:14 +02:00
Fabien Potencier
212f66827b bug #33620 [Twig] Fix Twig config extra keys (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[Twig] Fix Twig config extra keys

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Instead of `unsetting` keys, I know pass explicitly which key we need (right now, as we don't unset everything, there are a bunch of info passed to Environment that should not be there).

Commits
-------

e2043ff53e [Twig] Fix Twig config extra keys
2019-09-18 10:30:21 +02:00
Fabien Potencier
e2043ff53e [Twig] Fix Twig config extra keys 2019-09-18 10:28:50 +02:00
Christian Flothmann
cd2f3a6056 fix tests depending on other components' tests 2019-09-17 17:53:02 +02:00
Fabien Potencier
1efae63e64 bug #33617 [Console] Fix tests (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fix tests

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

abe11a3024 [Console] Fix tests
2019-09-17 17:01:44 +02:00
Fabien Potencier
abe11a3024 [Console] Fix tests 2019-09-17 16:59:18 +02:00
Fabien Potencier
e6eadae95e bug #33616 Fix wrong namespace (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix wrong namespace

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

0b1946e5fe Fix wrong namespace
2019-09-17 16:48:21 +02:00
Fabien Potencier
0b1946e5fe Fix wrong namespace 2019-09-17 16:46:41 +02:00
Fabien Potencier
e004102756 minor #33586 [Cache][FrameworkBundle] fix tests (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][FrameworkBundle] fix tests

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

b468776b44 fix tests
2019-09-17 13:20:26 +02:00
Fabien Potencier
8ccacab443 minor #33614 New tweaks to the Welcome Page (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

New tweaks to the Welcome Page

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Sorry for the noise! This is hopefully the last pull request related to the Welcome Page design tweaks. This one tweaks some margins, makes it look better on ultra-wide screens and prevents some unwanted horizontal/vertical scrollbars on some browsers.

Commits
-------

2737a00233 New tweaks to the Welcome Page
2019-09-17 13:14:50 +02:00
Fabien Potencier
3c78fde548 Merge branch '4.3' into 4.4
* 4.3:
  [Twig] Remove dead code
  Add gitignore file for Symfony 4.3
  Add gitignore file for Symfony 3.4
  [Inflector] Add .gitignore file
  [Messenger] Fix exception message of failed message is dropped on retry
  Add default value for Accept header
  [HttpClient] Add .gitignore file
  [Finder] Adjust regex to correctly match comments in gitignore contents
  [Security] Removed unused argument in Test
  [Console] Get dimensions from stty on windows if possible
  [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2019-09-17 13:12:18 +02:00
Fabien Potencier
9072ba8b58 Merge branch '3.4' into 4.3
* 3.4:
  [Twig] Remove dead code
  Add gitignore file for Symfony 3.4
  [Inflector] Add .gitignore file
  [Security] Removed unused argument in Test
  [Console] Get dimensions from stty on windows if possible
  [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
2019-09-17 13:12:06 +02:00
Fabien Potencier
d9ce895cee minor #33612 [Twig] Remove dead code (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[Twig] Remove dead code

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

As the min version of Twig is 1.41, we can remove some dead code.

Commits
-------

786d136b5e [Twig] Remove dead code
2019-09-17 13:08:49 +02:00
Javier Eguiluz
2737a00233 New tweaks to the Welcome Page 2019-09-17 13:07:57 +02:00
Fabien Potencier
786d136b5e [Twig] Remove dead code 2019-09-17 12:59:55 +02:00
Fabien Potencier
4c470a9f3f minor #33613 Minor updates in the new Welcome page (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

Minor updates in the new Welcome page

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

After #33510 was merged, there were some concerns about the warning message in the "Welcome Page". It's too low on the page, so it's easy to oversee it.

So, in this PR we propose to make the warning message way more visible and other minor tweaks. This is how it'd look on a smartphone and on a desktop:

![welcome-page](https://user-images.githubusercontent.com/73419/65033926-4af4b500-d946-11e9-9955-a4da60a65762.png)

Commits
-------

4517319e53 Minor updates in the new Welcome page
2019-09-17 12:39:01 +02:00
Javier Eguiluz
4517319e53 Minor updates in the new Welcome page 2019-09-17 12:22:46 +02:00
Fabien Potencier
fa7d74a3a6 minor #33611 Add gitignore file for Symfony 4.3 (ValentineBoineau)
This PR was squashed before being merged into the 4.3 branch (closes #33611).

Discussion
----------

Add gitignore file for Symfony 4.3

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

856b9a8a6e Add gitignore file for Symfony 4.3
2019-09-17 11:54:11 +02:00
Valentine Boineau
856b9a8a6e Add gitignore file for Symfony 4.3 2019-09-17 11:54:03 +02:00
Fabien Potencier
abceda088d minor #33610 Add gitignore file for Symfony 3.4 (ValentineBoineau)
This PR was squashed before being merged into the 3.4 branch (closes #33610).

Discussion
----------

Add gitignore file for Symfony 3.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

16a422b8be Add gitignore file for Symfony 3.4
2019-09-17 11:53:00 +02:00
Valentine Boineau
16a422b8be Add gitignore file for Symfony 3.4 2019-09-17 11:52:54 +02:00
Fabien Potencier
1b62123618 minor #33608 [Inflector] Add .gitignore file (ValentineBoineau)
This PR was merged into the 3.4 branch.

Discussion
----------

[Inflector] Add .gitignore file

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

fdd7ef593e [Inflector] Add .gitignore file
2019-09-17 11:20:03 +02:00
Fabien Potencier
2ae76f9723 bug #33600 [Messenger] Fix exception message of failed message is dropped on retry (tienvx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix exception message of failed message is dropped on retry

| Q             | A
| ------------- | ---
| Branch?       | 4.3 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #32719
| License       | MIT
| Doc PR        | NA <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

8f9f44eb21 [Messenger] Fix exception message of failed message is dropped on retry
2019-09-17 11:16:58 +02:00
Valentine Boineau
fdd7ef593e [Inflector] Add .gitignore file 2019-09-17 10:36:34 +02:00
tien.xuan.vo
8f9f44eb21 [Messenger] Fix exception message of failed message is dropped on retry 2019-09-17 14:04:59 +07:00
Fabien Potencier
23f64d5075 bug #33601 [HttpClient] Add default value for Accept header (numerogeek)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Add default value for Accept header

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #33596 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT

This PR will add an "Accept: *" header when nothing is provided to stick with the behavior of a native curl query or postman query.

Commits
-------

48eebfc77b Add default value for Accept header
2019-09-17 08:33:46 +02:00
geoffrey
48eebfc77b Add default value for Accept header 2019-09-16 21:57:32 +02:00
Fabien Potencier
21a05de9bf feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)
This PR was squashed before being merged into the 4.4 branch (closes #33507).

Discussion
----------

[WebProfiler] Deprecated intercept_redirects in 4.4

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

Deprecated `web_profiler.intercept_redirects` config option in symfony 4.4.

Commits
-------

514c736924 [WebProfiler] Deprecated intercept_redirects in 4.4
2019-09-16 21:21:09 +02:00
Dorel Mardari
514c736924 [WebProfiler] Deprecated intercept_redirects in 4.4 2019-09-16 21:21:02 +02:00