Commit Graph

22690 Commits

Author SHA1 Message Date
Fabien Potencier 30fc4eea13 feature #15905 [3.0][Config] Removed isFresh() related functionality (WouterJ)
This PR was merged into the 3.0-dev branch.

Discussion
----------

[3.0][Config] Removed isFresh() related functionality

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

Commits
-------

4cdae98 Removed Resource#isFresh() related functionality
2015-09-27 11:06:17 +02:00
Fabien Potencier eb24f246b6 feature #15936 [Console] remove deprecated shell (Tobion)
This PR was merged into the 3.0-dev branch.

Discussion
----------

[Console] remove deprecated shell

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

Remove shell as deprecated in #15892

Commits
-------

c234449 [Console] remove deprecated shell
2015-09-27 10:42:45 +02:00
Tobias Schultze c23444985b [Console] remove deprecated shell 2015-09-27 02:08:47 +02:00
WouterJ 4cdae9816e Removed Resource#isFresh() related functionality 2015-09-26 17:53:58 +02:00
Tobias Schultze 3832bec814 minor #15911 Update the branch alias for new components in their 3.0 branch (stof)
This PR was merged into the 3.0-dev branch.

Discussion
----------

Update the branch alias for new components in their 3.0 branch

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

0161212 Update the branch alias for new components in their 3.0 branch
2015-09-26 15:58:18 +02:00
Christophe Coevoet 0161212c1e Update the branch alias for new components in their 3.0 branch 2015-09-26 12:58:17 +02:00
Christophe Coevoet 9058f4683e Merge branch '2.8'
* 2.8:
  [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods
  [PropertyInfo] Import the component
  deprecated the Shell Console class
  Deprecate ResourceInterface::getResource()
  Merged LegacySecurityContext tests
  [WebProfilerBundle] Added collapsed sidebar on small screens
2015-09-26 12:57:11 +02:00
Fabien Potencier 4a98f287bd feature #15697 [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods (Naktibalda)
This PR was submitted for the 2.3 branch but it was merged into the 2.8 branch instead (closes #15697).

Discussion
----------

[BrowserKit] Added isFollowingRedirects and getMaxRedirects methods

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

Commits
-------

b475607 [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods
2015-09-26 10:21:45 +02:00
Gintautas Miselis b47560773e [BrowserKit] Added isFollowingRedirects and getMaxRedirects methods 2015-09-26 10:21:42 +02:00
Fabien Potencier 4fcf136079 feature #15719 Deprecate ResourceInterface::getResource() (mpdude)
This PR was merged into the 2.8 branch.

Discussion
----------

Deprecate ResourceInterface::getResource()

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

The return value of this method does not make sense if you do not exactly know about the type of resource at hand. For example, it may be [an array](b49fa129bd/src/Symfony/Component/HttpKernel/Config/EnvParametersResource.php (L57)) or a [file path](87800ae47e/src/Symfony/Component/Config/Resource/FileResource.php (L51)).

As all usages of getResource() within Symfony are in tests of particular Resource implementations anyway, deprecating and later removing this method helps us with simplifying the ResourceInterface (https://github.com/symfony/symfony/issues/7176).

Commits
-------

87c0c7d Deprecate ResourceInterface::getResource()
2015-09-26 10:19:26 +02:00
Fabien Potencier 44091f579c feature #15818 [WebProfilerBundle] Add collapsed sidebar on small screens (hason)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Add collapsed sidebar on small screens

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

Desktop
![Desktop](https://cloud.githubusercontent.com/assets/288535/9927840/1e4eb7fc-5d22-11e5-9833-f1431ed2855d.png)

Mobile
![Mobile](https://cloud.githubusercontent.com/assets/288535/9927847/23a5c5c4-5d22-11e5-928a-87b167a079b5.png) ![Mobile touch](https://cloud.githubusercontent.com/assets/288535/9927851/2bb800e2-5d22-11e5-9566-c74a23eb9cb5.png)

Commits
-------

184d4f2 [WebProfilerBundle] Added collapsed sidebar on small screens
2015-09-26 10:11:55 +02:00
Fabien Potencier 59ee12c234 feature #15858 [PropertyInfo] Import the component (dunglas)
This PR was squashed before being merged into the 2.8 branch (closes #15858).

Discussion
----------

[PropertyInfo] Import the component

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

As discussed with @fabpot (see #14844), this PR moves [dunglas/php-property-info](https://github.com/dunglas/php-property-info) under the Symfony umbrella.

Rationale behind this new component (extracted from README.md):

PHP doesn't support explicit type definition. This is annoying, especially when doing meta programming.
Various libraries including but not limited to Doctrine ORM and the Symfony Validator provide their own type managing
system.
This library extracts various information including the type and documentation from PHP class property from metadata of popular sources:

* Setter method with type hint
* PHPDoc DocBlock
* Doctrine ORM mapping (annotation, XML, YML or custom format)
* PHP 7 scalar typehint and return type
* Serializer metadata

**Usage:**

```php
<?php

// Use Composer autoload
require 'vendor/autoload.php';

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Id;
use Symfony\Component\PropertyInfo\Extractors\DoctrineExtractor;
use Symfony\Component\PropertyInfo\Extractors\PhpDocExtractor;
use Symfony\Component\PropertyInfo\Extractors\ReflectionExtractor;
use Symfony\Component\PropertyInfo\PropertyInfo;

/**
 * @Entity
 */
class MyTestClass
{
    /**
     * @Id
     * @Column(type="integer")
     */
    public $id;
    /**
     * This is a date (short description).
     *
     * With a long description.
     *
     * @var \DateTime
     */
    public $foo;
    private $bar;

    public function setBar(\SplFileInfo $bar)
    {
        $this->bar = $bar;
    }
}

// Doctrine initialization (necessary only to use the Doctrine Extractor)
$config = Setup::createAnnotationMetadataConfiguration([__DIR__], true);
$entityManager = EntityManager::create([
    'driver' => 'pdo_sqlite',
    // ...
], $config);

$doctrineExtractor = new DoctrineExtractor($entityManager->getMetadataFactory());
$phpDocExtractor = new PhpDocExtractor();
$reflectionExtractor = new ReflectionExtractor();

$propertyInfo = new PropertyInfo(
    array($reflectionExtractor),
    array($doctrineExtractor, $phpDocExtractor, $reflectionExtractor),
    array($phpDocExtractor),
    array($reflectionExtractor)
);

var_dump($propertyInfo->getProperties('MyTestClass'));
var_dump($propertyInfo->getTypes('MyTestClass', 'foo'));
var_dump($propertyInfo->getTypes('MyTestClass', 'id'));
var_dump($propertyInfo->getTypes('MyTestClass', 'bar'));
var_dump($propertyInfo->isReadable('MyTestClass', 'id'));
var_dump($propertyInfo->isReadable('MyTestClass', 'bar'));
var_dump($propertyInfo->isWritable('MyTestClass', 'foo'));
var_dump($propertyInfo->isWritable('MyTestClass', 'bar'));
var_dump($propertyInfo->getShortDescription('MyTestClass', 'foo'));
var_dump($propertyInfo->getLongDescription('MyTestClass', 'foo'));
```

Output:

```
array(3) {
  [0] =>
  string(2) "id"
  [1] =>
  string(3) "foo"
  [2] =>
  string(3) "Bar"
}
array(1) {
  [0] =>
  class Symfony\Component\PropertyInfo\Type#36 (6) {
    private $builtinType =>
    string(6) "object"
    private $nullable =>
    bool(false)
    private $class =>
    string(8) "DateTime"
    private $collection =>
    bool(false)
    private $collectionKeyType =>
    NULL
    private $collectionValueType =>
    NULL
  }
}
array(1) {
  [0] =>
  class Symfony\Component\PropertyInfo\Type#36 (6) {
    private $builtinType =>
    string(3) "int"
    private $nullable =>
    bool(false)
    private $class =>
    NULL
    private $collection =>
    bool(false)
    private $collectionKeyType =>
    NULL
    private $collectionValueType =>
    NULL
  }
}
array(1) {
  [0] =>
  class Symfony\Component\PropertyInfo\Type#245 (6) {
    private $builtinType =>
    string(6) "object"
    private $nullable =>
    bool(false)
    private $class =>
    string(11) "SplFileInfo"
    private $collection =>
    bool(false)
    private $collectionKeyType =>
    NULL
    private $collectionValueType =>
    NULL
  }
}
bool(true)
bool(false)
bool(true)
bool(true)
string(35) "This is a date (short description)."
string(24) "With a long description."
```

Commits
-------

f1eb185 [PropertyInfo] Import the component
2015-09-26 09:46:23 +02:00
Kévin Dunglas f1eb185236 [PropertyInfo] Import the component 2015-09-26 09:46:20 +02:00
Fabien Potencier 8209754e4e minor #15893 Merged LegacySecurityContext tests (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

Merged LegacySecurityContext tests

I've no idea why this test was introduced in the wrong namespace in 2.8, but I merged it in the correct test case now.

Commits
-------

2c4da3c Merged LegacySecurityContext tests
2015-09-26 09:34:51 +02:00
Fabien Potencier 7079aa9e96 feature #15892 deprecated the Shell Console class (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

deprecated the Shell Console class

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

Commits
-------

1c17928 deprecated the Shell Console class
2015-09-26 09:27:31 +02:00
Fabien Potencier 1c17928e58 deprecated the Shell Console class 2015-09-26 09:26:13 +02:00
Fabien Potencier 967c0e439a Merge branch '2.8'
* 2.8: (23 commits)
  [Validator] added BIC (SWIFT-BIC) validation constraint
  [TwigBridge] Foundation form layout integration
  [Security] Deprecated supportsAttribute and supportsClass methods
  bumped Symfony version to 2.7.6
  updated VERSION for 2.7.5
  updated CHANGELOG for 2.7.5
  bumped Symfony version to 2.3.34
  updated VERSION for 2.3.33
  update CONTRIBUTORS for 2.3.33
  updated CHANGELOG for 2.3.33
  [Console] Fix transient HHVM test
  [OptionsResolver] Fix catched exception along the dependency tree mistakenly detects cyclic dependencies
  fixed tests
  [DI] Support deprecated definitions in decorators
  [DI] Allow to change the deprecation message in Definition
  [DI] Trigger a deprecated error on the container builder
  [DI] Dump the deprecated status
  [DI] Supports the deprecated tag in loaders
  [DI] Add a deprecated status to definitions
  Fixing test locations
  ...
2015-09-26 09:20:46 +02:00
Fabien Potencier 825490a8c8 Merge branch '2.7' into 2.8
* 2.7:
  bumped Symfony version to 2.7.6
  updated VERSION for 2.7.5
  updated CHANGELOG for 2.7.5
  bumped Symfony version to 2.3.34
  updated VERSION for 2.3.33
  update CONTRIBUTORS for 2.3.33
  updated CHANGELOG for 2.3.33
2015-09-26 09:14:46 +02:00
Fabien Potencier 06b4938046 feature #15519 [Validator] added BIC (SWIFT-BIC) validation constraint (mvhirsch)
This PR was squashed before being merged into the 2.8 branch (closes #15519).

Discussion
----------

[Validator] added BIC (SWIFT-BIC) validation constraint

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

I've added the BIC validator, because we do often need validation for IBAN and BIC values. Since the IBAN validation was already included into Symfony, I was asking myself: why not contribute my  BIC validator to the community? So here we go ...

It depends on ISO 9362 as described on [Wikipedia](https://en.wikipedia.org/wiki/ISO_9362#Structure). It validates the structure based on alphabetic/alphanumeric values and the value's length.

Todo-list:
- [x] submit changes to the documentation

Commits
-------

d6471b3 [Validator] added BIC (SWIFT-BIC) validation constraint
2015-09-25 14:16:01 +02:00
Michael Hirschler d6471b3338 [Validator] added BIC (SWIFT-BIC) validation constraint 2015-09-25 14:15:58 +02:00
Fabien Potencier 564f06b665 feature #12587 [TwigBridge] Foundation form layout integration (totophe)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #12587).

Discussion
----------

[TwigBridge] Foundation form layout integration

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| License       | MIT

As symfony integrate in its roots Bootstrap layout, why not also include Foundation layout? I think it's not a matters of including all the css frameworks in symfony but at least having two instead of one would be interesting to have a basic choice.

@hhamon told me I should create this PR :-D :-p ;-)

Commits
-------

7653d95 [TwigBridge] Foundation form layout integration
2015-09-25 14:01:54 +02:00
Jean-Christophe Cuvelier [Artack] 7653d95450 [TwigBridge] Foundation form layout integration 2015-09-25 14:01:53 +02:00
Fabien Potencier 693af63d65 bug #15721 [FrameworkBundle] compatibility with older Form component versions (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle] compatibility with older Form component versions

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

Commits
-------

01ad767 compatibility with older Form component versions
2015-09-25 13:59:08 +02:00
Fabien Potencier 6f7aae991c feature #15151 [Security] Deprecated supportsAttribute and supportsClass methods (WouterJ)
This PR was squashed before being merged into the 2.8 branch (closes #15151).

Discussion
----------

[Security] Deprecated supportsAttribute and supportsClass methods

These methods aren't used at all in a Symfony application and don't make sense to use in the application. They are only used internally in the voters. This means the voter interface can be made much easier.

I'm not sure how we do these deprecations, should we remove the methods from the interface now already? Also, I don't think it's possible to trigger deprecation notices for the voter methods?

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

Abstract Voter
---

There is one remaining question about the abstract voter. This currently has abstract `getSupportedAttributes()` and `getSupportedClass()` methods. One of the reasons to remove the methods for the interface was that these methods are not flexible. Does it make sense to deprecate these methods as well and replace them by an abstract `protected vote(array $attributes, $class)` method in the `AbstractVoter` (which is called from `AbstractVoter#vote()`) ?

Commits
-------

6588708 [Security] Deprecated supportsAttribute and supportsClass methods
2015-09-25 13:44:05 +02:00
WouterJ 6588708144 [Security] Deprecated supportsAttribute and supportsClass methods 2015-09-25 13:42:48 +02:00
Fabien Potencier 22100a2ca6 bumped Symfony version to 2.7.6 2015-09-25 13:39:10 +02:00
Fabien Potencier 619528a274 updated VERSION for 2.7.5 2015-09-25 13:16:52 +02:00
Fabien Potencier 8d894a4bcc updated CHANGELOG for 2.7.5 2015-09-25 13:14:54 +02:00
Fabien Potencier 6200eb5053 feature #15491 Add support for deprecated definitions (Taluu)
This PR was merged into the 2.8 branch.

Discussion
----------

Add support for deprecated definitions

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

This add a sort of marker in the Definition of a service that marks it as "deprecated". This is useful when we have a bunch of service and a bunch of where it is used, and we need to track if there are any uses before removing it (in a later version or right now). I was not sure if the `trigger_error` would be enough, or if I should log them instead.

I'm first gathering some feedback, and then I'll try to update the doc.

I was not sure if it should target 2.8 or master (3.0) though.

What's left ?
==========
- [x] Make a POC
- [x] Gather some feedbacks
- [x] Dump the tag in XML, YAML and PHP
- [x] Load the definition from XML, YAML and PHP
- [x] Fix some forgotten things such as the key existence check
- [x] Work on inline services in the php dumper
- [x] Handle deprecations for decorators
- ~~Possibility to overwrite the deprecated flag in the decorators in `XmlFileLoader` ?~~ Nope, and this behavior is also ported to the `YamlFileLoader`.

Commits
-------

83f4e9c [DI] Support deprecated definitions in decorators
0b3d0a0 [DI] Allow to change the deprecation message in Definition
954247d [DI] Trigger a deprecated error on the container builder
2f37cb1 [DI] Dump the deprecated status
8f6c21c [DI] Supports the deprecated tag in loaders
4b6fab0 [DI] Add a deprecated status to definitions
2015-09-25 13:07:29 +02:00
Fabien Potencier 264f694011 Merge branch '2.3' into 2.7
* 2.3:
  bumped Symfony version to 2.3.34
  updated VERSION for 2.3.33
  update CONTRIBUTORS for 2.3.33
  updated CHANGELOG for 2.3.33
2015-09-25 13:01:10 +02:00
Fabien Potencier a5c65c1786 Merge branch '2.8'
* 2.8:
  [Console] Add domain exceptions to replace generic exceptions
  Implement service-based Resource (cache) validation
2015-09-25 12:59:21 +02:00
Fabien Potencier 87b66a1d00 bumped Symfony version to 2.3.34 2015-09-25 12:48:04 +02:00
Nicolas Grekas 2377994b66 Merge branch '2.7' into 2.8
* 2.7:
  [Console] Fix transient HHVM test
  [OptionsResolver] Fix catched exception along the dependency tree mistakenly detects cyclic dependencies
  fixed tests
  Fixing test locations
  [VarDumper] Fix dump comparison on large arrays
  [expression-language] Code Cleanup for GetAttrNode
2015-09-25 11:20:50 +02:00
Nicolas Grekas 4d7f95cdbc minor #15888 [Console] Fix transient HHVM test (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix transient HHVM test

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

Follow up of #15848

Commits
-------

945ec0e [Console] Fix transient HHVM test
2015-09-25 11:19:55 +02:00
Fabien Potencier 3b8a8ee48e updated VERSION for 2.3.33 2015-09-25 11:08:49 +02:00
Fabien Potencier f75b643035 update CONTRIBUTORS for 2.3.33 2015-09-25 11:08:23 +02:00
Fabien Potencier 3f2ad986b3 updated CHANGELOG for 2.3.33 2015-09-25 11:07:38 +02:00
Nicolas Grekas 945ec0e40c [Console] Fix transient HHVM test 2015-09-25 10:32:23 +02:00
Matthias Pigulla 87c0c7d400 Deprecate ResourceInterface::getResource()
The return value of this method does not make sense if you do not exactly know
about the type of resource at hand. For example, it may be [an array](b49fa129bd/src/Symfony/Component/HttpKernel/Config/EnvParametersResource.php (L57))
or a [file path](87800ae47e/src/Symfony/Component/Config/Resource/FileResource.php (L51)).

As all usages of getResource() within Symfony are in tests of particular Resource implementations anyway, deprecating and later removing this interface
helps us with simplifying the ResourceInterface (https://github.com/symfony/symfony/issues/7176).
2015-09-25 10:18:07 +02:00
WouterJ 2c4da3ceff Merged LegacySecurityContext tests 2015-09-25 09:39:51 +02:00
Fabien Potencier 507e959e37 bug #15866 [VarDumper] Fix dump comparison on large arrays (romainneutron)
This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix dump comparison on large arrays

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

Commits
-------

6a6e7f3 [VarDumper] Fix dump comparison on large arrays
2015-09-25 09:04:33 +02:00
Fabien Potencier 8eda312fc4 bug #15878 [OptionsResolver] Fix catched exception along the dependency tree mistakenly detects cyclic dependencies (lemoinem)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #15878).

Discussion
----------

[OptionsResolver] Fix catched exception along the dependency tree mistakenly detects cyclic dependencies

| 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

If an Option's normalizer (or lazy default) catches an exception thrown from one of its dependencies, the OptionResolver was left in an inconsistent state which would trigger a false positive cyclic dependency if the throwing option or any of its parent dependencies between it and the catching one are ever called again.

Commits
-------

9a188c5 [OptionsResolver] Fix catched exception along the dependency tree mistakenly detects cyclic dependencies
2015-09-25 08:59:17 +02:00
Mathieu Lemoine 9a188c5215 [OptionsResolver] Fix catched exception along the dependency tree mistakenly detects cyclic dependencies 2015-09-25 08:59:16 +02:00
Fabien Potencier 7d674c2135 fixed tests 2015-09-25 08:52:54 +02:00
Fabien Potencier 21e2218e14 minor #15881 Fixing security test locations (weaverryan)
This PR was merged into the 2.7 branch.

Discussion
----------

Fixing security test locations

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

There were just missed on sha: 0601ed33c4 probably because there were on a different branch.

Cheers!

Commits
-------

16e09d3 Fixing test locations
2015-09-25 08:48:53 +02:00
Fabien Potencier dacbfe9699 feature #14894 [Console] Add domain exceptions to replace generic exceptions (GromNaN)
This PR was squashed before being merged into the 2.8 branch (closes #14894).

Discussion
----------

[Console] Add domain exceptions to replace generic exceptions

Creates domain specific exception classes for the case where a user type an invalid command name or option name.

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

TODO:
* [x] Replace `\InvalidArgumentException` by `Symfony\Component\Console\Exception\InvalidArgumentException`
* [x] Add `Symfony\Component\Console\Exception\ExceptionInterface`

Commits
-------

dd17dc0 [Console] Add domain exceptions to replace generic exceptions
2015-09-25 08:44:47 +02:00
Jérôme Tamarelle dd17dc00ee [Console] Add domain exceptions to replace generic exceptions 2015-09-25 08:44:39 +02:00
Fabien Potencier d60428c9ca feature #15738 Implement service-based Resource (cache) validation (mpdude)
This PR was squashed before being merged into the 2.8 branch (closes #15738).

Discussion
----------

Implement service-based Resource (cache) validation

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #7230, #15692, #7782
| License       | MIT
| Doc PR        | symfony/symfony-docs#5136

### Overview

Currently, any metadata passed to `ConfigCache` (namely implementations of `ResourceInterface`) is serialized to disk. When the `ConfigCache` is validated, the metadata is unserialized and queried through `ResourceInterface::isFresh()` to determine whether the cache is fresh. That way, `ResourceInterface` implementations cannot interact with services, for example a database connection.

This PR introduces the new concept of `ResourceCheckers`. Services implementing `ResourceCheckerInterface` can be tagged as `config_cache.resource_checker` with an optional priority.

Clients that wish to use `ConfigCache` can then obtain an instance from the `config_cache_factory` service (which implements `ConfigCacheFactoryInterface`). The factory will take care of injecting resource checkers into the `ConfigCache` instance so that they can be used for cache validation.

Checking cache metadata is easy for `ResourceCheckers`:
* First, the `ResourceCheckerInterface::supports()` implementation is passed the metadata object in question. If the checker cannot handle the type of resource passed, `supports()` should return `false`.
* Otherwise, the `ResourceCheckerInterface::isFresh()` method will be called and given the resource as well as the timestamp at which the cache was initialized. If that method returns `false`, the cache is considered stale. If it returns `true`, the resource is considered unchanged and will *not* be passed to any additional checkers.

### BC and migration path

This PR does not (intend to) break BC but it comes with deprecations. The main reason is that `ResourceInterface` contains an `isFresh()` method that does not make sense in the general case of resources.

Thus, `ResourceInterface::isFresh()` is marked as deprecated and should be removed in Symfony 3.0. Resource implementations that can (or wish to) be validated in that simple manner can implement the `SelfCheckingResourceInterface` sub-interface that still contains (and will keep) the `isFresh()` method. The change should be as simple as changing the `extends` list.

Apart from that, `ResourceInterface` will be kept as the base interface for resource implementations. It is used in several `@api` interfaces and thus cannot easily be substituted.

For the Symfony 2.x series, a `BCResourceInterfaceChecker` will be kept that performs validation through `ResourceInterface::isFresh()` but will trigger a deprecation warning. The remedy is to either implement a custom ResourceChecker with a priority higher than -1000; or to switch to the aforementioned `SelfCheckingResourceInterface` which is used at a priority of -990 (without deprecation warning).

The `ConfigCache` and `ConfigCacheFactory` classes can be used as previously but do not feature checker-based cache validation.

### Outlook and closing remarks:

This PR supersedes #7230, #15692 and works at least in parts towards the goal of #7176.

The `ResourceCheckerInterface`, `...ConfigCache` and `...ConfigCacheFactory` no longer need to be aware of the `debug` flag. The different validation rules applied previously are now just a matter of `ResourceChecker` configuration (i. e. "no checkers" in `prod`).

It might be possible to remove the `debug` flag from Symfony's `Router` and/or `Translator` classes in the future as well because it was only passed on to the `ConfigCache` there.

Commits
-------

20d3722 Implement service-based Resource (cache) validation
2015-09-25 08:33:07 +02:00
Matthias Pigulla 20d3722120 Implement service-based Resource (cache) validation 2015-09-25 08:31:17 +02:00
Fabien Potencier 31d76ec0f7 minor #15538 [expression-language] Code Cleanup for GetAttrNode (zerustech)
This PR was merged into the 2.7 branch.

Discussion
----------

[expression-language] Code Cleanup for GetAttrNode

Use ``$this->nodes['attribute']->attributes['value']`` to
replace ``$this->nodes['attribute']->evaluate($functions, $values)``
for method call and property call.

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

166e175 [expression-language] Code Cleanup for GetAttrNode
2015-09-24 13:58:55 +02:00