Commit Graph

29102 Commits

Author SHA1 Message Date
Grégoire Pineau
4a81af6fa6 [Workflow] Removed twig from composer.json (dev section, not used) 2017-01-06 16:20:14 +01:00
Fabien Potencier
c36f25f038 bug #21165 [Serializer] int is valid when float is expected when deserializing JSON (dunglas)
This PR was squashed before being merged into the 3.1 branch (closes #21165).

Discussion
----------

[Serializer] int is valid when float is expected when deserializing JSON

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

JSON only has a Number type corresponding to both `int` and `float` PHP types.
PHP's `json_encode`, JavaScript's `JSON.stringify`, Go's `json.Marshal` as well as most other JSON encoders convert floating-point numbers like `12.0` to `12` (the decimal part is dropped when possible).
PHP's `json_decode` automatically converts Numbers without a decimal part to integers.

Actually, the Serializer rejects integers when a float is expected, this PR fixes this behavior when denormalizing JSON-based formats.

Port of api-platform/core#714.

/cc @gorghoa @Shine-neko

Commits
-------

4125455775 [Serializer] int is valid when float is expected when deserializing JSON
2017-01-06 07:11:28 -08:00
Kévin Dunglas
4125455775 [Serializer] int is valid when float is expected when deserializing JSON 2017-01-06 07:11:08 -08:00
Nicolas Grekas
53344d01a9 minor #21180 [PhpUnitBridge] silence warnings on PHPUnit 4.8 (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[PhpUnitBridge] silence warnings on PHPUnit 4.8

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

The concept of warnings is only available since PHPUnit 5. We can later think about whether we need this for PHPUnit 4.8 to or if we should rather aim to drop PHPUnit 4.8 support in 4.0. For now, this change will make the test suite green again.

Commits
-------

2c3de10 silence warnings on PHPUnit 4.8
2017-01-06 15:48:43 +01:00
Christian Flothmann
2c3de10a98 silence warnings on PHPUnit 4.8 2017-01-06 15:37:11 +01:00
Nicolas Grekas
1038221d51 minor #21124 [Console] increased code coverage of Output classes (ShinDarth)
This PR was squashed before being merged into the 2.7 branch (closes #21124).

Discussion
----------

[Console] increased code coverage of Output classes

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

This PR increases the coverage of Output classes of the Console component from 80.81% to 94.95%

Commits
-------

ab4ba23 [Console] increased code coverage of Output classes
2017-01-06 14:13:12 +01:00
ShinDarth
ab4ba23931 [Console] increased code coverage of Output classes 2017-01-06 14:13:10 +01:00
Nicolas Grekas
66f7126569 minor #21156 No fallback to REQUEST_TIME in TimeDataCollector (iltar)
This PR was merged into the 3.3-dev branch.

Discussion
----------

No fallback to REQUEST_TIME in TimeDataCollector

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

As of PHP 5.4 the `REQUEST_TIME_FLOAT` is available and the minimum version of PHP is 5.5 in Symfony. I think it's safe to use as I can't find cases where this is _not_ defined.

Commits
-------

ba00543 No fallback to REQUEST_TIME in TimeDataCollector
2017-01-06 14:09:06 +01:00
Nicolas Grekas
98c4e501ab feature #21140 [PhpUnitBridge] deprecate the testLegacy test name prefix (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[PhpUnitBridge] deprecate the testLegacy test name prefix

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

Commits
-------

21b72dd deprecate the Legacy/testLegacy test name prefix
2017-01-06 12:30:22 +01:00
Christian Flothmann
21b72ddb57 deprecate the Legacy/testLegacy test name prefix 2017-01-06 12:04:13 +01:00
Nicolas Grekas
5518f6a2d0 minor #21151 [Profiler][VarDumper] Fix minor color issue & duplicated selector (ogizanagi)
This PR was merged into the 2.8 branch.

Discussion
----------

[Profiler][VarDumper] Fix minor color issue & duplicated selector

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

While working on #21109, I spotted this minor issue with `sf-dump-const` and `.sf-dump-ref`:

| Before | After |
| --- | --- |
|<img width="276" alt="screenshot 2017-01-03 a 20 13 55" src="https://cloud.githubusercontent.com/assets/2211145/21619779/7e1e347e-d1f1-11e6-9d84-fbb1d5d6b1fa.PNG">| <img width="275" alt="screenshot 2017-01-03 a 20 14 04" src="https://cloud.githubusercontent.com/assets/2211145/21619786/86dde5dc-d1f1-11e6-8b13-dcfc5abe466a.PNG">|

Commits
-------

b282076 [Profiler][VarDumper] Fix minor color issue & duplicated selector
2017-01-06 11:12:29 +01:00
Nicolas Grekas
d7928eac87 minor #21171 Added missing headers in fixture files (iltar)
This PR was merged into the 3.1 branch.

Discussion
----------

Added missing headers in fixture files

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

The headers were missing in a few files as mentioned in https://github.com/symfony/symfony/pull/21164#discussion_r94669787

Commits
-------

c9c2474 Added missing headers in fixture files
2017-01-06 10:30:29 +01:00
Nicolas Grekas
ecdf857b61 [DI][EventDispatcher] Add & wire closure-proxy argument type 2017-01-06 08:57:26 +01:00
Iltar van der Berg
c9c2474a2c Added missing headers in fixture files 2017-01-06 08:41:29 +01:00
Fabien Potencier
924469c47e feature #21109 [Profiler][VarDumper] Add a search feature to the HtmlDumper (ogizanagi)
This PR was squashed before being merged into the 3.3-dev branch (closes #21109).

Discussion
----------

[Profiler][VarDumper] Add a search feature to the HtmlDumper

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

I finally took some time to continue this. Here is the result so far:

| Raw        | Profiler           | Profiler Bar |
|:-------------:|:-------------:|:-----:|
| ![sfdump](https://cloud.githubusercontent.com/assets/2211145/21567183/4edfcd98-ceaa-11e6-9c51-873663551f32.gif) | ![sfdump profiler](https://cloud.githubusercontent.com/assets/2211145/21567181/4eb8013c-ceaa-11e6-8ed9-f9cb40090d55.gif) | ![sfdump profilerbar](https://cloud.githubusercontent.com/assets/2211145/21567180/4eb71740-ceaa-11e6-92dd-cc61d68a8def.gif) |

New outputs:

| Raw        | Profiler Bar |
|:-------------:|:-----:|
| ![capture d ecran 2017-01-03 a 16 20 54](https://cloud.githubusercontent.com/assets/2211145/21612323/f6b275c4-d1d0-11e6-9f78-059940fe1c2f.png) | <img width="245" alt="capture d ecran 2017-01-03 a 16 21 34" src="https://cloud.githubusercontent.com/assets/2211145/21612337/0641ad34-d1d1-11e6-92ac-a0fff2721241.png"> |

| Profiler Dump Panel | Profiler - Request Panel |
|:-------------:|:-----:|
| ![capture d ecran 2017-01-03 a 16 21 57](https://cloud.githubusercontent.com/assets/2211145/21612329/00a0ead4-d1d1-11e6-958e-e11bc87c0a7d.png) | ![capture d ecran 2017-01-03 a 16 22 22](https://cloud.githubusercontent.com/assets/2211145/21612330/00a2135a-d1d1-11e6-867d-18c55b86897e.png) ![capture d ecran 2017-01-03 a 16 22 33](https://cloud.githubusercontent.com/assets/2211145/21612331/00a2e000-d1d1-11e6-8f2a-2965a837fa60.png) |

Usage:

1. Click on the dump
1. <kbd>CTRL</kbd>/<kbd>CMD</kbd> + <kbd>F</kbd>.
1. <kbd>ESC</kbd> to quit.

Code, styles and rendering might not be perfect, but I think it's enough polished to be considered.
Anyway, I'll accept any PR on my own branch if anyone wishes to contribute to it 😃

~~I moved javascript and css into dedicated files, as I find it easier to maintain (but will complicate diff with other branches). I know PHPStorm is already able to do partial language injection in PHP files, so it might not be needed... But still looks more elegant to me ^^'~~

Commits
-------

1fe82fa49b [Profiler][VarDumper] Add a search feature to the HtmlDumper
2017-01-05 20:44:38 -08:00
Maxime Steinhausser
1fe82fa49b [Profiler][VarDumper] Add a search feature to the HtmlDumper 2017-01-05 20:44:37 -08:00
Fabien Potencier
be85fcc2b8 feature #21039 Web server bundle (fabpot)
This PR was squashed before being merged into the 3.3-dev branch (closes #21039).

Discussion
----------

Web server bundle

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

Moved the `server:*` commands to a new bundle. It makes them more easily discoverable and more decoupled. Discoverability is important when not using symfony/symfony. In that case, the commands are not available unless you have the symfony/process component installed. With a dedicated bundle, installing the bundle also installs the dependency, making the whole process easier.

Usage is the same as the current commands for basic usage:

To start a web server in the foreground:

```
bin/console server:run
```

To manage a background server:

```
bin/console server:start
bin/console server:stop
bin/console server:status
```

The big difference is that port is auto-determined if something is already listening on port 8000.

Usage is **different** if you pass options:

```
bin/console server:start 127.0.0.1:8888
bin/console server:stop # no need to pass the address again
bin/console server:status # no need to pass the address again
```

That's possible as the web server now stores its address in a pid file stored in the current directory.

Commits
-------

f39b32735b [WebServerBundle] switched auto-run of server:start to off by default
961d1cea55 [WebServerBundle] fixed server:start when already running
126f4d9ec4 [WebServerBundle] added support for port auto-detection
6f689d6597 [WebServerBundle] changed the way we keep track of the web server
585d4451c8 [WebServerBundle] tweaked command docs
fa7ebc57de [WebServerBundle] moved most of the logic in a new class
951a1a227d [WebServerBundle] changed wording
ac1ba7700e made the router configurable via env vars
48dd2b0dbe removed obsolete check
132902c621 moved server:* command to a new bundle
2017-01-05 19:09:35 -08:00
Fabien Potencier
0f50b4de80 feature #20907 [DependencyInjection] Implement lazy collection type using generators (tgalopin, nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] Implement lazy collection type using generators

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

Following the RFC https://github.com/symfony/symfony/issues/20875, this PR aims to implement lazy services collections using generators internally.

For now, I suggest to support only XML and PHP definitions. Supporting YAML means adding another convention to the language and this is not the aim of this PR.

- [x] value object holding the semantic (IteratorArgument)
- [x] iterator dumping
- [x] lazyness awareness in CheckCircularReferencesPass & GraphvizDumper
- [x] rewindable iterators
- [x] `*_ON_INVALID_REFERENCE` behavior
- [x] ContainerBuilder::createService
- [x] ArgumentInterface handling in compiler passes

Commits
-------

1dbf52ad03 [DI] Add "=iterator" arguments to Yaml loader
5313943692 [DependencyInjection] Implement lazy collection type using generators
2017-01-05 19:07:12 -08:00
Nicolas Grekas
1dbf52ad03 [DI] Add "=iterator" arguments to Yaml loader 2017-01-05 21:40:35 +01:00
Fabien Potencier
f39b32735b [WebServerBundle] switched auto-run of server:start to off by default 2017-01-05 12:36:51 -08:00
Titouan Galopin
5313943692 [DependencyInjection] Implement lazy collection type using generators 2017-01-05 21:34:37 +01:00
Fabien Potencier
961d1cea55 [WebServerBundle] fixed server:start when already running 2017-01-05 11:49:47 -08:00
Fabien Potencier
126f4d9ec4 [WebServerBundle] added support for port auto-detection 2017-01-05 11:48:52 -08:00
Fabien Potencier
6f689d6597 [WebServerBundle] changed the way we keep track of the web server 2017-01-05 11:33:44 -08:00
Nicolas Grekas
65d73f58e7 Merge branch '3.2'
* 3.2:
  [TwigBundle] Help composer resolve its deps
2017-01-05 19:14:24 +01:00
Nicolas Grekas
56987dda9f [TwigBundle] Help composer resolve its deps 2017-01-05 19:14:11 +01:00
Nicolas Grekas
aa2a1ebe4c Merge branch '3.2'
* 3.2:
  [Cache] Remove silenced warning tiggered by PhpArrayAdapter
  [Cache] Fix order of writes in ChainAdapter
  [Console] Fix return type in Terminal docblocks
2017-01-05 18:48:24 +01:00
Nicolas Grekas
bfda99f2eb bug #21167 [Cache] Remove silenced warning tiggered by PhpArrayAdapter (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Cache] Remove silenced warning tiggered by PhpArrayAdapter

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

Because many reported this silenced warning, which happens all the time unless `cache:warmup` has been run.

Commits
-------

a9dfcd8 [Cache] Remove silenced warning tiggered by PhpArrayAdapter
2017-01-05 18:48:01 +01:00
Nicolas Grekas
c74220fd4c Merge branch '3.1' into 3.2
* 3.1:
  [Cache] Fix order of writes in ChainAdapter
2017-01-05 18:42:49 +01:00
Nicolas Grekas
e2b11b4207 bug #21166 [Cache] Fix order of writes in ChainAdapter (nicolas-grekas)
This PR was merged into the 3.1 branch.

Discussion
----------

[Cache] Fix order of writes in ChainAdapter

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

This is of importance in race situations: writes should happen on less volatile backend first so that.

Commits
-------

df552af [Cache] Fix order of writes in ChainAdapter
2017-01-05 18:42:20 +01:00
Nicolas Grekas
a9dfcd8819 [Cache] Remove silenced warning tiggered by PhpArrayAdapter 2017-01-05 18:36:34 +01:00
Nicolas Grekas
df552af2f2 [Cache] Fix order of writes in ChainAdapter 2017-01-05 08:56:56 +01:00
Fabien Potencier
f50e91419f minor #21162 [Console] Fix return type in Terminal docblocks (pjcdawkins)
This PR was merged into the 3.2 branch.

Discussion
----------

[Console] Fix return type in Terminal docblocks

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

This PR updates the docblock to reflect what's already in the code.

Commits
-------

6afb0afa24 [Console] Fix return type in Terminal docblocks
2017-01-04 19:57:48 -08:00
Fabien Potencier
f74d7fa299 Merge branch '3.2'
* 3.2:
  tweaked php cs fixer configuration
  [TwigBundle] fixed typo in composer.json
2017-01-04 14:01:34 -08:00
Fabien Potencier
8dedf9d999 Merge branch '3.1' into 3.2
* 3.1:
  tweaked php cs fixer configuration
  [TwigBundle] fixed typo in composer.json
2017-01-04 14:01:24 -08:00
Fabien Potencier
2904201ec6 Merge branch '2.8' into 3.1
* 2.8:
  tweaked php cs fixer configuration
2017-01-04 14:01:15 -08:00
Fabien Potencier
a9ed1841dc Merge branch '2.7' into 2.8
* 2.7:
  tweaked php cs fixer configuration
2017-01-04 14:01:04 -08:00
Fabien Potencier
4864e9dd51 tweaked php cs fixer configuration 2017-01-04 14:00:53 -08:00
Fabien Potencier
c3a50b0931 Merge branch '2.8' into 3.1
* 2.8:
  [TwigBundle] fixed typo in composer.json
2017-01-04 12:00:51 -08:00
Fabien Potencier
fccb98c551 [TwigBundle] fixed typo in composer.json 2017-01-04 12:00:29 -08:00
Fabien Potencier
0d1f53f48b Merge branch '3.2'
* 3.2:
  Fix serializer/translations/validator resources loading for bundles overriding getPath()
  Fix the priority order of compiler pass trait
2017-01-04 11:58:57 -08:00
Fabien Potencier
be882c4663 Merge branch '3.1' into 3.2
* 3.1:
  Fix serializer/translations/validator resources loading for bundles overriding getPath()
2017-01-04 11:58:34 -08:00
Fabien Potencier
8f82bf7076 Merge branch '2.8' into 3.1
* 2.8:
  Fix serializer/translations/validator resources loading for bundles overriding getPath()
2017-01-04 11:57:42 -08:00
Fabien Potencier
829b6bd475 Merge branch '2.7' into 2.8
* 2.7:
  Fix serializer/translations/validator resources loading for bundles overriding getPath()
2017-01-04 11:55:18 -08:00
Fabien Potencier
da88e6b1d7 bug #21113 [FrameworkBundle][HttpKernel] Fix resources loading for bundles with custom structure (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle][HttpKernel] Fix resources loading for bundles with custom structure

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/18563
| License       | MIT
| Doc PR        |  n/a

This fixes twig/translator/validator/serializer resource loading for bundles overriding `Bundle::getPath()`, adding a kernel parameter containing the bundle metadata (i.e. `path`, `namespace` and `parent`).

Fixes #18563 and unlocks https://github.com/symfony/symfony/pull/19586

Commits
-------

fef3146b3b Fix serializer/translations/validator resources loading for bundles overriding getPath()
2017-01-04 11:50:28 -08:00
Robin Chalas
fef3146b3b
Fix serializer/translations/validator resources loading for bundles overriding getPath() 2017-01-04 20:27:15 +01:00
Patrick Dawkins
6afb0afa24 [Console] Fix return type in Terminal docblocks 2017-01-04 17:48:15 +00:00
Fabien Potencier
df38318303 feature #21075 [Console] Show hidden commands in json & xml descriptors (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Show hidden commands in json & xml descriptors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no (may be considered, but as hidden commands did not exist before 3.2, looks more like a behavior change, hence a feature)
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20866#issuecomment-266678895
| License       | MIT
| Doc PR        | N/A

Commits
-------

b6cf240ab5 [Console] Show hidden commands in json & xml descriptors
2017-01-04 06:29:21 -08:00
Fabien Potencier
ed5eb6df7d feature #21129 [FrameworkBundle] Display original definition for aliases in debug:container (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Display original definition for aliases in debug:container

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

Before
![before-txt](http://image.prntscr.com/image/b0cb59f23ddb43669ba0aba093f454af.png)

After
![after-txt](http://image.prntscr.com/image/adf234957acf444292e45bded8efb9d8.png)

<details>
<summary>XML output</summary>

Before
![before-xml](http://image.prntscr.com/image/66212d92db654f88b8196b211046bcf2.png)

After
![after-xml](http://image.prntscr.com/image/3f6b5f9f1ea54a31aea36de5928b6ae9.png)
</details>

<details>
<summary>JSON output</summary>

Before
![before-json](http://image.prntscr.com/image/a7ffc4bcda61486f90af85c90e3d6caa.png)

After
![after-json](http://image.prntscr.com/image/15d0f37e78354dcf8e3015b94fcbdaed.png)

</details>

<details>
<summary>Markdown output</summary>

Before
![before-md](http://image.prntscr.com/image/be5289840ac64a5e80f11748f481686c.png)

After
![after-md](http://image.prntscr.com/image/cba4217863f647e9974e1715812eda01.png)
</details>

Commits
-------

cd4b15e605 [FrameworkBundle] Display original definition for aliases in debug:container
2017-01-04 05:25:52 -08:00
Robin Chalas
cd4b15e605 [FrameworkBundle] Display original definition for aliases in debug:container 2017-01-04 14:20:26 +01:00