Commit Graph

24875 Commits

Author SHA1 Message Date
Fabien Potencier
72fa3bdda9 minor #17552 Remove invalid CSS white-space value (Triiistan)
This PR was merged into the 2.3 branch.

Discussion
----------

Remove invalid CSS white-space value

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

Commits
-------

03d3182 Remove invalid CSS white-space value
2016-01-27 11:20:13 +01:00
Fabien Potencier
da16d15f13 bug #17554 [DependencyInjection] resolve aliases in factories (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] resolve aliases in factories

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

Commits
-------

fde10e7 resolve aliases in factories
2016-01-27 11:13:36 +01:00
Fabien Potencier
7743eefe18 bug #17555 [DependencyInjection] resolve aliases in factory services (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] resolve aliases in factory services

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

Commits
-------

7702189 resolve aliases in factory services
2016-01-27 11:10:53 +01:00
Sam Fleming
517a9a2aa5 Fixed HTTP Digest auth not being passed user checker
Commit 05be5da1710ab681a04334d58126f8c3d431e3cb added the ability to
configure a user checker on a per firewall basis. However, that commit seems to
have missed updating the HttpDigestFactory.
2016-01-27 10:06:30 +00:00
Christian Flothmann
fde10e799a resolve aliases in factories 2016-01-27 10:00:40 +01:00
Fabien Potencier
8967076e50 bug #17511 [Form] ArrayChoiceList can now deal with a null in choices (issei-m)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] ArrayChoiceList can now deal with a null in choices

re-create for mistaken #17502

---

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

Documentation says, since 2.7, choice value is treated as corresponding item value (if `choices_as_values` option is true). Null as well.

```php
$builder->add('attending', 'choice', array(
    'choices' => array(
        'yes' => true,
        'no' => false,
        'maybe' => null,
    ),
    'choices_as_values' => true,
));
```

But actually null doesn't work as expected since `ArrayChoiceList::getChoicesForValues()` uses `isset` to check whether given value exists in its choices.

It should use `array_key_exists` instead to do so here.

Commits
-------

68292bb [Form] ArrayChoiceList can now deal with a null in choices
2016-01-27 08:59:57 +01:00
Christian Flothmann
7702189cb4 resolve aliases in factory services 2016-01-27 08:57:17 +01:00
Fabien Potencier
025f761798 minor #16986 Fix Filesystem tests on Windows (WouterJ)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix Filesystem tests on Windows

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

PHP's symlink function doesn't support relative symlinks on Windows. Running the filesystem tests in Windows resulted in 2 erroring tests because of this. After this PR, these tests are skipped on Windows.

The error wasn't catched by appveyor, as appveyor doesn't support symlinks at all.

Commits
-------

c376cf3 Fix FileSystem tests on Windows
2016-01-27 08:39:45 +01:00
Fabien Potencier
893fecbe69 Merge branch '2.8' into 3.0
* 2.8:
  [WebProfilerBundle] Don't inherit CSS text-transform property for the toolbar.
  Remove duplicate cursor property
  Increase the inlining YAML level for config:debug
  [Serializer] Minor: fix CS and PHPDoc
  [Form] fix tests
  [Serializer] Ensure that groups are strings
  [Debug] Tell that the extension is for PHP 5 only
  Static code analysis
  Update AnnotationDirectoryLoader.php
  added a test
  Escape the delimiter in Glob::toRegex
  [FrameworkBundle] Fix template location for PHP templates
  [FrameworkBundle] Add path verification to the template parsing test cases
2016-01-27 06:14:46 +01:00
Fabien Potencier
6704f62b4d Merge branch '2.7' into 2.8
* 2.7:
  Increase the inlining YAML level for config:debug
  [Serializer] Minor: fix CS and PHPDoc
  [Form] fix tests
  [Serializer] Ensure that groups are strings
  [Debug] Tell that the extension is for PHP 5 only
  Static code analysis
  Update AnnotationDirectoryLoader.php
  added a test
  Escape the delimiter in Glob::toRegex
  [FrameworkBundle] Fix template location for PHP templates
  [FrameworkBundle] Add path verification to the template parsing test cases
2016-01-27 06:14:19 +01:00
Fabien Potencier
1876b4f1c8 Merge branch '2.3' into 2.7
* 2.3:
  Static code analysis
  Update AnnotationDirectoryLoader.php
  [FrameworkBundle] Fix template location for PHP templates
  [FrameworkBundle] Add path verification to the template parsing test cases
2016-01-27 06:09:39 +01:00
Fabien Potencier
89e86197c1 minor #17480 Static code analysis (Koc)
This PR was merged into the 2.3 branch.

Discussion
----------

Static code analysis

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

Things that done:
* fix case in method calls
* removed unused imports
* use shorter concat where it possible
* optimize some css
* removed duplicated array keys
* removed redurant return statements
* removed one-time variables
* do not pass arguments that not used in functions

Commits
-------

8db691a Static code analysis
2016-01-27 05:57:57 +01:00
Fabien Potencier
26ad4ff93a feature #17504 [Console] Show code when an exception is thrown (maidmaid)
This PR was squashed before being merged into the 3.1-dev branch (closes #17504).

Discussion
----------

[Console] Show code when an exception is thrown

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

Hi !

When an exception is thrown, sf console doesn't show the code exception, while this code is very useful during developpement (for example, [guzzle put http status code in his code exception](https://github.com/guzzle/guzzle/blob/6.1.1/src/Exception/RequestException.php#L30-L33)).

I propose you that we show the code exception only when the code exception > 0 and with ``-v`` verbosity. It means :

- ``throw new Exception('Not found', 0)`` with normal verbosity --> no change
- ``throw new Exception('Not found', 0)`` with ``-v`` verbosity --> no change
- ``throw new Exception('Not found', 404)`` with normal verbosity --> no change
- **but** ``throw new Exception('Not found', 404)`` with ``-v`` verbosity --> showing :

![image](https://cloud.githubusercontent.com/assets/4578773/12530638/052991f2-c1e5-11e5-92f1-b7b3f60cc4ba.png)

Commits
-------

f8cd9e8 [Console] Show code when an exception is thrown
2016-01-27 05:55:20 +01:00
Dany Maillard
f8cd9e8263 [Console] Show code when an exception is thrown 2016-01-27 05:55:18 +01:00
Fabien Potencier
1525cce831 feature #17540 [WebProfilerBundle] Add HTTP return code in the Ajax request list table (kucharovic)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #17540).

Discussion
----------

[WebProfilerBundle] Add HTTP return code in the Ajax request list table

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

Commits
-------

9192e1b [WebProfilerBundle] Add HTTP return code in the Ajax request list table
2016-01-27 05:51:46 +01:00
Jakub Kucharovic
9192e1b34f [WebProfilerBundle] Add HTTP return code in the Ajax request list table 2016-01-27 05:51:46 +01:00
Fabien Potencier
0e7af5f2be minor #17544 [WebProfilerBundle] Don't inherit CSS text-transform property for the toolbar. (adamelso)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #17544).

Discussion
----------

[WebProfilerBundle] Don't inherit CSS text-transform property for the toolbar.

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

When the `body` element has the CSS rule `text-transform: uppercase`, this is also applied to the toolbar.
We could add a style to prevent that from happening but would mean the CSS is now writing rules for a framework's dev tools.

Given the information in the toolbar may be case-sensitive, best thing to prevent text transformations by explicitly declaring `text-transform: none`.

![symfony-toolbar-very-shouty](https://cloud.githubusercontent.com/assets/5972864/12579702/cdaebcf4-c421-11e5-8300-e858f85beb26.png)

Commits
-------

fce0af0 [WebProfilerBundle] Don't inherit CSS text-transform property for the toolbar.
2016-01-27 05:49:47 +01:00
Adam Elsodaney
fce0af0604 [WebProfilerBundle] Don't inherit CSS text-transform property for the toolbar. 2016-01-27 05:49:47 +01:00
Fabien Potencier
cb16bffb28 feature #17446 [Serializer] Add PSR-6 adapter (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17446).

Discussion
----------

[Serializer] Add PSR-6 adapter

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

- [x] Add tests

Commits
-------

4bf9d05 [Serializer] Add PSR-6 adapter
2016-01-27 05:42:02 +01:00
Kévin Dunglas
4bf9d05237 [Serializer] Add PSR-6 adapter 2016-01-27 05:42:01 +01:00
Fabien Potencier
127538ef26 feature #16917 [PropertyInfo] Cache support (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #16917).

Discussion
----------

[PropertyInfo] Cache support

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

Replace #16893 with several advantages:

- Less complex patch
- Work for all usages of PropertyInfo (even outside of the Serializer)
- Avoid a circular reference between Serializer's CallMetadataFactory and PropertyInfo's SerializerExtractor
- Allow @mihai-stancu's #16143 to work as-is

Commits
-------

86c20df [PropertyInfo] Cache support
2016-01-27 05:40:32 +01:00
Kévin Dunglas
86c20df53c [PropertyInfo] Cache support 2016-01-27 05:40:30 +01:00
Fabien Potencier
712eeed5bb minor #17549 [Validator] Minor fixes for the PSR-6 adapter (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Validator] Minor fixes for the PSR-6 adapter

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

Follows #17440. Take into account comments of @Tobion.

Commits
-------

aa60d5b [Validator] Minor fixes for the PSR-6 adapter
2016-01-27 05:36:25 +01:00
Fabien Potencier
52384fb85e minor #17550 [Validator] PSR-6 cache: Avoid name collision (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Validator] PSR-6 cache: Avoid name collision

| 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

See tests.

Commits
-------

12852c2 [Validator] PSR-6 cache: Avoid name collision
2016-01-27 05:34:32 +01:00
Fabien Potencier
60f60bb325 minor #17551 [CSS] Remove duplicate cursor property (Sevrahk)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #17551).

Discussion
----------

[CSS] Remove duplicate cursor property

The "cursor: pointer;" property was present 2 times in the css class.

Commits
-------

4e97bb8 Remove duplicate cursor property
2016-01-27 05:30:53 +01:00
Thomas
4e97bb89c7 Remove duplicate cursor property 2016-01-27 05:30:53 +01:00
Tristan Roussel
03d3182129 Remove invalid CSS white-space value 2016-01-27 01:14:25 +01:00
Kévin Dunglas
12852c2aea [Validator] PSR-6 cache: Avoid name collision 2016-01-26 20:26:38 +01:00
Kévin Dunglas
aa60d5be20 [Validator] Minor fixes for the PSR-6 adapter 2016-01-26 19:13:14 +01:00
Fabien Potencier
96eb903c14 minor #17538 Increase the inlining YAML level for config:debug (javiereguiluz)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #17538).

Discussion
----------

Increase the inlining YAML level for config:debug

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

### Before

![debug_before](https://cloud.githubusercontent.com/assets/73419/12575512/52862d3c-c40d-11e5-9bc9-45e24c14b6e2.png)

### After

![debug_after](https://cloud.githubusercontent.com/assets/73419/12575515/5607b868-c40d-11e5-9578-5f004e4ad8df.png)

The new `6` number is completely arbitrary. I chose it because it's the minimum level that makes all the default Symfony services look right. I'm open to better recommendations.

Commits
-------

37655be Increase the inlining YAML level for config:debug
2016-01-26 16:21:42 +01:00
Javier Eguiluz
37655be008 Increase the inlining YAML level for config:debug 2016-01-26 16:21:36 +01:00
Fabien Potencier
f1cdc6fd26 feature #17532 [Asset] Version as service (ewgRa)
This PR was squashed before being merged into the 3.1-dev branch (closes #17532).

Discussion
----------

[Asset] Version as service

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

While I working on #14832 I realize that all this problems and hidden magic can be avoided, if we will have ability to set asset version strategy as service.

This PR implementation of this idea.

Now it is possible to do something like this:

```yaml
framework:
    assets:
        version_strategy: assets.custom_version_strategy
        base_urls: http://cdn.example.com
        packages:
            foo:
                base_urls: ["https://example.com"]
                version_strategy: assets.custom_version_strategy
```

There is can be some conflicts with #16511 when it will be in master

Commits
-------

52d116b [Asset] Version as service
2016-01-26 13:34:43 +01:00
Evgeniy Sokolov
52d116bee5 [Asset] Version as service 2016-01-26 13:34:42 +01:00
Fabien Potencier
37f526467e feature #17440 [Validator] Add a PSR-6 adapter (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17440).

Discussion
----------

[Validator] Add a PSR-6 adapter

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

Commits
-------

1f0ba00 [Validator] Add a PSR-6 adapter
2016-01-26 13:31:07 +01:00
Kévin Dunglas
1f0ba00109 [Validator] Add a PSR-6 adapter 2016-01-26 13:31:05 +01:00
Fabien Potencier
420989f5a9 feature #17113 [Serializer] Add a MaxDepth option (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17113).

Discussion
----------

[Serializer] Add a MaxDepth option

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/14924#issuecomment-111977173, https://github.com/dunglas/DunglasApiBundle/issues/104#issuecomment-110644569
| License       | MIT
| Doc PR        | todo

Add a max depth option during the normalization process. Especially useful when normalizing trees.

Usage:

```php
use Symfony\Component\Serializer\Annotation\MaxDepth;

class MyObj
{
    /**
     * @MaxDepth(2)
     */
    public $foo;

    /**
     * @var self
     */
    public $child;
}

use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;

$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
$normalizer = new ObjectNormalizer($classMetadataFactory);
$serializer = new Serializer(array($this->normalizer));

$level1 = new MyObj();
$level1->foo = 'level1';

$level2 = new MyObj();
$level2->foo = 'level2';
$level1->child = $level2;

$level3 = new MyObj();
$level3->foo = 'level3';
$level2->child = $level3;
$result = $serializer->normalize($level1, null, array(ObjectNormalizer::ENABLE_MAX_DEPTH => true));
/*      $result = array(
            'foo' => 'level1',
            'child' => array(
                    'foo' => 'level2',
                    'child' => array(
                            'child' => null,
                        ),
                ),
        );
*/
```

* [x] Metadata support
* [x] `@MaxDepth(2)` annotation and loader
* [x] XML loader
* [x] YAML loader
* [x] Delegate recursive normalization at the end of the process
* [x] Use constants with Late Static Binding in the abstract class instead of raw strings
* [x] Move common logic to the abstract class

/cc @mRoca @csarrazi

Commits
-------

a44bead [Serializer] Add a MaxDepth option
2016-01-26 13:18:18 +01:00
Kévin Dunglas
a44beade1e [Serializer] Add a MaxDepth option 2016-01-26 13:18:08 +01:00
Fabien Potencier
55a79cb0fe minor #17429 [Serializer] Minor: fix CS and PHPDoc (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #17429).

Discussion
----------

[Serializer] Minor: fix CS and PHPDoc

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

ff568dc [Serializer] Minor: fix CS and PHPDoc
2016-01-26 13:15:52 +01:00
Kévin Dunglas
ff568dc518 [Serializer] Minor: fix CS and PHPDoc 2016-01-26 13:15:44 +01:00
WouterJ
c376cf3e06 Fix FileSystem tests on Windows 2016-01-26 10:09:52 +01:00
Fabien Potencier
234011d776 minor #17536 [Form] fix tests (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] fix tests

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

Commits
-------

e791fa0 [Form] fix tests
2016-01-26 08:31:01 +01:00
Christian Flothmann
e791fa0405 [Form] fix tests 2016-01-26 08:10:13 +01:00
Fabien Potencier
c5a78860f5 feature #17530 [Cache] Handle and log errors properly (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Handle and log errors properly

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

Best viewed ignoring white-spaces:
https://github.com/symfony/symfony/pull/17530/files?w=1

Commits
-------

d21fab0 [Cache] Handle and log errors properly
2016-01-26 08:03:55 +01:00
Fabien Potencier
47677ae929 minor #17534 [ClassLoader] suggest apcu polyfill for hhvm (Tobion)
This PR was merged into the 3.0 branch.

Discussion
----------

[ClassLoader] suggest apcu polyfill for hhvm

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/17524#issuecomment-174533680
| License       | MIT
| Doc PR        | -

Same approach as in https://github.com/symfony/symfony/pull/17530/files#diff-877e1eb36c14b7b8dc89a910744ebfcdR31

Commits
-------

714fcc6 suggest apcu polyfill as apcu_* function are not yet available on hhvm
2016-01-26 07:59:53 +01:00
Fabien Potencier
7e000a0351 minor #17533 [Debug] Tell that the extension is for PHP 5 only (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] Tell that the extension is for PHP 5 only

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

Commits
-------

1285a0d [Debug] Tell that the extension is for PHP 5 only
2016-01-26 07:58:29 +01:00
Fabien Potencier
c435c2f6c6 bug #17430 [Serializer] Ensure that groups are strings (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #17430).

Discussion
----------

[Serializer] Ensure that groups are strings

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

Commits
-------

0a3b877 [Serializer] Ensure that groups are strings
2016-01-26 07:57:14 +01:00
Kévin Dunglas
0a3b87701c [Serializer] Ensure that groups are strings 2016-01-26 07:57:11 +01:00
Nicolas Grekas
1285a0d637 [Debug] Tell that the extension is for PHP 5 only 2016-01-26 00:34:19 +01:00
Tobias Schultze
714fcc60ec suggest apcu polyfill as apcu_* function are not yet available on hhvm 2016-01-25 23:42:51 +01:00
Nicolas Grekas
d21fab0d0b [Cache] Handle and log errors properly 2016-01-25 20:18:55 +01:00