Commit Graph

22775 Commits

Author SHA1 Message Date
Christophe Coevoet e6feed285a Fix the DomCrawler tests 2015-10-02 14:05:56 +02:00
Fabien Potencier 584cfc24a1 feature #16069 [WebProfilerBundle] Move AjaxCollector to HttpKernel for use with Silex (glaubinix, fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Move AjaxCollector to HttpKernel for use with Silex

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

This PR moves the AjaxDataCollector from the FrameworkBundle to the HttpKernel Component where most of the other DataCollectors are. This would allow applications which are not base on symfony/framework-bundle to use the collector. Like for instance applications based on silex or symfony components.

Commits
-------

3841f46 added missing a deprecated notice
c227806 Move AjaxCollector for use without framework bundle
2015-10-02 13:25:03 +02:00
Fabien Potencier 6413fb7743 feature #16063 [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Add $this->getDump($var) when using VarDumperTestTrait

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

So useful when writing/updating dump fixtures!

Commits
-------

aa1d578 [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait
2015-10-02 12:42:43 +02:00
Fabien Potencier 9e60980f5a feature #16058 Prevent adding non-DOMElement elements in DomCrawler (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Prevent adding non-DOMElement elements in DomCrawler

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

Many methods of the DomCrawler component are relying on the DOMElement API, not only on the DOMNode API. All the typehints in the Form and Link APIs were already fixed in 2.5 because they are unusable with other kinds of nodes (fatal errors). However, the Crawler itself was not fixed. and this means that a bunch of its APIs can trigger fatal errors when passing other kinds of nodes.

Thus, there is a case where the code was allowing such nodes to be injected in the Crawler for some XPath queries. I fixed it to avoid it, adding the same kind of filtering than in other places.

Commits
-------

9f362a1 Prevent adding non-DOMElement elements in DomCrawler
2015-10-02 12:40:27 +02:00
Fabien Potencier 4af8a5545a feature #16057 Deprecate loading multiple documents in the same crawler (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Deprecate loading multiple documents in the same crawler

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

Note that loading multiple documents in the same crawler already creates weird things when working with namespaces (the list of mapping of aliases to namespaces is shared between documents, which was flawed).

As said in the issue, this opens the door to optimizations in the future (sharing the DOMXpath instance for instance, including with subcrawler)

Commits
-------

0d1cb3b Deprecate loading multiple documents in the same crawler
2015-10-02 12:39:30 +02:00
Fabien Potencier 3841f4624d added missing a deprecated notice 2015-10-02 12:23:49 +02:00
Stephan Vock c2278062b1 Move AjaxCollector for use without framework bundle 2015-10-02 12:20:34 +02:00
Kévin Dunglas 73ee226a1f [PropertyInfo] Test behavior when an extractor return null. 2015-10-02 12:16:37 +02:00
Fabien Potencier 510fdea599 Revert "bug #15860 [Yaml] Fix improper comments removal (ogizanagi)"
This reverts commit 150f52f3aa, reversing
changes made to 74af02a771.
2015-10-02 12:12:23 +02:00
Christophe Coevoet 0d1cb3bd1b Deprecate loading multiple documents in the same crawler 2015-10-02 10:46:05 +02:00
Nicolas Grekas aa1d578c2c [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait 2015-10-02 10:06:31 +02:00
Christophe Coevoet 9f362a12f6 Prevent adding non-DOMElement elements in DomCrawler
Many methods of the DomCrawler component are relying on the DOMElement
API, not only on the DOMNode API.
2015-10-02 10:01:39 +02:00
Nicolas Grekas 2ff0f97c60 Merge branch '2.7' into 2.8
* 2.7:
  [appveyor] Fix command line
  [Yaml] Fix improper comments removal inside strings
2015-10-02 08:55:39 +02:00
Nicolas Grekas 9b0fa548c1 Merge branch '2.3' into 2.7
* 2.3:
  [appveyor] Fix command line
  [Yaml] Fix improper comments removal inside strings
2015-10-02 08:55:14 +02:00
Nicolas Grekas 17edafd7e3 minor #16061 [appveyor] Fix command line (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[appveyor] Fix command line

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

Discovery the joy of cmd programming...

Commits
-------

bdcbde9 [appveyor] Fix command line
2015-10-02 08:53:52 +02:00
Nicolas Grekas bdcbde91b9 [appveyor] Fix command line 2015-10-02 08:28:33 +02:00
Fabien Potencier 150f52f3aa bug #15860 [Yaml] Fix improper comments removal (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] Fix improper comments removal

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

This tries to fix #15857 .

Honestly, I don't have any idea of the regressions it might introduce. Tests are passing, so if this code had any reason to exist, tests covering it are certainly missing :/

Any hint ?

Commits
-------

0e24fc5 [Yaml] Fix improper comments removal inside strings
2015-10-01 23:11:01 +02:00
Fabien Potencier 99745e12a7 feature #15742 Using a service as a router resource (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #15742).

Discussion
----------

Using a service as a router resource

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

Hi guys!

This adds the ability to use a service as a routing resource. In other words, instead of loading `routing.yml`, you could load `my_route_loader`, and then a method would be called on your service to return a RouteCollection.

Specifically, I'm interested in this because it would allow a user to point their main router resource to the kernel itself, making it possible to load routes inside the kernel (making a single-file full-stack app more possible).

Thanks!

Commits
-------

79e210f Using a service as a router resource
2015-10-01 22:34:27 +02:00
Ryan Weaver 79e210f86c Using a service as a router resource 2015-10-01 22:34:24 +02:00
Fabien Potencier 54e3d71c03 feature #15778 Fluid interface for building routes in PHP (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #15778).

Discussion
----------

Fluid interface for building routes in PHP

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

This - along with #15742 - attempts to making adding routes in PHP (via an actual class+method) not only possible, but also useful.

The two classes - `Route` and `RouteCollectionBuilder` are based off of Silex's `Controller` and `ControllerCollection`. The `RouteCollectionBuilder` is basically a `RouteCollection` that's able to import other resources. Here are the goals:

A) Import routes easily

```php
$routes->import('routing.yml');
```

B) Fluid addition of routes into the collection

```php
$routes->add('/admin', 'AppBundle:Admin:index', 'admin_index')
    ->setMethods(['GET']);
```

C) Ability to create routes with auto-generating names

D) Ability to add a "sub-collection" (kind of like an import, without pointing to another file). Included is the ability to set the controller class:

```php
$blogRoutes = $routes->createBuilder('/blog')
   ->setControllerClass('AppBundle\Controller\BlogController');
$blogRoutes->add('/', 'indexAction');
$blogRoutes->add('/{id}', 'editAction');
$routes->addBuilder($blogRoutes);
```

E) The collection options can be set before or after the routes. With `RouteCollection`, if you set something - e.g. a prefix or a default - and THEN add more routes, those options are not passed to those routes. This is by design, but not ideal for building routes (e.g. in the previous code example, the controllerClass would not be applied using the opposite logic, since it's set before adding the routes).

Thanks!

Commits
-------

15ba2e8 Fluid interface for building routes in PHP
2015-10-01 22:32:51 +02:00
Ryan Weaver 15ba2e87a4 Fluid interface for building routes in PHP 2015-10-01 22:32:48 +02:00
Fabien Potencier 238419fb5f minor #15983 Updated the styles of the container commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15983).

Discussion
----------

Updated the styles of the container commands

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

This PR uses comment() which hasn't been merged yet. WIP PR at #15964

This command defines a lot of options, so I don't know if I've updated all the possible outputs:

![container_params](https://cloud.githubusercontent.com/assets/73419/10148240/a4265ed4-6632-11e5-97c6-56d9d5fc496b.png)

![container_tags](https://cloud.githubusercontent.com/assets/73419/10148244/a68f392a-6632-11e5-925d-60eec7d659af.png)

![container_one_service](https://cloud.githubusercontent.com/assets/73419/10148224/8708c7b0-6632-11e5-9a4e-efd3c8206bc1.png)

![container_select_service](https://cloud.githubusercontent.com/assets/73419/10148225/88e88d9a-6632-11e5-969a-57a1f6efc17f.png)

![container_one_parameter](https://cloud.githubusercontent.com/assets/73419/10148227/8c92d342-6632-11e5-9d95-53bb71b6f67d.png)

![container_tagged_services](https://cloud.githubusercontent.com/assets/73419/10148229/9070a002-6632-11e5-8af9-e1d0579d539e.png)

Commits
-------

d209a4e Updated the styles of the container commands
2015-10-01 21:15:02 +02:00
Javier Eguiluz d209a4ebac Updated the styles of the container commands 2015-10-01 21:14:59 +02:00
Fabien Potencier 02b99dbed4 minor #16052 [CssSelector] synchronize tests for static and non-static API (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[CssSelector] synchronize tests for static and non-static API

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

Synchronizing the classes ensures that no tests are lost when the legacy
API is removed in #16020 for Symfony 3.0, thus mitigating the risk of
future regressions.

Commits
-------

2b29a40 synchronize tests for static and non-static API
2015-10-01 21:11:23 +02:00
Tobias Schultze 311029b9a2 fix tests after twig commands style changes 2015-10-01 20:15:01 +02:00
Christian Flothmann 2b29a405be synchronize tests for static and non-static API
Synchronizing the classes ensures that no tests are lost when the legacy
API is removed in #16020 for Symfony 3.0, thus mitigating the risk of
future regressions.
2015-10-01 19:39:35 +02:00
Fabien Potencier 09ff9f851d bug #16051 [DomCrawler] fix deprecation triggers (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] fix deprecation triggers

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

On HHVM, the SplObjectStorage class performs calls to its method
internally. These method calls must not lead to triggered deprecation
notices.

Commits
-------

aca6bd9 [DomCrawler] fix deprecation triggers
2015-10-01 19:38:01 +02:00
Christian Flothmann 40e0dc8084 use PHP_OS instead of php_uname('s')
The php_uname() function may be disabled for security reasons.
2015-10-01 19:06:54 +02:00
Christian Flothmann aca6bd9bd6 [DomCrawler] fix deprecation triggers
The SplObjectStorage class performs calls to its own methods. These
method calls must not lead to triggered deprecation notices.
2015-10-01 18:34:33 +02:00
Tobias Schultze 9f17026ba9 fix cs 2015-10-01 17:38:05 +02:00
Tobias Schultze e7325b721e minor #15926 [2.8][Form] Deprecate alias tag option (WouterJ)
This PR was squashed before being merged into the 2.8 branch (closes #15926).

Discussion
----------

[2.8][Form] Deprecate alias tag option

FQCN should be used since 2.8 instead, so a deprecation error should be triggered when the `alias` setting is used.

Furthermore, the name of the option doesn't make much sense for form types (as it's the alias of the field it applies to), so I renamed it to `extended_type`. I'm open to any other suggestions.

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

Commits
-------

e3aa522 [2.8][Form] Deprecate alias tag option
2015-10-01 17:36:34 +02:00
WouterJ e3aa5226e4 [2.8][Form] Deprecate alias tag option 2015-10-01 17:36:27 +02:00
Tobias Schultze c434bbd5f3 Merge branch '2.7' into 2.8 2015-10-01 17:32:55 +02:00
Tobias Schultze 4b0e4c4ee0 Merge branch '2.3' into 2.7
Conflicts:
	src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php
2015-10-01 17:31:29 +02:00
Fabien Potencier 1309cfbe9d minor #15989 Updated the styles of the Twig commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15989).

Discussion
----------

Updated the styles of the Twig commands

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

![twig_1](https://cloud.githubusercontent.com/assets/73419/10158152/5d1668d2-6690-11e5-9399-8a9a89b4e919.png)

![twig_2](https://cloud.githubusercontent.com/assets/73419/10158156/60dbd470-6690-11e5-9a4e-1e702c961fa6.png)

![twig_3](https://cloud.githubusercontent.com/assets/73419/10158160/66030dba-6690-11e5-890f-09dd9579aa9a.png)

![twig_4](https://cloud.githubusercontent.com/assets/73419/10158172/71ed2ffc-6690-11e5-8c5c-8190c5e6c235.png)

Commits
-------

fdeccd5 Updated the styles of the Twig commands
2015-10-01 17:07:36 +02:00
Javier Eguiluz fdeccd5849 Updated the styles of the Twig commands 2015-10-01 17:07:33 +02:00
Fabien Potencier 74af02a771 bug #16050 [TwigBundle] fix useless and failing test (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[TwigBundle] fix useless and failing test

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

This test is failing in php 7, see https://travis-ci.org/symfony/symfony/jobs/83107755#L2015
But it also doesn't test anything. So it's useless in it's current form.

In 2.7 we have more tests that are actually useful. So the class is not untested.

Commits
-------

d94dd16 [TwigBundle] fix useless and failing test
2015-10-01 17:03:00 +02:00
Tobias Schultze d94dd1679a [TwigBundle] fix useless and failing test 2015-10-01 16:53:49 +02:00
Fabien Potencier 56fa973514 minor #15980 Updated the styles of the config parameters (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15980).

Discussion
----------

Updated the styles of the config parameters

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

This PR uses comment() which hasn't been merged yet. WIP PR at #15964

**I have a question**: is it mandatory that the output of this command is a valid YAML or XML file? If not, we can keep the changes in the title of the command. Otherwise, I'll revert those changes.

![config_1](https://cloud.githubusercontent.com/assets/73419/10144197/9018a138-661c-11e5-8c9d-dc1b721533b8.png)

![config_2](https://cloud.githubusercontent.com/assets/73419/10144199/925e5604-661c-11e5-8597-8e01013c2e86.png)

Commits
-------

fdaa513 Updated the styles of the config parameters
2015-10-01 15:57:17 +02:00
Javier Eguiluz fdaa513cbb Updated the styles of the config parameters 2015-10-01 15:57:15 +02:00
Fabien Potencier bee1faaa95 minor #15969 Updated the style of the translation commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15969).

Discussion
----------

Updated the style of the translation commands

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

@ogizanagi did a great job updating the styles of these commands. This is just a bit of tweaking here and there:

(Left = old; Right = new)

![comparison_1](https://cloud.githubusercontent.com/assets/73419/10136622/b2d049d2-65f5-11e5-9efe-ae74d546298d.png)

![comparison_2](https://cloud.githubusercontent.com/assets/73419/10136625/b8f96e24-65f5-11e5-8726-f092fc10ac38.png)

![comparison_3](https://cloud.githubusercontent.com/assets/73419/10136626/bb34a6cc-65f5-11e5-8312-0f084f04f0df.png)

![comparison_4](https://cloud.githubusercontent.com/assets/73419/10136630/bd851fd8-65f5-11e5-8ef0-71cce64fd2d7.png)

![comparison_5](https://cloud.githubusercontent.com/assets/73419/10136635/bf6173e2-65f5-11e5-9a25-8f04664cfe5a.png)

Commits
-------

8bcb9fc Updated the style of the translation commands
2015-10-01 15:46:30 +02:00
Javier Eguiluz 8bcb9fc3f8 Updated the style of the translation commands 2015-10-01 15:46:29 +02:00
Fabien Potencier a94d7a06d1 minor #15967 [Console] Fix tests for SymfonyStyle (1ed)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix tests for SymfonyStyle

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

Commits
-------

7720f5c [Console] Fix tests for SymfonyStyle
2015-10-01 15:25:36 +02:00
Fabien Potencier 38888af7ce minor #16005 The 'config' variable is already used as an array expression less... (tecnocat)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16005).

Discussion
----------

The 'config' variable is already used as an array expression less...

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

The 'config' variable is already used as an array expression less...

Using a variable both as an 'array expression' and as a 'key' or 'value' most often is a typing error.

Commits
-------

f15d179 The 'config' variable is already used as an array expression less...
2015-10-01 15:23:51 +02:00
Aarón Nieves Fernández f15d179fbd The 'config' variable is already used as an array expression less... 2015-10-01 15:23:50 +02:00
Fabien Potencier 559554e157 bug #16023 Minor fixes for the profiler and toolbar (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #16023).

Discussion
----------

Minor fixes for the profiler and toolbar

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

Changes:

  * Fixed a misaligned icon
  * Changed the priorities of the collectors to better control their position and to leave a "gap" between priorities so custom panels can be displayed between the default panels. This idea came from @stof.

By the way, @stof do you know how can I set the priority of the SwiftMailer collector? Its definition is the only one that doesn't use the `<tag name="data_collector" />`:

```xml
<service id="swiftmailer.data_collector" class="%swiftmailer.data_collector.class%">
    <argument type="service" id="service_container" />
</service>
```

https://github.com/symfony/swiftmailer-bundle/blob/master/Resources/config/swiftmailer.xml#L90-L92

Commits
-------

bff4098 Minor fixes for the profiler and toolbar
2015-10-01 15:15:49 +02:00
Javier Eguiluz bff4098a35 Minor fixes for the profiler and toolbar 2015-10-01 15:15:47 +02:00
Fabien Potencier b107f235c2 minor #16048 Fix FrameworkBundle low deps tests (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix FrameworkBundle low deps tests

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

Commits
-------

06700ae Require at least Console 2.8 to have SymfonyStyle#comment()
2015-10-01 14:34:19 +02:00
Nicolas Grekas 591cd0879c Fix merge 2015-10-01 14:12:45 +02:00
Nicolas Grekas 5bc3581a4e Merge branch '2.7' into 2.8
* 2.7:
  Fix appveyor.yml missing ANSICON env var
  [appveyor] merge test matrix in a single job
  [travis] Skip testing intermediate PHP versions on pull requests

Conflicts:
	.travis.yml
	appveyor.yml
2015-10-01 14:06:27 +02:00