Commit Graph

37821 Commits

Author SHA1 Message Date
Fabien Potencier ce73293532 feature #27678 Allow to configure some options of the profiler interface (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27678).

Discussion
----------

Allow to configure some options of the profiler interface

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

This PR adds some configurable options for the interface of the Symfony profiler.

First, you can configure the theme. The current one remains as the default light theme, but there's a new dark theme. A quick comparison:

![theme-light](https://user-images.githubusercontent.com/73419/41765883-ad2f9e6a-7605-11e8-87fb-881afbffc788.png)

![theme-dark](https://user-images.githubusercontent.com/73419/41765888-af597800-7605-11e8-9097-eb9667b82136.png)

The second option is the width of the profiler pages. The current normal width remains as the default, but there's a new dynamic width that is as width as the browser window. The "Performance" panel is the one where this option makes more sense. A quick comparison when using a 2560 x 1440 resolution:

![settings-width-normal](https://user-images.githubusercontent.com/73419/41765890-b4affe14-7605-11e8-80b9-99ca54b07b83.png)

![settings-width-wide](https://user-images.githubusercontent.com/73419/41765891-b6506876-7605-11e8-95c4-664b1fb0f3dd.png)

All settings are managed by JavaScript and persisted in localStorage, so everything is fast and simple:

![settings-in-action](https://user-images.githubusercontent.com/73419/41765926-ce04f31a-7605-11e8-93f4-a7f810f034a5.gif)

-----

Note to reviewers:

* This is the first draft of the PR.
* I expect: approval/rejection of this idea and general comments of the proposed solution.

Once this is accepted, I will finish the feature tweaking/fixing the design and the HTML/CSS/JS/Twig code. Don't comment on those details for now. Thanks!

Commits
-------

944c53fb0e Allow to configure some options of the profiler interface
2018-07-18 14:37:32 +02:00
Javier Eguiluz 944c53fb0e Allow to configure some options of the profiler interface 2018-07-18 14:37:24 +02:00
Fabien Potencier f7583be1da minor #27983 [DX] Fix PHPDoc return type (Jean85)
This PR was merged into the 2.8 branch.

Discussion
----------

[DX] Fix PHPDoc return type

GetResponseEvent::getResponse() may return null too

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

While doing static analysis on my code, I got a false negative for this method, since it may return null, but the PHPDoc says otherwise.

Commits
-------

8e49598788 Fix PHPDoc return type
2018-07-18 14:32:06 +02:00
Alessandro Lai 8e49598788
Fix PHPDoc return type
GetResponseEvent::getResponse() may return null too
2018-07-18 13:02:07 +02:00
Fabien Potencier 5362ff35fc feature #27943 [Security] Deprecate returning stringish objects from Security::getUser (ro0NL)
This PR was squashed before being merged into the 4.2-dev branch (closes #27943).

Discussion
----------

[Security] Deprecate returning stringish objects from Security::getUser

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

`$user` can also be an object implementing `__ toString`. Here we want only true user objects...

Commits
-------

8c410da7e7 [Security] Deprecate returning stringish objects from Security::getUser
2018-07-18 05:37:25 +02:00
Roland Franssen 8c410da7e7 [Security] Deprecate returning stringish objects from Security::getUser 2018-07-18 05:37:18 +02:00
Fabien Potencier 1e2b37f2fe fixed CS 2018-07-18 05:33:14 +02:00
Fabien Potencier d8f78c5314 feature #27956 Added types and tweaked PHPdoc of clickLink() and submitForm() methods (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27956).

Discussion
----------

Added types and tweaked PHPdoc of clickLink() and submitForm() methods

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | -

I wanted to suggest these changes to #27807 but I failed to do that before it was merged.

Commits
-------

be9d578d4b Added types and tweaked PHPdoc of clickLink() and submitForm() methods
2018-07-18 05:32:27 +02:00
Javier Eguiluz be9d578d4b Added types and tweaked PHPdoc of clickLink() and submitForm() methods 2018-07-18 05:32:21 +02:00
Fabien Potencier 9dbde41b16 feature #27976 [Security] Remember me: allow to set the samesite cookie flag (dunglas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Security] Remember me: allow to set the samesite cookie flag

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? |no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | no
| Fixed tickets | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#10077

This PR allows to set the [`samesite`](https://www.owasp.org/index.php/SameSite) cookie flag for remember me token cookies.

Commits
-------

337e8ef044 [Security] Remember me: allow to set the samesite cookie flag
2018-07-18 05:30:50 +02:00
Fabien Potencier 0902337e19 minor #27975 [MonologBridge] Improve FirePHPHandler (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[MonologBridge] Improve FirePHPHandler

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |n/a
| License       | MIT
| Doc PR        | n/a

Fix a call to a parent static property. Remove a useless call to `getRequest()`

Commits
-------

1d93b5e26a [MonologBridge] Improve FirePHPHandler
2018-07-18 05:23:09 +02:00
Fabien Potencier 7b853bb4cb feature #27978 [WebProfilerBundle] Show relative path of the template and improving panel view (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[WebProfilerBundle] Show relative path of the template and improving panel view

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

| Before | After |
| --- | --- |
| ![twig-panel-before](https://user-images.githubusercontent.com/2028198/42819536-dfbed0c6-89a1-11e8-8eb1-8151172e1ad7.png) | ![twig-panel-after](https://user-images.githubusercontent.com/2028198/42819544-e5e73182-89a1-11e8-9d49-80e343040260.png) |

https://github.com/symfony/symfony/pull/27978#discussion_r203027281:

| Before | After |
| --- | --- |
| ![twig-toolbar-icon-before](https://user-images.githubusercontent.com/2028198/42820333-e35684c0-89a3-11e8-8b3a-f02bb835103c.png) | ![twig-toolbar-icon-after](https://user-images.githubusercontent.com/2028198/42820342-eac3a95e-89a3-11e8-929e-ef4fb1e392bb.png)
| ![twig-profiler-icon-before](https://user-images.githubusercontent.com/2028198/42820356-f3f04b72-89a3-11e8-9209-41ed37cf0915.png) | ![twig-profiler-icon-after](https://user-images.githubusercontent.com/2028198/42820370-fef24336-89a3-11e8-9b09-5ba1bf97df67.png) |

In addition, I added some visual improvements.

Commits
-------

bcd8058478 Show relative path of the template and improving panel view
2018-07-18 04:58:24 +02:00
Yonel Ceruto bcd8058478 Show relative path of the template and improving panel view 2018-07-17 12:46:17 -04:00
Kévin Dunglas 337e8ef044
[Security] Remember me: allow to set the samesite cookie flag 2018-07-17 14:51:24 +02:00
Kévin Dunglas 1d93b5e26a
[MonologBridge] Improve FirePHPHandler 2018-07-17 14:18:04 +02:00
Javier Eguiluz efc4fb3908 minor #27971 Fix SVGs not scaling in IE9, IE10, and IE11 (yvh)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix SVGs not scaling in IE9, IE10, and IE11

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

Fix scaling issue in IE9, IE10 and IE11

Before change:
[![web profiler before](https://preview.ibb.co/nQ2kDd/web_profiler_before.png)](https://ibb.co/cOBdYd)

After change:
[![web profiler after](https://preview.ibb.co/kCKnRy/web_profiler_after.png)](https://ibb.co/ntcJYd)

No breaking chrome:
[![web profiler chrome](https://preview.ibb.co/dGQ5Dd/web_profiler_chrome.png)](https://ibb.co/fp1dYd)

Commits
-------

ad2e166d4e Fix SVGs not scaling in IE9, IE10, and IE11
2018-07-17 12:39:25 +02:00
Yannick Vanhaeren ad2e166d4e Fix SVGs not scaling in IE9, IE10, and IE11 2018-07-17 09:53:55 +02:00
Fabien Potencier 01c65c868e bug #27968 [FrameworkBundle] add missing XSD entry for taggable cache pools (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] add missing XSD entry for taggable cache pools

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

Commits
-------

d59cf7756c add missing XSD entry for taggable cache pools
2018-07-16 16:46:17 +02:00
Fabien Potencier f6c5c85042 bug #27950 [FrameworkBundle] fix compatibility with older Cache versions (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] fix compatibility with older Cache versions

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

FrameworkBundle 4.2 will be compatible with older versions of the Cache
component. In those versions adapters don't implement `ResetInterface`.
For backwards compatibility they still need to be tagged.

Commits
-------

ec795cca78 fix compatibility with older Cache versions
2018-07-16 16:35:19 +02:00
Christian Flothmann d59cf7756c add missing XSD entry for taggable cache pools 2018-07-16 16:34:58 +02:00
Fabien Potencier 18ba2a81a7 Merge branch '4.1'
* 4.1:
  fixed typo
  [FrameworkBundle] fixed brackets position in method calls
  Add placeholder support in bootstrap 4 file fields
  [Form] Improve rendering of `file` field in bootstrap 4
  [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
  [Security] Update user phpdoc on tokens
  [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
  suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
  [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
  [HttpFoundation] Fixed phpdoc for get method of HeaderBag
  fix typo in ContainerBuilder docblock
  [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
  [Console] correctly return parameter's default value on "--"
  [DependencyInjection] add missing test for #27710
  [EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset
  Fix serialization of abstract items with groups across multiple entities
2018-07-16 16:05:48 +02:00
Fabien Potencier 6fd9d54e95 Merge branch '4.0' into 4.1
* 4.0:
  fixed typo
  [FrameworkBundle] fixed brackets position in method calls
  [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
  [Security] Update user phpdoc on tokens
  [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
  suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
  [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
  [HttpFoundation] Fixed phpdoc for get method of HeaderBag
  fix typo in ContainerBuilder docblock
  [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
  [Console] correctly return parameter's default value on "--"
2018-07-16 16:05:40 +02:00
Fabien Potencier 2afd49ff17 fixed typo 2018-07-16 16:05:32 +02:00
Fabien Potencier e4f62ea0d2 Merge branch '3.4' into 4.0
* 3.4:
  [FrameworkBundle] fixed brackets position in method calls
  [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
  [Security] Update user phpdoc on tokens
  [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
  suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
  [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
  [HttpFoundation] Fixed phpdoc for get method of HeaderBag
  fix typo in ContainerBuilder docblock
  [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
  [Console] correctly return parameter's default value on "--"
2018-07-16 15:59:46 +02:00
Fabien Potencier 2b01d59481 Merge branch '2.8' into 3.4
* 2.8:
  [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
  [Security] Update user phpdoc on tokens
  [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
  suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
  [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
  [HttpFoundation] Fixed phpdoc for get method of HeaderBag
  fix typo in ContainerBuilder docblock
2018-07-16 15:57:19 +02:00
Fabien Potencier 28abb38dd5 minor #27966 [FrameworkBundle] fixed brackets position in method calls (destillat)
This PR was submitted for the 3.2 branch but it was merged into the 3.4 branch instead (closes #27966).

Discussion
----------

[FrameworkBundle] fixed brackets position in method calls

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

Fixed wrong colons positions in hasDefinition method calls

Commits
-------

b5863bc7e8 [FrameworkBundle] fixed brackets position in method calls
2018-07-16 15:56:21 +02:00
Ivan Nikolaev b5863bc7e8 [FrameworkBundle] fixed brackets position in method calls 2018-07-16 15:56:13 +02:00
Fabien Potencier e247b1dfd9 bug #27958 [Form] Remaining changes for bootstrap 4 file fields (apfelbox)
This PR was merged into the 4.1 branch.

Discussion
----------

[Form] Remaining changes for bootstrap 4 file fields

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no>
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | —
| License       | MIT
| Doc PR        | —

Hi again,

This is a follow-up PR for #27919

Apparently I talked about it in the previous PR, but forgot to actually push the change. Sorry about that! 😞

This PR no actually adds this instead of just talking about it:

![2018-07-15 at 17 52](https://user-images.githubusercontent.com/1032411/42735630-e19b22be-8857-11e8-85b8-6d64e17c2be2.png)

Sorry again, just forgot to actually update the last PR.

Commits
-------

3cd2eef6e6 Add placeholder support in bootstrap 4 file fields
2018-07-16 15:53:00 +02:00
Fabien Potencier cc170ebc33 feature #27891 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability (jfredon)
This PR was squashed before being merged into the 4.2-dev branch (closes #27891).

Discussion
----------

[Finder] Allow arrays as parameters of some methods for better fluent experience and code readability

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

Makes the Finder library a little more convenient to use by allowing the use of arrays as parameters of methods that can be called multiple times.

This way of doing things was already present for the `Finder::in()` and `Finder::exclude()` methods, it has been extended to other methods that can be called several times to cumulate their effects.
This allows a better use of fluent methods by avoiding breaking the chaining to iterate on array variables (a little more complexity in the Finder library for less complexity in applications that uses it).

```php
// we could use
$finder = Finder::create()->in($fileRepository)->name($fileList);

// instead of
$finder = Finder::create()->in($fileRepository);
foreach ($fileList as $file) {
    $finder->name($file);
}
```

In `.php_cs` files, this would make the code more readable by separating the configuration of the execution code:

```php
<?php
const RULES = [
    '@Symfony' => true,
    '@Symfony:risky' => true,
];
const EXCLUDED_DIRS = [
    // directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
    'Symfony/Component/Cache/Tests/Marshaller/Fixtures',
    'Symfony/Component/DependencyInjection/Tests/Fixtures',
    // ...
];
const EXCLUDED_FILES = [
    // file content autogenerated by `var_export`
    'Symfony/Component/Translation/Tests/fixtures/resources.php',
    // test template
    'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php',
    // ...
];

return PhpCsFixer\Config::create()
    ->setRules(RULES)
    ->setRiskyAllowed(true)
    ->setFinder(
        PhpCsFixer\Finder::create()
            ->in(__DIR__.'/src')
            ->append(array(__FILE__))
            ->exclude(EXCLUDED_DIRS)
            ->notPath(EXCLUDED_FILES)
    )
;
```

TODO
- [x] complete the tests to validate the new syntax on all modified methods
- [x] submit changes to the Finder documentation

Commits
-------

ad97cd7121 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability
2018-07-16 14:56:49 +02:00
Julien Fredon ad97cd7121 [Finder] Allow arrays as parameters of some methods for better fluent experience and code readability 2018-07-16 14:56:42 +02:00
Jannik Zschiesche 3cd2eef6e6 Add placeholder support in bootstrap 4 file fields 2018-07-16 11:56:53 +02:00
Fabien Potencier 25df3e32cb bug #27919 [Form] Improve rendering of `file` field in bootstrap 4 (apfelbox)
This PR was squashed before being merged into the 4.1 branch (closes #27919).

Discussion
----------

[Form] Improve rendering of `file` field in bootstrap 4

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

Hi 👋

currently adding a file type to a form looks weird in the bootstrap 4 form themes:

```php
$builder
    ->add("pdfFile", FileType::class, [
        "label" => "PDF",
    ]);
```

## Before

### Vertical Form

![2018-07-10 at 21 36](https://user-images.githubusercontent.com/1032411/42533175-6b88e33a-8489-11e8-927a-8e987f362913.png)

### Horizontal Form

![2018-07-10 at 21 37](https://user-images.githubusercontent.com/1032411/42533197-7d45944c-8489-11e8-970f-79b18a273366.png)

## After

### Vertical Form

![2018-07-10 at 21 38](https://user-images.githubusercontent.com/1032411/42533229-8ebe44a8-8489-11e8-94e0-891403063476.png)

### Horizontal Form

![2018-07-10 at 21 38](https://user-images.githubusercontent.com/1032411/42533247-99782db4-8489-11e8-9f66-30a5dccdaa9d.png)

## Things to consider

There are three labels here:

![2018-07-10 at 21 40](https://user-images.githubusercontent.com/1032411/42533370-ecbaf63c-8489-11e8-9be8-1c8c3342c459.png)

1) the actual field label. Here the `$options["label"]` is used.
2) the placeholder. Here `$options["attr"]["placeholder"] ?? ""` is used **new**
3) the label on the button. This is set in CSS actually, on an `::after` attribute.

There isn't much we can do about 3) because there is no inline HTML-way to overwrite the style of a pseudo element. So if the app developer wants to have localization in this field as well, (s)he has to set it in their CSS file [as described in the bootstrap docs](https://getbootstrap.com/docs/4.0/components/forms/#file-browser)

## Todo

- [x] ~~WIP because I haven't managed to get the test suite to run locally yet, so we will debug with Travis 🙌~~  okay, getting them to work is really, really easy, but you just have to get over yourself and do it 🙄

Commits
-------

32ad5d9f9c [Form] Improve rendering of `file` field in bootstrap 4
2018-07-15 09:26:40 +02:00
Jannik Zschiesche 32ad5d9f9c [Form] Improve rendering of `file` field in bootstrap 4 2018-07-15 09:26:33 +02:00
Fabien Potencier 13a40033da minor #27954 [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument (emodric)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] Fix PHPDoc for FormConfigBuilder $dataClass argument

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

`$dataClass` constructor argument of `FormConfigBuilder` obviously allows `null` as its value and it even has a `?string` typehint in `master` branch, so this fixes the PHPDoc typehint to match.

Commits
-------

9854a26981 [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument
2018-07-15 09:24:14 +02:00
Edi Modrić 9854a26981 [Form] Fix PHPDoc for FormConfigBuilder $dataClass argument 2018-07-14 16:42:20 +02:00
Christian Flothmann ec795cca78 fix compatibility with older Cache versions
FrameworkBundle 4.2 will be compatible with older versions of the Cache
component. In those versions adapters don't implement `ResetInterface`.
For backwards compatibility they still need to be tagged.
2018-07-14 10:12:57 +02:00
Fabien Potencier eb112a5288 feature #27829 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor (dunglas)
This PR was squashed before being merged into the 4.2-dev branch (closes #27829).

Discussion
----------

[DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  |no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

As explained by @stof in https://github.com/symfony/symfony/pull/27735#discussion_r199797412, injecting the `ClassMetadataFactory` directly can lead to issues when resetting the EntityManager.

This PR deprecates this usage and encourages to inject the entity manager directly.

Commits
-------

3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor
2018-07-13 22:22:21 +02:00
Kévin Dunglas 3aab4a1270 [DoctrineBridge] Inject the entity manager instead of the class metadata factory in DoctrineExtractor 2018-07-13 22:22:15 +02:00
Fabien Potencier 091f9ff386 minor #27940 [Security] Update user phpdoc on tokens (ro0NL)
This PR was squashed before being merged into the 2.8 branch (closes #27940).

Discussion
----------

[Security] Update user phpdoc on tokens

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

As implemented here:

1e16a8b979/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php (L78-L88)

Note IMHO `string|object` is intended, and used consistently elsewhere, e.g.: f80376217d/src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php (L27)

Commits
-------

7306018a30 [Security] Update user phpdoc on tokens
2018-07-13 22:20:16 +02:00
Roland Franssen 7306018a30 [Security] Update user phpdoc on tokens 2018-07-13 22:20:03 +02:00
Fabien Potencier 7acf16e206 bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2

| 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

Hi,

This PR fixes an issue introduced by Bootstrap 4.1.2: it vertically aligns SVG icons in the middle instead of letting it stay at the baseline.

I'm not sure this PR is relevant but, if I'm not the only Bootstrap user, I guess it will be useful to many and it does not break anything: it enforces what should be default.

[Update] Here is the related PR merged into Bootstrap that causes the issue: https://github.com/twbs/bootstrap/pull/25874

[Update 2] Before the fix:

![fix_before](https://user-images.githubusercontent.com/3929498/42696806-966cfc9e-86b9-11e8-90a9-7a6dc18a1809.png)

After the fix:

![fix_after](https://user-images.githubusercontent.com/3929498/42696821-9df8ef22-86b9-11e8-8c6c-62a4afa752a3.png)

Commits
-------

ecef6f1b9b [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2
2018-07-13 21:56:11 +02:00
Fabien Potencier e379146909 minor #27947 Rename Contract to Contracts (fabpot)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Rename Contract to Contracts

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

To avoid confusions between the composer name and the namespace.

Commits
-------

682836da9c renamed Contract to Contracts
2018-07-13 19:14:30 +02:00
Fabien Potencier 682836da9c renamed Contract to Contracts 2018-07-13 19:06:58 +02:00
jmsche ecef6f1b9b [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 2018-07-13 16:00:59 +02:00
Kévin Dunglas aaf7e889f7
Fix tests 2018-07-13 14:52:14 +02:00
Fabien Potencier 1e16a8b979 feature #27093 Add symfony/contracts: a set of abstractions extracted out of the Symfony components (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Add symfony/contracts: a set of abstractions extracted out of the Symfony components

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

A set of abstractions extracted out of the Symfony components.

This is a topic I've been thinking about for a long time. I feel like the time has come for Symfony to publish some abstractions so that people could build on them in a decoupled way.
I've identified interfaces in some components that would greatly benefit from being moved out from the components where they are for now. E.g. #26929 is something that has a broader scope than the Cache component itself.

By putting them in a new `symfony/abstractions` package, we would allow more innovation in the Symfony community, at the abstraction level.

In order to start small, I propose only one interface that gathers a concept that is shared amongst many components already: `ResetInterface`. It would provide a standard `reset()` method, whose purpose is to set an object back to its initial state, allowing it to be reused many times with no side effects/leaks related to its history. By this definition, it could also be autoconfigured (as done here, see update in FrameworkExtension). See wording in the docblock in the attached source code.

Ideally, I'd like this package to provide not only interfaces, by also generic traits, and reference test suites when possible. We could work on adding more abstractions during the 4.2 cycle. WDYT?

## Here is the attached README:

A set of abstractions extracted out of the Symfony components.

Can be used to build on semantics that the Symfony components proved useful - and
that already have battle tested implementations.

Design Principles
-----------------

 * contracts are split by domain, each into their own sub-namespaces;
 * contracts are small and consistent sets of PHP interfaces, traits, normative
   docblocks and reference test suites when applicable, etc.;
 * all contracts must have a proven implementation to enter this repository;
 * they must be backward compatible with existing Symfony components.

FAQ
---

### How to use this package?

The abstractions in this package are useful to achieve loose coupling and
interoperability. By using the provided interfaces as type hints, you are able
to reuse any implementations that match their contracts. It could be a Symfony
component, or another one provided by the PHP community at large.

Depending on their semantics, some interfaces can be combined with autowiring to
seamlessly inject a service in your classes.

Others might be useful as labeling interfaces, to hint about a specific behavior
that could be enabled when using autoconfiguration or manual service tagging (or
any other means provided by your framework.)

### How is this different from PHP-FIG's PSRs?

When applicable, the provided contracts are built on top of PHP-FIG's PSR. We
encourage relying on them and won't duplicate the effort. Still, the FIG has
different goals and different processes. Here, we don't need to seek universal
standards. Instead, we're providing abstractions that are compatible with the
implementations provided by Symfony. This should actually also contribute
positively to the PHP-FIG (from which Symfony is a member), by hinting the group
at some abstractions the PHP world might like to take inspiration from.

### Why isn't this package split into several packages?

Putting all interfaces in one package eases discoverability and dependency
management. Instead of dealing with a myriad of small packages and the
corresponding matrix of versions, you just need to deal with one package and one
version. Also when using IDE autocompletion or just reading the source code, it
makes it easier to figure out which contracts are provided.

There are two downsides to this approach: you may have unused files in your
`vendor/` directory, and in the future, it will be impossible to use two
different sub-namespaces in different major versions of the package. For the
"unused files" downside, it has no practical consequences: their file sizes are
very small, and there is no performance overhead at all since they are never
loaded. For major versions, this package follows the Symfony BC + deprecation
policies, with an additional restriction to never remove deprecated interfaces.

Resources
---------

  * [Documentation](https://symfony.com/doc/current/components/contracts.html)
  * [Contributing](https://symfony.com/doc/current/contributing/index.html)
  * [Report issues](https://github.com/symfony/symfony/issues) and
    [send Pull Requests](https://github.com/symfony/symfony/pulls)
    in the [main Symfony repository](https://github.com/symfony/symfony)

Commits
-------

898203649f Added symfony/contracts: a set of abstractions extracted out of the components
2018-07-13 13:25:15 +02:00
Fabien Potencier f80376217d bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] reset callback on StreamedResponse when setNotModified() is called

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

Commits
-------

51a49c7f78 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called
2018-07-13 13:22:37 +02:00
Fabien Potencier e2c0239414 bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr)
This PR was submitted for the 3.4 branch but it was merged into the 2.8 branch instead (closes #27927).

Discussion
----------

[HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag

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

As @Gemineye reported there was a bug in `get` and `has` methods of NamespacedAttributeBag. These methods accept composite names as an argument (like 'foo/bar' or 'foo/bar/baz') to reach the elements of stored arrays. Up to now these methods erroneously created entries (`->get('foo/bar')` created `['foo' => null]`, `->get('foo/bar/baz')` created `['foo' => ['bar' => null]]`).

Commits
-------

5f59ad4600 suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag
2018-07-13 13:19:23 +02:00
Webnet team 5f59ad4600 suppress side effects in 'get' or 'has' methods of NamespacedAttributeBag 2018-07-13 13:19:15 +02:00
Rubén Calvo 51a49c7f78 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called 2018-07-13 08:54:27 +02:00