Skip to content

Commit

Permalink
feature #22794 [ExpressionLanguage] remove deprecated features (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.0-dev branch.

Discussion
----------

[ExpressionLanguage] remove deprecated features

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

Commits
-------

37ac945 [ExpressionLanguage] remove deprecated features
  • Loading branch information
nicolas-grekas committed May 20, 2017
2 parents 5ed9cb3 + 37ac945 commit da61abd
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 519 deletions.
5 changes: 5 additions & 0 deletions src/Symfony/Bridge/Doctrine/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.0.0
-----

* removed the `DoctrineParserCache` class

3.1.0
-----

Expand Down

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions src/Symfony/Component/ExpressionLanguage/CHANGELOG.md
@@ -1,6 +1,14 @@
CHANGELOG
=========

4.0.0
-----

* the first argument of the `ExpressionLanguage` constructor must be an instance
of `CacheItemPoolInterface`
* removed the `ArrayParserCache` and `ParserCacheAdapter` classes
* removed the `ParserCacheInterface`

2.6.0
-----

Expand Down
13 changes: 1 addition & 12 deletions src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php
Expand Up @@ -13,8 +13,6 @@

use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheAdapter;
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface;

/**
* Allows to compile and evaluate expressions written in your own DSL.
Expand All @@ -37,17 +35,8 @@ class ExpressionLanguage
* @param CacheItemPoolInterface $cache
* @param ExpressionFunctionProviderInterface[] $providers
*/
public function __construct($cache = null, array $providers = array())
public function __construct(CacheItemPoolInterface $cache = null, array $providers = array())
{
if (null !== $cache) {
if ($cache instanceof ParserCacheInterface) {
@trigger_error(sprintf('Passing an instance of %s as constructor argument for %s is deprecated as of 3.2 and will be removed in 4.0. Pass an instance of %s instead.', ParserCacheInterface::class, self::class, CacheItemPoolInterface::class), E_USER_DEPRECATED);
$cache = new ParserCacheAdapter($cache);
} elseif (!$cache instanceof CacheItemPoolInterface) {
throw new \InvalidArgumentException(sprintf('Cache argument has to implement %s.', CacheItemPoolInterface::class));
}
}

$this->cache = $cache ?: new ArrayAdapter();
$this->registerFunctions();
foreach ($providers as $provider) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit da61abd

Please sign in to comment.