Commit Graph

32899 Commits

Author SHA1 Message Date
Nicolas Grekas
4129fd2a83 bug #24304 [FrameworkBundle] Fix Routing\DelegatingLoader (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix Routing\DelegatingLoader

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

Spotted while reviewing: the default controller is not always a string, so parsing should only be done conditionally.

Commits
-------

a69c1b2 [FrameworkBundle] Fix Routing\DelegatingLoader
2017-09-25 11:27:18 +02:00
Nicolas Grekas
ec111877fa feature #24301 [DI] Add AutowireRequiredMethodsPass to fix bindings for @required methods (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Add AutowireRequiredMethodsPass to fix bindings for `@required` methods

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

Spotted while doing a SF4 workshop :)

Discovery of `@required` methods should be split from AutowirePass so that bindings can apply to these methods also when autowiring is enabled.

Commits
-------

dc55dd2 [DI] Add AutowireRequiredMethodsPass to fix bindings for `@required` methods
2017-09-25 11:24:50 +02:00
Nicolas Grekas
0c0a0525a1 feature #24226 [Cache] Add ResettableInterface to allow resetting any pool's local state (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Add ResettableInterface to allow resetting any pool's local state

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

To allow pools to leverage #24155 so that they can be used in multi-request loops.

Commits
-------

14c91f2 [Cache] Add ResettableInterface to allow resetting any pool's local state
2017-09-25 11:23:16 +02:00
Nicolas Grekas
dc55dd2c99 [DI] Add AutowireRequiredMethodsPass to fix bindings for @required methods 2017-09-25 10:48:11 +02:00
Nicolas Grekas
14c91f2bc9 [Cache] Add ResettableInterface to allow resetting any pool's local state 2017-09-25 10:20:08 +02:00
Iltar van der Berg
1ba4dd9b44 Added null as explicit return type (?TokenInterface) 2017-09-25 09:46:32 +02:00
Maxime Steinhausser
3cb507ba33 bug #24305 [HttpKernel] Make array vs "::" controller definitions consistent (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[HttpKernel] Make array vs "::" controller definitions consistent

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

Defining a controller using `[Foo::class, 'someAction']` vs `App\Controller\Foo::someAction` should end up produce the same result: a container lookup.

Commits
-------

f0f9a6691c [HttpKernel] Make array vs "::" controller definitions consistent
2017-09-24 20:01:04 +02:00
Maxime Steinhausser
88549fff5b [DI][DX] Throw exception on some ContainerBuilder methods used from extensions 2017-09-24 17:28:40 +02:00
Nicolas Grekas
a69c1b2ae1 [FrameworkBundle] Fix Routing\DelegatingLoader 2017-09-24 15:55:14 +02:00
Nicolas Grekas
f617882ba7 minor #24286 added missing @author tag for new class (OskarStark)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #24286).

Discussion
----------

added missing @author tag for new class

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | --<!--highly recommended for new features-->

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

just a small fix

Commits
-------

e17426c added missing @author tag for new class
2017-09-24 15:33:47 +02:00
Oskar Stark
e17426c65c added missing @author tag for new class 2017-09-24 15:33:47 +02:00
Nicolas Grekas
f0f9a6691c [HttpKernel] Make array vs "::" controller definitions consistent 2017-09-24 15:32:05 +02:00
Nicolas Grekas
1ebc31aa9f Fix tests 2017-09-24 15:31:29 +02:00
Fabien Potencier
b590683836 feature #24303 [FrameworkBundle] allow forms without translations and validator (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] allow forms without translations and validator

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/flex#26, symfony/recipes#191, symfony/recipes#193
| License       | MIT
| Doc PR        |

The Form component is perfectly usable without the Translation and Validator components. We should allow the same when using the FrameworkBundle to improve the user experience in Symfony Flex applications (see the linked issue).

Commits
-------

cb6ead1635 allow forms without translations and validator
2017-09-24 12:15:51 +02:00
Christian Flothmann
cb6ead1635 allow forms without translations and validator 2017-09-24 10:18:44 +01:00
Robin Chalas
4badda981e feature #24291 [SecurityBundle] Reset the authentication token between requests (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Reset the authentication token between requests

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

Follow-up to #24155. This PR resets the token storage, making sure there's no user logged in at the beginning of a new request.

Commits
-------

e46b366 Reset the authentication token between requests.
2017-09-24 11:00:32 +02:00
Nicolas Grekas
e84d2d0943 feature #24280 [VarDumper] Make dump() a little bit more easier to use (freekmurze)
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #24280).

Discussion
----------

[VarDumper] Make `dump()` a little bit more easier to use

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

Imagine you have this code:

```php
$object->method();
```

If you want to dump the object, this is currently the way to do that:

```php
dump($object);

$object->method();
```

This PR makes adding (and removing) the `dump` function easier. When using one argument is used, that argument is returned.

```php
dump($object)->method();
```

When dumping multiple things, they all get returned. So you can to this:

```php
$object->someMethod(...dump($arg1, $arg2, $arg3));
```

Commits
-------

42f0984 [VarDumper] Make `dump()` a little bit more easier to use
2017-09-23 16:36:46 +01:00
Freek Van der Herten
42f0984e71 [VarDumper] Make dump() a little bit more easier to use 2017-09-23 16:34:50 +01:00
Maxime Steinhausser
0a9d46d8c9 minor #24294 [Form] Add ambiguous & exception debug:form tests (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Add ambiguous & exception debug:form tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | complete #23694  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Just completing tests a bit for this new feature. cc @yceruto

Commits
-------

35f9c0ba2d [Form] Add ambiguous & exception debug:form tests
2017-09-23 00:44:27 +02:00
Maxime Steinhausser
35f9c0ba2d [Form] Add ambiguous & exception debug:form tests 2017-09-23 00:36:11 +02:00
Alexander M. Turek
e46b366fc5 Reset the authentication token between requests. 2017-09-22 20:41:17 +02:00
Maxime Steinhausser
2e0cb6055f feature #24277 [Serializer] Getter for extra attributes in ExtraAttributesException (mdeboer)
This PR was squashed before being merged into the 3.4 branch (closes #24277).

Discussion
----------

[Serializer] Getter for extra attributes in ExtraAttributesException

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes (failure unrelated)
| Fixed tickets |
| License       | MIT

This PR adds a public getter for the extra attributes in `ExtraAttributesException` and makes it easier to create custom exception messages (e.g. JSON formatted).

Commits
-------

cb935e7 [Serializer] Getter for extra attributes in ExtraAttributesException
2017-09-22 15:07:49 +02:00
Maarten de Boer
cb935e789e [Serializer] Getter for extra attributes in ExtraAttributesException 2017-09-22 15:07:13 +02:00
Nicolas Grekas
2e608f791c bug #24285 [DI] Dont use JSON_BIGINT_AS_STRING (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Dont use JSON_BIGINT_AS_STRING

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

Because it's incompatible with stringy keys, for unknown reason, see https://3v4l.org/IHSqv

Commits
-------

830f286 [DI] Dont use JSON_BIGINT_AS_STRING
2017-09-22 12:00:22 +01:00
Nicolas Grekas
830f286464 [DI] Dont use JSON_BIGINT_AS_STRING 2017-09-22 11:57:45 +01:00
Roland Franssen
02dcdca014 [TwigBundle] Remove profiler related scripting 2017-09-21 20:21:04 +02:00
Roland Franssen
1c595fcf48 [TwigBundle][WebProfilerBundle] Switch to DOMContentLoaded event 2017-09-21 19:21:40 +02:00
Roland Franssen
ea4b0966ab [WebProfilerBundle] Hide inactive tabs from CSS 2017-09-21 19:20:03 +02:00
Roland Franssen
0c10f97f98 [TwigBundle] Make deprecations scream in logs 2017-09-21 19:18:48 +02:00
Roland Franssen
03cd9e553b [TwigBundle] Hide logs if unavailable, i.e. webprofiler 2017-09-21 19:18:48 +02:00
Javier Eguiluz
b28dfe1cbc bug #24255 [TwigBundle] Break long lines in exceptions (kevin-verschaeve)
This PR was merged into the 3.3 branch.

Discussion
----------

[TwigBundle] Break long lines in exceptions

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

Break long lines in exception to stay in screen

Before:
![exception_before](https://user-images.githubusercontent.com/2345927/30586794-63b35b44-9d31-11e7-90ce-507af56934d0.png)

After:
![exception_after](https://user-images.githubusercontent.com/2345927/30586801-691c2548-9d31-11e7-9af4-54c01b4cc400.png)

Commits
-------

1db99f316d [TwigBundle] Break long lines in exceptions
2017-09-21 09:02:40 +02:00
Nicolas Grekas
701d41cc33 feature #24257 [HttpKernel][DI] Enable Kernel to implement CompilerPassInterface (nicolas-grekas)
This PR was squashed before being merged into the 3.4 branch (closes #24257).

Discussion
----------

[HttpKernel][DI] Enable Kernel to implement CompilerPassInterface

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

In the same spirit as #13761 that allowed DI exts to be also compiler passes, and as #23812 that allowed the kernel to listen to events, in our new bundle-less world, should we allow the kernel to register itself as a compiler pass? That would make some scenario possible (like having a `TestKernel` that turns some services public.)

Commits
-------

6973a1a [HttpKernel][DI] Enable Kernel to implement CompilerPassInterface
2017-09-20 15:13:22 +02:00
Nicolas Grekas
6973a1ae3b [HttpKernel][DI] Enable Kernel to implement CompilerPassInterface 2017-09-20 15:13:20 +02:00
Nicolas Grekas
2f86474267 feature #23834 [DI] Add "PHP fluent format" for configuring the container (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Add "PHP fluent format" for configuring the container

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

This PR allows one to write DI configuration using just PHP, with full IDE auto-completion.
Example:
```php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo;

return function (ContainerConfigurator $c) {

    $c->import('basic.php');

    $s = $c->services()->defaults()
        ->public()
        ->private()
        ->autoconfigure()
        ->autowire()
        ->tag('t', array('a' => 'b'))
        ->bind(Foo::class, ref('bar'))
        ->private();

    $s->set(Foo::class)->args([ref('bar')])->public();
    $s->set('bar', Foo::class)->call('setFoo')->autoconfigure(false);

};
```

Commits
-------

814cc31 [DI] Add "PHP fluent format" for configuring the container
2017-09-20 15:06:57 +02:00
Nicolas Grekas
20ecf91d52 feature #24180 [Routing] Add PHP fluent DSL for configuring routes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] Add PHP fluent DSL for configuring routes

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

If we add a PHP DSL for DI config (#23834), we must have a similar one for routing. Here it is. See fixtures.

So, you always start with a `RoutingConfigurator $routes`, which allows you to:
```php
$routes->add($name, $path); // adds a route
$routes->import($resource, $type = null, $ignoreErrors = false); // imports routes
$routes->collection($name = ''); // starts a collection, all *names* might be prefixed
```

then
- for "import" and "collection", you can `->prefix($path)`;
- for "add" and "collection", you can fluently "add" several times;
- for "collection" you add sub"`->collection()`";
- and on all, you can configure the route(s) with:
```php
->defaults(array $defaults)
->requirements(array $requirements)
->options(array $options)
->condition($condition)
->host($pattern)
->schemes(array $schemes)
->methods(array $methods)
->controller($controller)
```

Commits
-------

f433c9a [Routing] Add PHP fluent DSL for configuring routes
2017-09-20 15:01:12 +02:00
Robin Chalas
a40c94d8e3 bug #24219 [Console] Preserving line breaks between sentences according to the exception message (yceruto)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Preserving line breaks between sentences according to the exception message

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

Commits
-------

e2d4904 Render all line breaks according to the exception message
2017-09-20 15:00:12 +02:00
Nicolas Grekas
814cc31e57 [DI] Add "PHP fluent format" for configuring the container 2017-09-20 09:09:19 +02:00
Nicolas Grekas
f433c9a79d [Routing] Add PHP fluent DSL for configuring routes 2017-09-20 08:48:50 +02:00
Nicolas Grekas
aad62c427c minor #24228 [Serializer] Add local cache to normalizers (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Add local cache to normalizers

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

Should help making the Serializer a bit faster.

Commits
-------

b0c5cf0 [Serializer] Add local cache to normalizers
2017-09-20 07:22:30 +02:00
Nicolas Grekas
779e8edf44 feature #24232 [Bridge\Doctrine] Add "DoctrineType::reset()" method (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Bridge\Doctrine] Add "DoctrineType::reset()" method

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

Works with https://github.com/doctrine/DoctrineBundle/pull/695

Commits
-------

dce1eb9 [Bridge\Doctrine] Add "DoctrineType::reset()" method
2017-09-20 07:20:06 +02:00
Nicolas Grekas
0e73d7126e fixes 2017-09-19 23:53:27 +02:00
Nicolas Grekas
6f8336dcfa bug #24266 [DI] Fix private-by-default BC layer (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix private-by-default BC layer

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

Spotted while merging 3.4 into master and by looking at the cross-versions CI.

Commits
-------

ff2ab58 [DI] Fix private-by-default BC layer
2017-09-19 23:31:54 +02:00
Nicolas Grekas
ff2ab5831a [DI] Fix private-by-default BC layer 2017-09-19 23:28:23 +02:00
Yonel Ceruto
e2d4904a84 Render all line breaks according to the exception message 2017-09-19 16:27:25 -04:00
Maxime Steinhausser
139398faf7 minor #24258 [Form] Fix phpdoc (hason)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix phpdoc

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

Commits
-------

f13081d12c [Form] Fix phpdoc
2017-09-19 19:12:22 +02:00
Nicolas Grekas
ad4bc6b647 feature #24238 [DI] Turn services and aliases private by default, with BC layer (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Turn services and aliases private by default, with BC layer

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

With this PR, all services and aliases are made private by default.
This is done in a BC way, thanks to the layer introduced in #24104.

We will require bundles to explicitly opt-in for "public", either using "defaults", or stating `public="true"` explicitly. Same in DI extension, where calling `->setPublic(true)` will be required in 4.0.

Commits
-------

9948b09 [DI] Turn services and aliases private by default, with BC layer
2017-09-19 18:13:26 +02:00
Martin Hasoň
f13081d12c [Form] Fix phpdoc 2017-09-19 13:52:15 +02:00
Kevin Verschaeve
1db99f316d [TwigBundle] Break long lines in exceptions 2017-09-19 12:46:10 +02:00
Nicolas Grekas
9948b09c6d [DI] Turn services and aliases private by default, with BC layer 2017-09-19 11:28:48 +02:00
Nicolas Grekas
949b17a2c7 bug #24192 [PhpUnitBridge] do not require an error context (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[PhpUnitBridge] do not require an error context

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

The error context argument of an error handler is deprecated as of PHP
7.2. Requiring it in the error handler of the SymfonyTestsListenerTrait
will make error handlers fail that are executed when running PHPUnit
tests and forward the error handling to the previously registered error
handler.

Commits
-------

10ce932 [PhpUnitBridge] do not require an error context
2017-09-19 11:20:34 +02:00