Commit Graph

21442 Commits

Author SHA1 Message Date
Tobias Schultze
d4b669bb63 minor #14890 [2.3] Static Code Analysis for Components (kalessil)
This PR was squashed before being merged into the 2.3 branch (closes #14890).

Discussion
----------

[2.3] Static Code Analysis for Components

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

Static Code Analysis with Php Inspections (EA Extended):
    - not optimal regular expressions usage
    - strlen miss-use
    - not optimal conditional statements in Process and Filesystem
    - unsafe uniquid usage

PS: re-creating to no spam history log with reverts

Commits
-------

4a4fea7 [2.3] Static Code Analysis for Components
2015-06-15 15:02:12 +02:00
Vladimir Reznichenko
4a4fea742b [2.3] Static Code Analysis for Components 2015-06-15 15:02:08 +02:00
Iltar van der Berg
ade1fef3ae Added a small Upgrade note regarding security.context 2015-06-15 08:46:44 +02:00
Fabien Potencier
ddddeb5a24 added missing deprecation in CHANGELOG 2015-06-14 19:35:57 +02:00
Fabien Potencier
94c7b25ceb bug #14974 [2.6][Security][Translation] #14920 update translations (vincentaubert)
This PR was merged into the 2.6 branch.

Discussion
----------

[2.6][Security][Translation] #14920 update translations

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

Commits
-------

dfd3e62 [2.6][Security][Translation] #14920 update translations
2015-06-14 18:51:06 +02:00
Vincent AUBERT
dfd3e62dc3 [2.6][Security][Translation] #14920 update translations 2015-06-14 13:45:05 +02:00
Tobias Schultze
11010ca691 minor #14965 [Config] Remove duplicated paths (dosten)
This PR was merged into the 2.3 branch.

Discussion
----------

[Config] Remove duplicated paths

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

If someone sets the same path twice, the file locator will search for the the same file twice. We should remove duplicated paths before locate a file.

Commits
-------

97de887 Remove duplicated paths
2015-06-13 16:06:26 +02:00
Diego Saint Esteben
97de887222 Remove duplicated paths 2015-06-12 16:45:17 -03:00
Abdellatif Ait boudad
c907f8cb04 [WebProfilerBundle][logger] remove duplicated deprecation message 2015-06-12 19:24:25 +00:00
Fabien Potencier
d209d1c35a bug #14950 [Form] Fixed: Filter non-integers when selecting entities by int ID (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed: Filter non-integers when selecting entities by int ID

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14583 (for Doctrine, not Propel)
| License       | MIT
| Doc PR        | -

This PR fixes #14583 for Doctrine. Non-integer values (like `""`) are not passed to the database anymore when selecting entities by integer PK, which causes an error on some DBMSs (like PostgreSQL).

Commits
-------

352be8e [Form] Fixed: Filter non-integers when selecting entities by int ID
2015-06-12 17:08:08 +02:00
Bernhard Schussek
352be8e571 [Form] Fixed: Filter non-integers when selecting entities by int ID 2015-06-12 10:52:26 +02:00
Nicolas Grekas
edf793ead2 [VarDumper] Cherry-pick code style fixes from 2.7 2015-06-12 10:17:57 +02:00
Fabien Potencier
88e99d2244 bug #14930 Bug #14836 [HttpFoundation] Moves default JSON encoding assignment fr… (Incognito)
This PR was submitted for the master branch but it was merged into the 2.6 branch instead (closes #14930).

Discussion
----------

Bug #14836 [HttpFoundation] Moves default JSON encoding assignment fr…

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #14918, #14836
| License       | MIT
| Doc PR        | no

Moves the assignment of the encoding flags to a property so the class can be extended without needing to re-write the constructor and perform the encoding of data twice.

For more information please see https://github.com/symfony/symfony/issues/14836

Commits
-------

25e0d63 Bug #14836 [HttpFoundation] Moves default JSON encoding assignment from constructor to property
2015-06-12 00:49:26 +02:00
Brian Graham
25e0d630b8 Bug #14836 [HttpFoundation] Moves default JSON encoding assignment from constructor to property 2015-06-12 00:49:26 +02:00
Fabien Potencier
58f1420722 bumped Symfony version to 2.7.2 2015-06-12 00:37:12 +02:00
Fabien Potencier
932b6e7499 updated VERSION for 2.7.1 2015-06-11 23:15:28 +02:00
Fabien Potencier
727be373d2 updated CHANGELOG for 2.7.1 2015-06-11 23:14:30 +02:00
Fabien Potencier
72782bb7e5 minor #14940 Documented minor BC break introduced in AssetHelper (peterrehm)
This PR was squashed before being merged into the 2.7 branch (closes #14940).

Discussion
----------

Documented minor BC break introduced in AssetHelper

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

This should be an easy fix. As this AssetHelper is removed in 3.0 I think no correction for 3.0 would be needed.

Commits
-------

777dc45 Documented minor BC break introduced in AssetHelper
2015-06-11 21:15:31 +02:00
Peter Rehm
777dc4553a Documented minor BC break introduced in AssetHelper 2015-06-11 21:15:29 +02:00
Fabien Potencier
83bdaa5c0e bug #14835 [DependencyInjection] Fixed resolving of service configurators containing Definition objects (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] Fixed resolving of service configurators containing Definition objects

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

Commits
-------

6ebcddd [DependencyInjection] Fixed resolving of service configurators containing Definition objects
2015-06-11 21:13:11 +02:00
Fabien Potencier
da02fceb26 bug #14816 [TwigBridge] Make AppVariable check if security.context exists (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] Make AppVariable check if security.context exists

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

If security isn't configured in the application, neither the `security.context` service, nor the `security.token_storage` service exists.

Therefore, if a third-party bundle relies on the `app.user` or `app.security` (deprecated) check in Twig templates, an exception was thrown about asking for an non-existing service:

```yml
security: false
```

```twig
{% if app.user %}
    <div>
        ...
    </div>
{% endif %}
```
```
You have requested a non-existent service "security.context"
```

Instead, this patch checks if the `security.context` actually exists before trying to use it, and returns null otherwise.

Note that the **GlobalVariables** class, used for twig app globals in previous versions, and still used for PHP templating, behaves the same way.
So this is basically a BC break.

Commits
-------

ea71174 [TwigBridge] Make AppVariable check if security.context exists
2015-06-11 21:11:23 +02:00
Fabien Potencier
7ac7ed85af fixed CS 2015-06-11 21:09:58 +02:00
Fabien Potencier
58fba34843 minor #14883 [2.7] Improved exception message if custom implementation of OptionsResolverInterface is used (phansys)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Improved exception message if custom implementation of OptionsResolverInterface is used

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

Improved exception message if custom implementation of ```OptionsResolverInterface``` is used within ```AbstractType::setDefaultOptions()``` or ```AbstractTypeExtension::setDefaultOptions()```.

Before:
```
Argument 1 passed to Symfony\Component\Form\AbstractType::configureOptions() must be an instance of Symfony\Component\OptionsResolver\OptionsResolver, instance of Symfony\Component\Form\Tests\Fixtures\CustomOptionsResolver given
```

After:
```
Argument 1 passed to Symfony\Component\Form\AbstractType::setDefaultOptions() must be an instance of Symfony\Component\OptionsResolver\OptionsResolver, instance of Symfony\Component\Form\Tests\Fixtures\CustomOptionsResolver given
```

Commits
-------

aa945d3 [2.7] Improved exception message if custom implementation of ```OptionsResolverInterface``` is used
2015-06-11 21:07:54 +02:00
Javier Spagnoletti
aa945d355f [2.7] Improved exception message if custom implementation of ``OptionsResolverInterface`` is used
| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Improved exception message if custom implementation of ```OptionsResolverInterface```
is used within ```AbstractType::setDefaultOptions()``` or ```AbstractTypeExtension::setDefaultOptions()```.

Before:
```
Argument 1 passed to Symfony\Component\Form\AbstractType::configureOptions() must be an instance of Symfony\Component\OptionsResolver\OptionsResolver, instance of Symfony\Component\Form\Tests\Fixtures\CustomOptionsResolver given
```

After:
```
Argument 1 passed to Symfony\Component\Form\AbstractType::setDefaultOptions() must be an instance of Symfony\Component\OptionsResolver\OptionsResolver, instance of Symfony\Component\Form\Tests\Fixtures\CustomOptionsResolver given
```
2015-06-11 15:21:12 -03:00
Diego Saint Esteben
dbfca37703 [Config] Add deprecation warning
If someone extends FileLoader and do not call the parent constructor a
deprecation warning should be triggered.
2015-06-11 14:55:28 -03:00
Fabien Potencier
beeba9d62a minor #14886 [Routing] improved message for deprecated requirements (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] improved message for deprecated requirements

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

Commits
-------

ef15e11 improved message for deprecated requirements
2015-06-11 19:41:47 +02:00
Fabien Potencier
99f95ac212 Merge branch '2.6' into 2.7
* 2.6:
  fixed CS
  Allow new lines in Messages translated with transchoice() (replacement for #14867)
  [2.3] Fix tests on Windows
2015-06-11 19:26:34 +02:00
Fabien Potencier
f0045deaba Merge branch '2.3' into 2.6
* 2.3:
  fixed CS
  Allow new lines in Messages translated with transchoice() (replacement for #14867)
  [2.3] Fix tests on Windows
2015-06-11 19:26:27 +02:00
Christian Flothmann
ef15e11e07 improved message for deprecated requirements 2015-06-11 19:20:40 +02:00
Fabien Potencier
17387fdc8e minor #14945 [Config] Fix test name (dosten)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Fix test name

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

7bb0812 Fix test name
2015-06-11 16:45:09 +02:00
Diego Saint Esteben
7bb0812012 Fix test name 2015-06-11 11:06:56 -03:00
Fabien Potencier
009efb8dec fixed CS 2015-06-11 15:53:10 +02:00
Fabien Potencier
e54d7161ab bug #14897 Allow new lines in Messages translated with transchoice() (replacement for #14867) (azine)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #14897).

Discussion
----------

 Allow new lines in Messages translated with transchoice() (replacement for #14867)

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

Hi,
I found that the MessageSelector does not handle new lines in messages very well.
I suggest adding the "s" modifier to the regexp used to identify the parts and ranges.
What do you think?

PS: would be nice to have this change also in Symfony 2.6 & 2.7

Commits
-------

786b8a6  Allow new lines in Messages translated with transchoice() (replacement for #14867)
2015-06-11 15:52:49 +02:00
azine
786b8a664e Allow new lines in Messages translated with transchoice() (replacement for #14867) 2015-06-11 15:52:49 +02:00
Bernhard Schussek
6ebcddd55d [DependencyInjection] Fixed resolving of service configurators containing Definition objects 2015-06-11 13:28:28 +02:00
Fabien Potencier
eb366b9264 bug #14887 [Form] Swap new ChoiceView constructor arguments to ease migrating from the deprecated one (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Swap new ChoiceView constructor arguments to ease migrating from the deprecated one

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

Commits
-------

909d2b9 [Form] Swap new ChoiceView constructor arguments to ease migrating from the deprecated one
2015-06-10 20:57:31 +02:00
Fabien Potencier
b3b1c459b3 minor #14825 Documenting how to keep option value BC - see #14377 (weaverryan)
This PR was merged into the 2.7 branch.

Discussion
----------

Documenting how to keep option value BC - see #14377

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14377 (kinda)
| License       | MIT
| Doc PR        | symfony/symfony-docs#5179

Hi guys!

I'm still making sense of the form changes, but it seems that this before and after isn't totally honest - your option values will change, unless your add this extra option.

@webmozart look correct to you?

Thanks!

Commits
-------

deb9db8 Documenting how to keep option value BC - see #14377
2015-06-10 18:35:05 +02:00
Nicolas Grekas
909d2b9020 [Form] Swap new ChoiceView constructor arguments to ease migrating from the deprecated one 2015-06-10 17:47:24 +02:00
Nicolas Grekas
e7e48c8b01 bug #14900 Silence deprecation warnings by default (reecefowell)
This PR was merged into the 2.7 branch.

Discussion
----------

[RFC] Fixing Deprecation Warnings

This PR address an issue that causes Symfony to vomit E_DEPRECATED warnings everywhere.

```markdown
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14899
| License       | MIT
```

Fixes #14899

![http://cdn.meme.am/instances2/500x/125359.jpg](http://cdn.meme.am/instances2/500x/125359.jpg)

Commits
-------

73bbaa6 Silence invasive deprecation warnings, opt-in for warnings
2015-06-10 17:30:22 +02:00
Fabien Potencier
d23d3c9b93 minor #14925 [Yaml] remove partial deprecation annotation (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] remove partial deprecation annotation

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

Commits
-------

24451ce [Yaml] remove partial deprecation annotation
2015-06-10 02:10:59 +02:00
Fabien Potencier
c95d86c9c6 minor #14926 [2.3] Fix tests on Windows (WouterJ)
This PR was squashed before being merged into the 2.3 branch (closes #14926).

Discussion
----------

[2.3] Fix tests on Windows

There were quite a few tests failing when running on my Windows PC. These fixes are the ones I could easily fix.

| Q | A
| --- | ---
| License | MIT
| Fixed tickets | -

Commits
-------

e3e5f3d [2.3] Fix tests on Windows
2015-06-10 02:09:28 +02:00
WouterJ
e3e5f3d661 [2.3] Fix tests on Windows 2015-06-10 02:09:26 +02:00
Christian Flothmann
24451ce135 [Yaml] remove partial deprecation annotation 2015-06-09 22:29:28 +02:00
Fabien Potencier
1750330831 Merge branch '2.6' into 2.7
* 2.6:
  [Validator] remove partial deprecation annotation
  Updated UPGRADE-2.4.md
  [Form] Support DateTimeImmutable in transform()
  [Form] add test to avoid regression of #14891
  without this change allways the legacy code get called
  [Form] Fix call to removed method (BC broken in 2.3)
  [HttpFoundation] Get response content as resource several times for PHP >= 5.6
  Improved duplicated code in FileLocator
2015-06-09 17:06:47 +02:00
Fabien Potencier
49d942a2ba Merge branch '2.3' into 2.6
* 2.3:
  [Form] Support DateTimeImmutable in transform()
  [Form] Fix call to removed method (BC broken in 2.3)
  [HttpFoundation] Get response content as resource several times for PHP >= 5.6
  Improved duplicated code in FileLocator
2015-06-09 17:06:34 +02:00
Fabien Potencier
acb55289a8 bug #14739 [Console] SymfonyStyle : fix blocks wordwrapping (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] SymfonyStyle : fix blocks wordwrapping

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

Allow to print strings with a length greater than the terminal length in a block by allowing to cut words.
Indeed, currently such code won't work:

```php
//Terminal is 80 chars wide
$sfStyle->caution(str_repeat('#', 78)); //Caution uses 3 chars as prefix (' ! ')
```

> [Symfony\Component\Debug\Exception\ContextErrorException]
  Warning: str_repeat(): Second argument has to be greater than
  or equal to 0

Of course, this is only a foolish example. But there is no reason the command should fail when trying to output a long word (as we could imagine it could be a FQCN, absolute path or anything else), nor just because the terminal width is too small.

Commits
-------

58f2fad [Console] SymfonyStyle : Fix blocks wordwrapping
2015-06-09 16:19:47 +02:00
ogizanagi
58f2fada56 [Console] SymfonyStyle : Fix blocks wordwrapping
Allow to print strings with a length greater than the terminal length in a block by allowing to cut words.
2015-06-09 11:20:12 +02:00
Fabien Potencier
e09874bd98 bug #14740 [Console] SymfonyStyle : fix blocks output is broken on windows cmd (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] SymfonyStyle : fix blocks output is broken on windows cmd

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

Using `SymfonyStyle::block` method, output is broken on windows cmd:
![screenshot 2015-05-23 a 18 00 18 - copie](https://cloud.githubusercontent.com/assets/2211145/7788763/43135ea0-0249-11e5-8a82-7f788384bc03.PNG)

Windows cmd seems to wrap lines as soon as the terminal width is reached, whether there are following characters or not.

I've encountered this behavior with multiple command prompts available on Windows, like Console2, ConEmu, Cmdr, ... But as most of them are simple cmd wrappers, the output is identic. The only good fellow in there is Cygwin which provides an Unix-like env and command-line interface.

This PR solves this issue by assuming that the lineLength (not the terminal width), used to wrap lines internally within the `SymfonyStyle::block` method, should be the terminal width - 1.

Commits
-------

ea3d768 [Console] SymfonyStyle : Fix blocks output is broken on windows cmd
2015-06-08 23:01:01 +02:00
ogizanagi
ea3d7688e4 [Console] SymfonyStyle : Fix blocks output is broken on windows cmd 2015-06-08 22:51:09 +02:00
Fabien Potencier
c62069bc52 bug #14623 [Console] SymfonyStyle : fix & automate block gaps. (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] SymfonyStyle : fix & automate block gaps.

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

---
Depends on https://github.com/symfony/symfony/pull/14741

---
## What it does
- autoprepend appropriate blocks (like cautions, titles, sections, ...) by the correct number of blank lines considering history.
- handle automatically most of the SymfonyStyle guide line breaks and gaps. Fix things such as unwanted double blank lines between titles and admonitions.
- test outputs
- fix an issue using questions with SymfonyStyle, which should not output extra blank lines when using with a non-interactive input.

## Description

`SymfonyStyle` is great, but there are some issues, mostly when using blocks (text blocks, titles and admonitions): some extra blank lines might be generated.

Plus, on the contrary, some line breaks or blank lines around blocks are missing, and the developer need to handle this himself by polluting his code with ugly `if` and `newLine()` statements.

### Before / After :

![screenshot 2015-05-13 a 00 11 59](https://cloud.githubusercontent.com/assets/2211145/7600572/ccfa8904-f90c-11e4-999f-d89612360424.PNG)

As you can see, it's still up to the developper to end his command by a blank line (unless using a block like `SymfonyStyle::success()`) in order to distinct different commands outputs more efficiently.

Everything else is now handled properly, and automatically, according to the rules exposed in the symfony console style guide published some time ago by @javiereguiluz .
Questions (not exposed in the above output) are considered as blocks, and follow, for instance, the same conditions than admonitions: 1 blank line before and after, no more (although, you'll still be able to output more blank lines yourself, using `newLine`).

Commits
-------

fc598ff [Console] SymfonyStyle : fix & automate block gaps.
260702e [Console] SymfonyStyle : Improve EOL consistency by relying on output instance
2015-06-08 21:06:07 +02:00