Commit Graph

32587 Commits

Author SHA1 Message Date
Alex Bowers
261eae970f Added deprecation to cwd not existing Fixes #18249 2017-10-05 15:24:30 -07:00
Fabien Potencier
30e3b6d27e feature #23625 Feature #23583 Add current and fallback locales in WDT / Profiler (nemoneph)
This PR was merged into the 3.4 branch.

Discussion
----------

Feature #23583  Add current and fallback locales in WDT / Profiler

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

The goal of this PR is to add informations about the locale and the fallback locales in the translation WDT panel / and profiler

Commits
-------

98a8a6c735 Feature #23583  Add current and fallback locales in WDT / Profiler
2017-09-13 09:05:29 -07:00
Fabien Potencier
76ccce7464 feature #24179 [TwigBundle] Add default templates directory and option to configure it (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] Add default templates directory and option to configure it

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

Feature freeze is coming so this one should be important for the new structure. Moving forward and alternative of https://github.com/symfony/symfony/pull/23339 but I'm proposing `templates/bundles/<BundleName>` instead of `templates/bundles/<BundleTwigNamespace>` to override bundles templates and easy migration from current `app/Resources/<BundleName>/views` convention. Also this fix the pending comments.

Summary:
 * Added new option to configure default path for templates directory:
```yaml
twig:
    default_path: '%kernel.project_dir%/templates' # default
```
 * Added new path convention to override bundle templates  `<default_path>/bundles/<BundleName>`:
```
# Examples:
templates/bundles/TwigBundle/Exception/error.html.twig - @Twig/Exception/error.html.twig
templates/bundles/FOSUserBundle/layout.html.twig - @FOSUser/layout.html.twig
```

Current templates in `<kernel.root_dir>/Resources/<BundleName>/views` have priority over the new one, and both have priority over the bundle `views` path.

Commits
-------

a1b391fb00 Add default templates directory and option to configure it
2017-09-13 07:15:26 -07:00
Yonel Ceruto
a1b391fb00 Add default templates directory and option to configure it 2017-09-13 09:15:32 -04:00
Nicolas Grekas
005cf6b463 Merge branch '3.3' into 3.4
* 3.3:
  Fix travis php7.0
  Add support to environment variables APP_ENV/DEBUG in KernelTestCase
  [Routing] Cleanup apache fixtures
2017-09-13 13:45:41 +02:00
Nicolas Grekas
19e5ed1bcf Merge branch '2.8' into 3.3
* 2.8:
  Fix travis php7.0
2017-09-13 13:42:46 +02:00
Nicolas Grekas
86eb10c413 Fix travis php7.0 2017-09-13 13:41:56 +02:00
Nicolas Grekas
30a13baef3 fix oups 2017-09-13 13:33:28 +02:00
Nicolas Grekas
2df1cbc675 bug #24184 [DI] Resolve nested refs to aliases (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Resolve nested refs to aliases

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

Required now that we have most services private. Should make tests green again.

Commits
-------

8729f9f [DI] Resolve nested refs to aliases
2017-09-13 13:28:54 +02:00
Nicolas Grekas
8729f9fd6a [DI] Resolve nested refs to aliases 2017-09-13 13:21:02 +02:00
Nicolas Grekas
306bd48ac1 feature #24104 Make as many services private as possible (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Make as many services private as possible

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

- [x] review the list of currently public services and validate which one should be turned private (noted as such with the `container.private` tag in this PR)
- [x] rebase on top of #24103
- [x] implement the behavior described in https://github.com/symfony/symfony/issues/23822#issuecomment-327208485
- [x] add tests

List of services that will be kept public:

### Remaining public aliases

cache.app_clearer <- for the cache:pool:clear command to clear app pools
$commandId <- for non-lazy commands which are get() at runtime
router <- for the base controller
templating <- for the base controller

### Remaining public services

test.client <- for WebTestCase
security.password_encoder <- for use in ContainerAware classes
security.authentication_utils <- for use in ContainerAware classes
filesystem <- for use in ContainerAware classes
kernel <- for use in ContainerAware classes
translator <- for use in ContainerAware classes
validator <- for use in ContainerAware classes
cache_clearer <- for the cache:clear command
cache_warmer <- required to bootstrap the kernel
cache.app <- for userland only
cache.global_clearer <- for the cache:pool:clear command to clear all pools
cache.system <- for userland only
data_collector.dump <- required to have dump() work very early when booting the kernel
event_dispatcher <- required to wire console apps
form.factory <- for the base controller
http_kernel <- required to bootstrap the kernel
profiler <- used in tests
request_stack <- for the base controller
routing.loader <- used by routing
security.authorization_checker <- for the base controller
security.csrf.token_manager <- for the base controller
security.token_storage <- for the base controller
serializer <- for the base controller
session <- for the base controller
state_machine.abstract <- userland state machines
workflow.abstract <- userland workflows
twig <- for the base controller
twig.controller.exception <- controllers referenced by routing
twig.controller.preview_error <- controllers referenced by routing
var_dumper.cloner <- required to have dump() work very early when booting the kernel
web_profiler.controller.exception <- controllers referenced by routing
web_profiler.controller.profiler <- controllers referenced by routing
web_profiler.controller.router <- controllers referenced by routing

Commits
-------

1936491 Make as many services private as possible
2017-09-13 10:34:42 +02:00
Nicolas Grekas
1936491f9b Make as many services private as possible 2017-09-13 09:59:43 +02:00
Nicolas Grekas
3f4c47c23c bug #24177 [FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase (yceruto)
This PR was merged into the 3.3 branch.

Discussion
----------

[FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/recipes/pull/170#discussion_r138425265
| License       | MIT
| Doc PR        | -

/cc @fabpot

Commits
-------

8d56744 Add support to environment variables APP_ENV/DEBUG in KernelTestCase
2017-09-13 09:26:10 +02:00
Yonel Ceruto
8d5674480f Add support to environment variables APP_ENV/DEBUG in KernelTestCase 2017-09-12 18:52:39 -04:00
Fabien Potencier
56bf80760a minor #24174 [Routing] Cleanup apache fixtures (nicolas-grekas)
This PR was merged into the 3.3 branch.

Discussion
----------

[Routing] Cleanup apache fixtures

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

The apache dumper has been removed already.

Commits
-------

f1ab3b28ac [Routing] Cleanup apache fixtures
2017-09-12 10:58:27 -07:00
Nicolas Grekas
f1ab3b28ac [Routing] Cleanup apache fixtures 2017-09-12 18:00:24 +02:00
Christian Flothmann
ade060e80e feature #18314 [Translation] added support for adding custom message formatter (aitboudad)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] added support for adding custom message formatter

| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | yes |
| Tests pass? | yes |
| Fixed tickets | #6009, #10152, one item in #11742, #11948 |
| License | MIT |
| Doc PR | ~ |

Commits
-------

42183b0 [Translation] Support adding custom message formatter
2017-09-12 14:37:35 +02:00
Abdellatif Ait boudad
42183b0213 [Translation] Support adding custom message formatter 2017-09-12 13:17:01 +01:00
Christian Flothmann
eefded7357 minor #24167 [Debug] fix test assertion (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] fix test assertion

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

Fixes tests for #23816 after the changes made in #24149.

Commits
-------

75a26bb [Debug] fix test assertion
2017-09-12 12:11:27 +02:00
Christian Flothmann
75a26bb801 [Debug] fix test assertion 2017-09-12 10:02:51 +02:00
Fabien Potencier
7ab8efb74e fixed CS 2017-09-11 14:34:45 -07:00
Fabien Potencier
f46d324d63 Merge branch '3.3' into 3.4
* 3.3:
  fixed CS
  fixed CS
2017-09-11 14:23:16 -07:00
Fabien Potencier
ceae3bf16c fixed CS 2017-09-11 14:23:01 -07:00
Fabien Potencier
ebfb24070c Merge branch '2.8' into 3.3
* 2.8:
  fixed CS
2017-09-11 14:11:44 -07:00
Fabien Potencier
df07e73363 fixed CS 2017-09-11 14:10:59 -07:00
Fabien Potencier
8cb614df9f Merge branch '3.3' into 3.4
* 3.3:
  [CS] Apply phpdoc_annotation_without_dot
  bumped Symfony version to 3.3.10
  updated VERSION for 3.3.9
  updated CHANGELOG for 3.3.9
  [DomCrawler] Fix conversion to int on GetPhpFiles
  Remove `protected_to_private` rule.
  Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 13:45:17 -07:00
Fabien Potencier
e844b640de Merge branch '2.8' into 3.3
* 2.8:
  [CS] Apply phpdoc_annotation_without_dot
2017-09-11 13:43:11 -07:00
Fabien Potencier
4e1c65c6f9 Merge branch '2.7' into 2.8
* 2.7:
  [CS] Apply phpdoc_annotation_without_dot
2017-09-11 13:39:16 -07:00
Fabien Potencier
687ad65d82 minor #24149 [CS] Apply phpdoc_annotation_without_dot (keradus)
This PR was squashed before being merged into the 2.7 branch (closes #24149).

Discussion
----------

[CS] Apply phpdoc_annotation_without_dot

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

Rule was manually applied here : https://github.com/symfony/symfony/pull/19198
In same PR, fixer for this rule was requested, later implementation was approved by Symfony in https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/2020 .

Rule is converting single sentence to not a sentence, dropping final dot and lowercasing first word.
If there are multiple sentences, it doesn't make any changes.

Status quo is that some annotation are in the middle - having first word uppercased, but no final stop.
Let us fix grammar by finishing applying the rule.

If, for some reason, you don't want to follow that rule that was requested by Symfony, please provide reasoning. If it's to some edge-case bug, simply raise that bug issue. If due to some other reasons, please send a PR to drop it from `@Symfony` ruleset.

Info: I did manually reviewed every single change of this PR.

Commits
-------

7a97b49436 [CS] Apply phpdoc_annotation_without_dot
2017-09-11 13:37:54 -07:00
Dariusz
7a97b49436 [CS] Apply phpdoc_annotation_without_dot 2017-09-11 13:37:52 -07:00
Fabien Potencier
8c303ded27 feature #24158 deprecated profiler.matcher configuration (fabpot)
This PR was squashed before being merged into the 3.4 branch (closes #24158).

Discussion
----------

deprecated profiler.matcher configuration

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | closes #24077, would also close #21944, #22484
| License       | MIT
| Doc PR        | not yet

The profiler matcher configuration was added at a time where we thought that having the profiler in production could make sense (and so being able to enable it conditionally made sense). That's not the case anymore. Nobody should ever enable it in production.

With that in mind, I propose to deprecate this setting in 3.4 and remove it in 4.0.

Commits
-------

6eff3e5b55 deprecated profiler.matcher configuration
2c62ba8150 fixed CS
2017-09-11 11:09:57 -07:00
Fabien Potencier
6eff3e5b55 deprecated profiler.matcher configuration 2017-09-11 10:58:18 -07:00
Fabien Potencier
2c62ba8150 fixed CS 2017-09-11 10:58:18 -07:00
Clément LEFEBVRE
98a8a6c735 Feature #23583 Add current and fallback locales in WDT / Profiler 2017-09-11 19:07:47 +02:00
Fabien Potencier
9570a454ef bumped Symfony version to 3.3.10 2017-09-11 09:45:56 -07:00
Fabien Potencier
a9d2f68ae9 Merge pull request #24156 from fabpot/release-3.3.9
released v3.3.9
2017-09-11 09:13:42 -07:00
Fabien Potencier
b9c93f1faa updated VERSION for 3.3.9 2017-09-11 09:13:23 -07:00
Fabien Potencier
4fa6fcfb93 updated CHANGELOG for 3.3.9 2017-09-11 09:13:13 -07:00
Fabien Potencier
51af90e042 Merge branch '2.8' into 3.3
* 2.8:
  [DomCrawler] Fix conversion to int on GetPhpFiles
  Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 08:55:22 -07:00
Fabien Potencier
400263a39d Merge branch '2.7' into 2.8
* 2.7:
  [DomCrawler] Fix conversion to int on GetPhpFiles
  Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 08:55:02 -07:00
Fabien Potencier
bcfe152113 bug #24141 [DomCrawler] Fix conversion to int on GetPhpFiles (MaraBlaga)
This PR was merged into the 2.7 branch.

Discussion
----------

[DomCrawler] Fix conversion to int on GetPhpFiles

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

We've encountered that when using the DomCrawler with the UploadedFile, everything gets converted into strings. We've addressed the issue, and made sure that the attributes in the UploadedFile respects their type.

The code below demonstrates the problem.

```<?php
require 'vendor/autoload.php';
require 'app/AppKernel.php';
$crawler = new \Symfony\Component\DomCrawler\Crawler(
    '<form method="post"><input type="file" name="image"/></form>',
    'http://www.example.com'
);
$form = $crawler->filter('form')->form();
$form['image'] = new \Symfony\Component\HttpFoundation\File\UploadedFile(
    'path/to/file',
    'foo',
    'text/plain',
    100
);

$client = new \Symfony\Bundle\FrameworkBundle\Client(new AppKernel('test', true));
$crawler = $client->submit($form);

var_dump($client->getRequest()->files->get('image')->getClientSize());  //returns string, not int
echo 'Done.' . PHP_EOL;

Commits
-------

122da5add5 [DomCrawler] Fix conversion to int on GetPhpFiles
2017-09-11 08:48:47 -07:00
Mara Blaga
122da5add5 [DomCrawler] Fix conversion to int on GetPhpFiles 2017-09-11 15:10:51 +01:00
Fabien Potencier
47871c995f bug #23853 Filtering empty uuids in ORMQueryBuilderLoader. (mlazovla)
This PR was merged into the 2.7 branch.

Discussion
----------

Filtering empty uuids in ORMQueryBuilderLoader.

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

Commits
-------

27e8cd289c Filtering empty uuids in ORMQueryBuilderLoader.
2017-09-11 05:33:33 -07:00
Nicolas Grekas
7b7a69f6ff minor #24136 [CS] Remove protected_to_private rule (SpacePossum)
This PR was merged into the 3.3 branch.

Discussion
----------

[CS] Remove `protected_to_private` rule

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

Following:
https://github.com/symfony/symfony/pull/24123#issuecomment-328031180

I picked 3.1 as target as the rule discussed;

| branch | hits
| --------- | ---
| 2.7 | 0
| 2.8 | 0
| 3.0 | 0
| 3.1 | 1
| master |  1 hit (same file as on 3.1)

Commits
-------

bfae454 Remove `protected_to_private` rule.
2017-09-11 08:35:02 +02:00
Nicolas Grekas
b1b686081b Merge branch '3.3' into 3.4
* 3.3:
  Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)"
  [Filesystem] skip tests if not applicable
  [Fabbot] Do not run php-cs-fixer if there are no change in src/
  [Security] Fix exception when use_referer option is true and referer is not set or empty
  [HttpKernel] "controller.service_arguments" services should be public
  Get KERNEL_DIR through $_ENV too for KernelTestCase
  Get KERNEL_CLASS through $_ENV too
  check permissions if dump target dir is missing
2017-09-11 08:29:22 +02:00
SpacePossum
bfae454968 Remove protected_to_private rule. 2017-09-11 08:26:46 +02:00
Nicolas Grekas
483a274994 Merge branch '2.8' into 3.3
* 2.8:
  Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)"
  [Filesystem] skip tests if not applicable
  [Fabbot] Do not run php-cs-fixer if there are no change in src/
  [Security] Fix exception when use_referer option is true and referer is not set or empty
  Get KERNEL_DIR through $_ENV too for KernelTestCase
  check permissions if dump target dir is missing
2017-09-11 07:57:23 +02:00
Fabien Potencier
565a1c4b48 minor #24007 [ExpressionLanguage] SyntaxError : make a proposal when no function or variable found (fmata)
This PR was merged into the 3.4 branch.

Discussion
----------

[ExpressionLanguage] SyntaxError : make a proposal when no function or variable found

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

Now when an Expression fails to be parsed, a SyntaxError is raised with an explicit message but it's impossible to extract the function, variable or the pair token  type/token value to parse.
When a functional user encounters a SyntaxError, by default there is no mechanism to understand why what he typed is incorrect.

This PR exposes when it's possible the subject of the violation and in case of function or variable undefined in the Expression, a proposal is made.

```php
<?php

require 'vendor/autoload.php';

use Symfony\Component\ExpressionLanguage\Lexer;
use Symfony\Component\ExpressionLanguage\Parser;
use Symfony\Component\ExpressionLanguage\SyntaxError;

$lexer = new Lexer();
$parser = new Parser(array());

try {
    $parser->parse($lexer->tokenize('user.city.departement in [departement, departement2]'), array('user', 'departement1', 'departement2'));
} catch (SyntaxError $e) {
    echo $e->getMessage();
}
```
Outputs :

> Variable "departement" is not valid around position 27 for expression `user.city.departement in [departement, departement2]`.
>
> Did you mean "departement1"?

Commits
-------

f19cf8a916 [ExpressionLanguage] make a proposal in SyntaxError message
2017-09-10 16:46:16 -07:00
Fabien Potencier
a0bdd5a2cb bug #24132 [SecurityBundle] Fix valid provider considered undefined (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Fix valid provider considered undefined

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

Silly mistake.

Commits
-------

efa4cb9a66 [SecurityBundle] Fix valid provider considered undefined
2017-09-09 12:41:02 -07:00
Robin Chalas
efa4cb9a66 [SecurityBundle] Fix valid provider considered undefined 2017-09-09 12:20:30 +02:00