Commit Graph

22758 Commits

Author SHA1 Message Date
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
Nicolas Grekas 0a615f999f Merge branch '2.3' into 2.7
* 2.3:
  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:
	appveyor.yml
2015-10-01 14:02:24 +02:00
Nicolas Grekas 36306ab7c6 Fix appveyor.yml missing ANSICON env var 2015-10-01 14:01:27 +02:00
Nicolas Grekas 6a249bba5f minor #16047 [travis] Skip testing intermediate PHP versions on pull requests (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] Skip testing intermediate PHP versions on pull requests

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

I've never seen a build fail exclusively on 5.4/5.5. But for sure, this could happen.
Thus, to get results faster, I propose to skip the corresponding matrix lines on pull requests but keep them when testing branches.

Commits
-------

99c1cd7 [travis] Skip testing intermediate PHP versions on pull requests
2015-10-01 13:59:01 +02:00
Nicolas Grekas 80be79185f minor #16043 [appveyor] merge test matrix in a single job (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[appveyor] merge test matrix in a single job

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

Appveyor doesn't allow more than one concurrent job. Let's manage our matrix ourselves to get results faster.

Commits
-------

249942a [appveyor] merge test matrix in a single job
2015-10-01 13:58:27 +02:00
Wouter J 06700ae44c Require at least Console 2.8 to have SymfonyStyle#comment() 2015-10-01 12:29:19 +02:00
Nicolas Grekas 249942a31a [appveyor] merge test matrix in a single job 2015-10-01 12:28:28 +02:00
Nicolas Grekas 99c1cd725d [travis] Skip testing intermediate PHP versions on pull requests 2015-10-01 12:01:50 +02:00
Fabien Potencier 442af181bd Merge branch '2.7' into 2.8
* 2.7:
  fixed typo
2015-10-01 10:42:31 +02:00
Fabien Potencier aa09d82289 Merge branch '2.3't m into 2.7
* 2.3:
  fixed typo
2015-10-01 10:42:07 +02:00
Fabien Potencier 1be6f3efa8 fixed typo 2015-10-01 10:41:56 +02:00
Fabien Potencier b938a7f1fc Merge branch '2.7' into 2.8
* 2.7:
  Use PHPUnit 5.0 for PHP 7
  [DomCrawler] always pass base href to subcrawlers
2015-10-01 10:37:26 +02:00
Fabien Potencier 4b24394a87 Merge branch '2.3' into 2.7
* 2.3:
  Use PHPUnit 5.0 for PHP 7
2015-10-01 10:36:54 +02:00
Fabien Potencier 25855eb71b minor #16041 Use PHPUnit 5.0 for PHP 7 (stof)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16041).

Discussion
----------

Use PHPUnit 5.0 for PHP 7

PHPUnit 4.8 is not fully compatible with PHP 7, and won't be fixed for full support. See https://github.com/sebastianbergmann/phpunit/issues/1882

Commits
-------

1129d60 Use PHPUnit 5.0 for PHP 7
2015-10-01 10:36:33 +02:00
Christophe Coevoet 1129d608de Use PHPUnit 5.0 for PHP 7
PHPUnit 4.8 is not fully compatible with PHP 7, and won't be fixed for
full support.
2015-10-01 10:36:32 +02:00
Fabien Potencier ff6d9c1e50 minor #16037 [Security] made tests work for 2.8 and 3.0 (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

[Security] made tests work for 2.8 and 3.0

| 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

Commits
-------

0b7e1f3 [Security] made tests work for 2.8 and 3.0
2015-10-01 08:28:23 +02:00
Fabien Potencier 0b7e1f3e4d [Security] made tests work for 2.8 and 3.0 2015-10-01 08:20:17 +02:00
Fabien Potencier fdb2073253 bug #16033 [Form] made the tests compatible with 3.0 (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] made the tests compatible with 3.0

| 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

Commits
-------

795da85 [Form] made the tests compatible with 3.0
2015-10-01 07:58:36 +02:00