Commit Graph

22725 Commits

Author SHA1 Message Date
Fabien Potencier
2455b69bf9 minor #16118 [UPGRADE-3.0] fix bullet indentation (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

[UPGRADE-3.0] fix bullet indentation

| Q             | A
| ------------- | ---
| Fixed tickets | -
| License       | MIT

Those points aren't related to the previous one.

Commits
-------

028d336 [UPGRADE-3.0] fix bullet indentation
2015-10-05 12:53:43 +02:00
Pascal Borreli
f5802c2251 Fixed typos 2015-10-05 10:36:28 +01:00
maxime.steinhausser
028d3361ed [UPGRADE-3.0] fix bullet indentation 2015-10-05 10:42:37 +02:00
Fabien Potencier
2c46204001 Merge branch '2.3' into 2.7
* 2.3:
  Fix PropertyAccessor modifying array in object when array key does not exist
2015-10-05 09:28:51 +02:00
Fabien Potencier
58bf830020 bug #16090 Fix PropertyAccessor modifying array in object when array key does no… (pierredup)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix PropertyAccessor modifying array in object when array key does no…

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

Commits
-------

f24c678 Fix PropertyAccessor modifying array in object when array key does not exist
2015-10-05 09:23:57 +02:00
Fabien Potencier
ef7aeaa47c bug #16104 Pass missing request template variables (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

Pass missing request template variables

Some render calls were missing the `request` variable, while it is used in the `layout.html.twig` template.

| Q | A
| --- | ---
| Fixed tickets | -
| License | MIT

Commits
-------

7f1b2c2 Pass missing request template variables
2015-10-05 09:20:16 +02:00
Fabien Potencier
3567548c14 feature #16102 Simplify AbstractVoter (Koc)
This PR was merged into the 2.8 branch.

Discussion
----------

Simplify AbstractVoter

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no, just simplification
| BC breaks?    | no, because 2.8 is not yet released
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

93de659 Simplify AbstractVoter
2015-10-05 09:15:26 +02:00
Fabien Potencier
9bbab98e39 minor #16109 [DomCrawler] Deprecated using /_root/ in XPath expressions (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] Deprecated using /_root/ in XPath expressions

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

Commits
-------

6042e86 [DomCrawler] Deprecated using /_root/ in XPath expressions
2015-10-05 09:11:02 +02:00
Tobias Schultze
aa494d8df3 Merge branch '2.7' into 2.8 2015-10-04 17:55:43 +02:00
Tobias Schultze
d1f50c5dee bug #16092 [Process] Throw exception if tempnam returns false (pierredup)
This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Throw exception if tempnam returns false

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

Commits
-------

cc854e6 Throw exception if tempnam returns false
2015-10-04 17:54:32 +02:00
Tobias Schultze
3e019c42ab Merge branch '2.3' into 2.7
Conflicts:
	src/Symfony/Component/Process/ProcessPipes.php
2015-10-04 17:52:32 +02:00
Tobias Schultze
af2768c2d1 bug #16111 Throw exception if tempnam returns false in ProcessPipes (pierredup)
This PR was merged into the 2.3 branch.

Discussion
----------

Throw exception if tempnam returns false in ProcessPipes

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

Related to #16092

Commits
-------

1425b8a Throw exception if tempnam returns false in ProcessPipes
2015-10-04 17:49:48 +02:00
Pierre du Plessis
1425b8adb0 Throw exception if tempnam returns false in ProcessPipes 2015-10-04 17:41:50 +02:00
Nicolas Grekas
6042e86de4 [DomCrawler] Deprecated using /_root/ in XPath expressions 2015-10-04 15:52:56 +02:00
Wouter J
7f1b2c2e59 Pass missing request template variables 2015-10-04 13:37:31 +02:00
Konstantin.Myakshin
93de659442 Simplify AbstractVoter 2015-10-04 12:08:57 +03:00
Fabien Potencier
c9e938cfea bug #16101 [Form] add missing deprecation triggers (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] add missing deprecation triggers

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

Passing implementations of the pre 2.5 validator API to the constructors
of the `ValidatorExtension` and the `ValidationListener` must trigger a
deprecation.

Commits
-------

bcd3946 [Form] add missing deprecation triggers
2015-10-04 10:49:04 +02:00
Christian Flothmann
bcd3946726 [Form] add missing deprecation triggers
Passing implementations of the pre 2.5 validator API to the constructors
of the `ValidatorExtension` and the `ValidationListener` must trigger a
deprecation.
2015-10-04 09:34:07 +02:00
Pierre du Plessis
cc854e6d23 Throw exception if tempnam returns false 2015-10-03 22:13:32 +02:00
Pierre du Plessis
f24c678027 Fix PropertyAccessor modifying array in object when array key does not exist 2015-10-03 22:00:22 +02:00
Tobias Schultze
cdbabb0baa Merge branch '2.7' into 2.8 2015-10-03 18:42:07 +02:00
Tobias Schultze
8e3a4223a2 Merge branch '2.3' into 2.7
Conflicts:
	src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php
2015-10-03 18:41:23 +02:00
Fabien Potencier
478ad543b7 feature #15613 [DependencyInjection] Add autowiring capabilities (dunglas)
This PR was squashed before being merged into the 2.8 branch (closes #15613).

Discussion
----------

[DependencyInjection] Add autowiring capabilities

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

This PR adds autowiring capabilities to the Dependency Injection component. It eases service registration by letting the component guessing dependencies to inject and even (under certain conditions) registering them using typehints of the constructor parameters.

The following usages are supported:

# Automatic dependency registration

```php
class Foo
{
}

class Bar
{
    public function __construct(Foo $f)
    {
    }
}
```

```yaml
services:
    bar:
        class: Bar
        autowire: true
```

It will register `Foo` as a private service (`autowired.foo`) and injects it as the first argument of the `bar` constructor.
This method works only for typehints corresponding to instantiable classes (interfaces and abstract classes are not supported).

# Autocompletion of definition arguments

```php
interface A
{
}

interface B extends A
{
}

class Foo implements B
{
}

class Bar
{
}

class Baz extends Bar
{
}

class LesTilleuls
{
    public function __construct(A $a, Bar $bar)
    {
    }
}
```

```yaml
services:
    foo:
        class: Foo

    baz:
        class: Baz

    les_tilleuls:
        class: LesTilleuls
        autowire: true
```

The autowiring system will find types of all services and completes constructor arguments of the `les_tilleuls` service definition using typehints.

It works only if there is one service registered for a given type (if there are several services available for the same type and no explicit type definition, a `RuntimeException` is thrown).

# Explicit type definition

```php
interface A
{
}

class A1 implements A
{
}

class A2 implements A
{
}

class B
{
     public function __construct(A $a)
     {
     }
}
```

```yaml
services:
    a1:
        class: A1
        types: [ A ]

    a2:
        class: A2

    # Will be autowired with A1
    class b:
        class: B
        autowire: true

    # Not autowired
    class another_b:
        class: B
        arguments: [ @a2 ]
        autowire: true
```

When a service is explicitly associated with a type, it is always used to fill a definition depending of this type, even if several services have this type. If several services are associated with the same type, the last definition takes the priority.

Of course explicit definitions are still supported.
YAML, XML and PHP loaders have been updated to supports the new `type` parameter.

Commits
-------

aee5731 [DependencyInjection] Add autowiring capabilities
2015-10-03 08:39:10 +02:00
Kévin Dunglas
aee57315c5 [DependencyInjection] Add autowiring capabilities 2015-10-03 08:39:08 +02:00
Fabien Potencier
ad2e85eac8 minor #16091 [Form] remove obsolete deprecation comments (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] remove obsolete deprecation comments

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

These comments are obsolete and wrong.

Commits
-------

dd50645 [Form] remove obsolete deprecation comments
2015-10-03 08:25:54 +02:00
Fabien Potencier
da92c1087d minor #16093 Add a few additional tests for the Crawler (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Add a few additional tests for the Crawler

| 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

While looking at the update of the Crawler in #16075, I spotted a few mistakes. But these were cases not covered by the testsuite. This is adding tests for these cases in the 2.8 branch (they could be added in 2.3 eventually though).

Commits
-------

528d3bd Add a few additional tests for the Crawler
2015-10-03 08:20:57 +02:00
Fabien Potencier
2e386b3ca1 bug #16087 Fixing typo in variable name (yceruto)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #16087).

Discussion
----------

Fixing typo in variable name

```php
foreach ($reflectionClass->getProperties() as $property) {
    if (!isset($attributeMetadata[$property->name])) {
        $attributesMetadata[$property->name] = new AttributeMetadata($property->name);
        $classMetadata->addAttributeMetadata($attributesMetadata[$property->name]);
    }

    if ($property->getDeclaringClass()->name === $className) {
        foreach ($this->reader->getPropertyAnnotations($property) as $groups) {
            if ($groups instanceof Groups) {
                foreach ($groups->getGroups() as $group) {
                    $attributesMetadata[$property->name]->addGroup($group);
                }
            }

            $loaded = true;
        }
    }
}
```

This `$attributeMetadata` does not exists in this `foreach` context and the goal of this condition could be unexpected.

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

Commits
-------

89499ff Fixing typo in variable name
2015-10-03 08:19:38 +02:00
Yonel Ceruto González
89499ff9e1 Fixing typo in variable name
This condition is always `true` because `$attributesMetadata` does not exists in this `foreach` context and could overwrite values in the `$attributesMetadata` variable.
2015-10-03 08:19:37 +02:00
Christophe Coevoet
528d3bd153 Add a few additional tests for the Crawler 2015-10-03 01:29:51 +02:00
Tobias Schultze
dd5064578e [Form] remove obsolete deprecation comments 2015-10-03 00:55:12 +02:00
Fabien Potencier
6acd43d45f minor #16085 [Debug] Deprecate providing $fileLinkFormat as second argument (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[Debug] Deprecate providing $fileLinkFormat as second argument

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

Commits
-------

ed3611d [Debug] Deprecate providing $fileLinkFormat as second argument
2015-10-02 19:35:32 +02:00
Fabien Potencier
98d9f26e79 minor #16082 Updated PHPDoc of the AbstractVoter class (Koc)
This PR was merged into the 2.8 branch.

Discussion
----------

Updated PHPDoc of the AbstractVoter class

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

ref https://github.com/symfony/symfony/pull/16035/files#r41016746

Commits
-------

68d010a Updated PHPDoc of the AbstractVoter class
2015-10-02 18:42:52 +02:00
Fabien Potencier
513fc315d6 minor #16084 [Form] minor CS fix (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] minor CS fix

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

Commits
-------

c92809a [Form] minor CS fix
2015-10-02 18:41:44 +02:00
Fabien Potencier
2c9153c9c9 minor #15999 Updated the style of the event commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15999).

Discussion
----------

Updated the style of the event commands

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

![event_1](https://cloud.githubusercontent.com/assets/73419/10164747/a04d2188-66bb-11e5-975f-4c3246981ed9.png)

![event_2](https://cloud.githubusercontent.com/assets/73419/10164749/a245f96a-66bb-11e5-99b0-d6f2814e1e9b.png)

![event_3](https://cloud.githubusercontent.com/assets/73419/10164752/a4a4880c-66bb-11e5-9595-4fc14f33b871.png)

Commits
-------

6633cac Updated the style of the event commands
2015-10-02 18:40:56 +02:00
Javier Eguiluz
6633cac4e7 Updated the style of the event commands 2015-10-02 18:40:54 +02:00
Nicolas Grekas
ed3611da25 [Debug] Deprecate providing $fileLinkFormat as second argument 2015-10-02 18:37:57 +02:00
Nicolas Grekas
c92809a1fd [Form] minor CS fix 2015-10-02 18:35:24 +02:00
Konstantin Myakshin
68d010aaff Updated PHPDoc of the AbstractVoter class 2015-10-02 18:38:39 +03:00
Fabien Potencier
1805649181 Merge branch '2.7' into 2.8
* 2.7:
  use PHP_OS instead of php_uname('s')
2015-10-02 16:08:20 +02:00
Fabien Potencier
fdce6ac104 Merge branch '2.3' into 2.7
* 2.3:
  use PHP_OS instead of php_uname('s')
2015-10-02 15:59:42 +02:00
Fabien Potencier
112c66c944 minor #15991 Updated the stlyes of the YAML commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15991).

Discussion
----------

Updated the stlyes of the YAML commands

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

![yaml_1](https://cloud.githubusercontent.com/assets/73419/10158656/dfedd2ec-6693-11e5-8691-304b5dd19edc.png)

![yaml_2](https://cloud.githubusercontent.com/assets/73419/10158658/e22e1bfc-6693-11e5-9626-38f21ffb5a9a.png)

Commits
-------

c3ce7ca Updated the stlyes of the YAML commands
2015-10-02 15:03:18 +02:00
Javier Eguiluz
c3ce7ca141 Updated the stlyes of the YAML commands 2015-10-02 15:03:16 +02:00
Fabien Potencier
1e0adf4c21 feature #14721 [Security] Configuring a user checker per firewall (iltar)
This PR was squashed before being merged into the 2.8 branch (closes #14721).

Discussion
----------

[Security] Configuring a user checker per firewall

_Changed my base branch to avoid issues, closed old PR_

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed ticket | #11090 and helps #14673
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/5530

This pull request adds support for a configurable user checker per firewall. An example could be:

```yml
services:
    app.user_checker:
        class: App\Security\UserChecker
        arguments:
            - "@request_stack"

security:
    firewalls:
        secured_area:
            pattern: ^/
            anonymous: ~
            basic_auth: ~
            user_checker: app.user_checker

```
The above example will use the `UserChecker` defined as `app.user_checker`. If the `user_checker` option is left empty, `security.user_checker` will  be used. If the `user_checkers` option is not defined, it will fall back to the original behavior to not break backwards compatibility and will validate using the existing `UserChecker`: `security.user_checker`.

I left the default argument in the service definitions to be `security.user_checker` to include backwards compatibility for people who for some reason don't have the extension executed. You can obtain the checker for a specific firewall by appending the firewall name to it. For the firewall `secured_area`, this would be `security.user_checker.secured_area`.

Commits
-------

76bc662 [Security] Configuring a user checker per firewall
2015-10-02 14:49:38 +02:00
Iltar van der Berg
76bc662463 [Security] Configuring a user checker per firewall 2015-10-02 14:49:36 +02:00
Fabien Potencier
8879a5fa9a bug #16053 [Console] use PHP_OS instead of php_uname('s') (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] use PHP_OS instead of php_uname('s')

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

The php_uname() function may be disabled for security reasons.

Commits
-------

40e0dc8 use PHP_OS instead of php_uname('s')
2015-10-02 14:47:06 +02:00
Fabien Potencier
cddc6b9532 minor #16068 [PropertyInfo] Test behavior when an extractor returns null (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Test behavior when an extractor returns null

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

Add a test as suggested by @stof in https://github.com/symfony/symfony/pull/16064#issuecomment-144975004

Commits
-------

73ee226 [PropertyInfo] Test behavior when an extractor return null.
2015-10-02 14:45:01 +02:00
Fabien Potencier
f4a2752f9a Merge branch '2.7' into 2.8
* 2.7:
  [Yaml] Add regression test for comments indents
  Revert "bug #15860 [Yaml] Fix improper comments removal (ogizanagi)"
2015-10-02 14:38:01 +02:00
Fabien Potencier
34c8a7c51c Merge branch '2.3' into 2.7
* 2.3:
  [Yaml] Add regression test for comments indents
  Revert "bug #15860 [Yaml] Fix improper comments removal (ogizanagi)"
2015-10-02 14:36:41 +02:00
Fabien Potencier
351bccbffb minor #16074 [Yaml] Add regression test for comments indents (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] Add regression test for comments indents

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

This is related to #16065, #15857 and #15860  (last one has been reverted due to this regression)

Commits
-------

7b9d519 [Yaml] Add regression test for comments indents
2015-10-02 14:33:33 +02:00
Fabien Potencier
a6d5c3305c minor #16073 Fix the DomCrawler tests (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix the DomCrawler tests

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

This fixes the tests by applying changes from #16057 and #16058 in the right order in ``addNode``

Commits
-------

e6feed2 Fix the DomCrawler tests
2015-10-02 14:32:10 +02:00