Commit Graph

32117 Commits

Author SHA1 Message Date
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
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
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
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
8b7c7c179b [DI] Fix non-instantiables auto-discovery 2017-09-14 10:50:29 +02: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
Alexander M. Turek
d1f7024e14 Removed unnecessary getDefinition() call. 2017-09-13 15:44:19 +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
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
Fabien Potencier
56bf80760a minor #24174 [Routing] Cleanup apache fixtures (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[Routing] Cleanup apache fixtures

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

The apache dumper has been removed already.

Commits
-------

f1ab3b28ac [Routing] Cleanup apache fixtures
2017-09-12 10:58:27 -07:00
Nicolas Grekas
f1ab3b28ac [Routing] Cleanup apache fixtures 2017-09-12 18:00:24 +02:00
Nicolas Grekas
cd8374586b minor #24163 .php_cs.dist - simplify config (keradus)
This PR was merged into the 2.7 branch.

Discussion
----------

.php_cs.dist - simplify config

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

dropped configuration is already part of `@Symfony` ruleset

Commits
-------

4ea681e .php_cs.dist - simplify config
2017-09-12 08:56:20 +02:00
Fabien Potencier
fc30d5b0cf bug #24162 [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces

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

Commits
-------

10204ffe99 [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2017-09-11 15:35:04 -07:00
Dariusz
4ea681e7d1 .php_cs.dist - simplify config 2017-09-12 00:23:36 +02:00
Fabien Potencier
ceae3bf16c fixed CS 2017-09-11 14:23:01 -07:00
Fabien Potencier
ebfb24070c Merge branch '2.8' into 3.3
* 2.8:
  fixed CS
2017-09-11 14:11:44 -07:00
Fabien Potencier
df07e73363 fixed CS 2017-09-11 14:10:59 -07:00
Fabien Potencier
10204ffe99 [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces 2017-09-11 13:58:31 -07:00
Fabien Potencier
e844b640de Merge branch '2.8' into 3.3
* 2.8:
  [CS] Apply phpdoc_annotation_without_dot
2017-09-11 13:43:11 -07:00
Fabien Potencier
4e1c65c6f9 Merge branch '2.7' into 2.8
* 2.7:
  [CS] Apply phpdoc_annotation_without_dot
2017-09-11 13:39:16 -07:00
Fabien Potencier
687ad65d82 minor #24149 [CS] Apply phpdoc_annotation_without_dot (keradus)
This PR was squashed before being merged into the 2.7 branch (closes #24149).

Discussion
----------

[CS] Apply phpdoc_annotation_without_dot

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

Rule was manually applied here : https://github.com/symfony/symfony/pull/19198
In same PR, fixer for this rule was requested, later implementation was approved by Symfony in https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/2020 .

Rule is converting single sentence to not a sentence, dropping final dot and lowercasing first word.
If there are multiple sentences, it doesn't make any changes.

Status quo is that some annotation are in the middle - having first word uppercased, but no final stop.
Let us fix grammar by finishing applying the rule.

If, for some reason, you don't want to follow that rule that was requested by Symfony, please provide reasoning. If it's to some edge-case bug, simply raise that bug issue. If due to some other reasons, please send a PR to drop it from `@Symfony` ruleset.

Info: I did manually reviewed every single change of this PR.

Commits
-------

7a97b49436 [CS] Apply phpdoc_annotation_without_dot
2017-09-11 13:37:54 -07:00
Dariusz
7a97b49436 [CS] Apply phpdoc_annotation_without_dot 2017-09-11 13:37:52 -07:00
Fabien Potencier
9570a454ef bumped Symfony version to 3.3.10 2017-09-11 09:45:56 -07:00
Fabien Potencier
a9d2f68ae9 Merge pull request #24156 from fabpot/release-3.3.9
released v3.3.9
2017-09-11 09:13:42 -07:00
Fabien Potencier
b9c93f1faa updated VERSION for 3.3.9 2017-09-11 09:13:23 -07:00
Fabien Potencier
4fa6fcfb93 updated CHANGELOG for 3.3.9 2017-09-11 09:13:13 -07:00
Fabien Potencier
51af90e042 Merge branch '2.8' into 3.3
* 2.8:
  [DomCrawler] Fix conversion to int on GetPhpFiles
  Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 08:55:22 -07:00
Fabien Potencier
400263a39d Merge branch '2.7' into 2.8
* 2.7:
  [DomCrawler] Fix conversion to int on GetPhpFiles
  Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 08:55:02 -07:00
Fabien Potencier
bcfe152113 bug #24141 [DomCrawler] Fix conversion to int on GetPhpFiles (MaraBlaga)
This PR was merged into the 2.7 branch.

Discussion
----------

[DomCrawler] Fix conversion to int on GetPhpFiles

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

We've encountered that when using the DomCrawler with the UploadedFile, everything gets converted into strings. We've addressed the issue, and made sure that the attributes in the UploadedFile respects their type.

The code below demonstrates the problem.

```<?php
require 'vendor/autoload.php';
require 'app/AppKernel.php';
$crawler = new \Symfony\Component\DomCrawler\Crawler(
    '<form method="post"><input type="file" name="image"/></form>',
    'http://www.example.com'
);
$form = $crawler->filter('form')->form();
$form['image'] = new \Symfony\Component\HttpFoundation\File\UploadedFile(
    'path/to/file',
    'foo',
    'text/plain',
    100
);

$client = new \Symfony\Bundle\FrameworkBundle\Client(new AppKernel('test', true));
$crawler = $client->submit($form);

var_dump($client->getRequest()->files->get('image')->getClientSize());  //returns string, not int
echo 'Done.' . PHP_EOL;

Commits
-------

122da5add5 [DomCrawler] Fix conversion to int on GetPhpFiles
2017-09-11 08:48:47 -07:00
Mara Blaga
122da5add5 [DomCrawler] Fix conversion to int on GetPhpFiles 2017-09-11 15:10:51 +01:00
Fabien Potencier
47871c995f bug #23853 Filtering empty uuids in ORMQueryBuilderLoader. (mlazovla)
This PR was merged into the 2.7 branch.

Discussion
----------

Filtering empty uuids in ORMQueryBuilderLoader.

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

Commits
-------

27e8cd289c Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 05:33:33 -07:00
Nicolas Grekas
7b7a69f6ff minor #24136 [CS] Remove protected_to_private rule (SpacePossum)
This PR was merged into the 3.3 branch.

Discussion
----------

[CS] Remove `protected_to_private` rule

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

Following:
https://github.com/symfony/symfony/pull/24123#issuecomment-328031180

I picked 3.1 as target as the rule discussed;

| branch | hits
| --------- | ---
| 2.7 | 0
| 2.8 | 0
| 3.0 | 0
| 3.1 | 1
| master |  1 hit (same file as on 3.1)

Commits
-------

bfae454 Remove `protected_to_private` rule.
2017-09-11 08:35:02 +02:00
SpacePossum
bfae454968 Remove protected_to_private rule. 2017-09-11 08:26:46 +02:00
Nicolas Grekas
483a274994 Merge branch '2.8' into 3.3
* 2.8:
  Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)"
  [Filesystem] skip tests if not applicable
  [Fabbot] Do not run php-cs-fixer if there are no change in src/
  [Security] Fix exception when use_referer option is true and referer is not set or empty
  Get KERNEL_DIR through $_ENV too for KernelTestCase
  check permissions if dump target dir is missing
2017-09-11 07:57:23 +02:00
Fabien Potencier
d6dfb5b4e3 Merge branch '2.7' into 2.8
* 2.7:
  Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)"
  [Filesystem] skip tests if not applicable
  [Fabbot] Do not run php-cs-fixer if there are no change in src/
  [Security] Fix exception when use_referer option is true and referer is not set or empty
  Get KERNEL_DIR through $_ENV too for KernelTestCase
  check permissions if dump target dir is missing
2017-09-08 18:12:52 -07:00
Fabien Potencier
7793b797af Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)"
This reverts commit d74144fc0b, reversing
changes made to 2b79f48405.
2017-09-08 18:12:06 -07:00
Nicolas Grekas
3145006053 minor #24137 [Filesystem] skip tests if not applicable (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] skip tests if not applicable

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

1605ce1 [Filesystem] skip tests if not applicable
2017-09-08 16:53:30 +02:00
Christian Flothmann
1605ce1f07 [Filesystem] skip tests if not applicable 2017-09-08 16:43:09 +02:00
Fabien Potencier
9a6e83af16 minor #24139 [Fabbot] Do not run php-cs-fixer if there are no change in src/ (lyrixx)
This PR was merged into the 2.7 branch.

Discussion
----------

[Fabbot] Do not run php-cs-fixer if there are no change in src/

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | kind of
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/24136#issuecomment-328057076
| License       | MIT
| Doc PR        | -

Commits
-------

3eb79e5197 [Fabbot] Do not run php-cs-fixer if there are no change in src/
2017-09-08 06:57:11 -07:00