feature #23569 Remove last legacy codes (nicolas-grekas)
This PR was merged into the 4.0-dev branch.
Discussion
----------
Remove last legacy codes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
86ec5e10a7
Remove last legacy codes
This commit is contained in:
commit
a19c120a79
@ -91,9 +91,9 @@ class RoutingExtension extends AbstractExtension
|
|||||||
*
|
*
|
||||||
* @return array An array with the contexts the URL is safe
|
* @return array An array with the contexts the URL is safe
|
||||||
*
|
*
|
||||||
* @final since version 3.4, type-hint to be changed to "\Twig\Node\Node" in 4.0
|
* @final since version 3.4
|
||||||
*/
|
*/
|
||||||
public function isUrlGenerationSafe(\Twig_Node $argsNode)
|
public function isUrlGenerationSafe(Node $argsNode)
|
||||||
{
|
{
|
||||||
// support named arguments
|
// support named arguments
|
||||||
$paramsNode = $argsNode->hasNode('parameters') ? $argsNode->getNode('parameters') : (
|
$paramsNode = $argsNode->hasNode('parameters') ? $argsNode->getNode('parameters') : (
|
||||||
|
@ -26,24 +26,12 @@ use Symfony\Component\Routing\RouterInterface;
|
|||||||
*/
|
*/
|
||||||
class RouterCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
|
class RouterCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
|
||||||
{
|
{
|
||||||
protected $router;
|
private $container;
|
||||||
|
|
||||||
/**
|
public function __construct(ContainerInterface $container)
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @param ContainerInterface $container
|
|
||||||
*/
|
|
||||||
public function __construct($container)
|
|
||||||
{
|
{
|
||||||
// As this cache warmer is optional, dependencies should be lazy-loaded, that's why a container should be injected.
|
// As this cache warmer is optional, dependencies should be lazy-loaded, that's why a container should be injected.
|
||||||
if ($container instanceof ContainerInterface) {
|
$this->container = $container;
|
||||||
$this->router = $container->get('router'); // For BC, the $router property must be populated in the constructor
|
|
||||||
} elseif ($container instanceof RouterInterface) {
|
|
||||||
$this->router = $container;
|
|
||||||
@trigger_error(sprintf('Using a "%s" as first argument of %s is deprecated since version 3.4 and will be unsupported in version 4.0. Use a %s instead.', RouterInterface::class, __CLASS__, ContainerInterface::class), E_USER_DEPRECATED);
|
|
||||||
} else {
|
|
||||||
throw new \InvalidArgumentException(sprintf('%s only accepts instance of Psr\Container\ContainerInterface as first argument.', __CLASS__));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,8 +41,10 @@ class RouterCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterf
|
|||||||
*/
|
*/
|
||||||
public function warmUp($cacheDir)
|
public function warmUp($cacheDir)
|
||||||
{
|
{
|
||||||
if ($this->router instanceof WarmableInterface) {
|
$router = $this->container->get('router');
|
||||||
$this->router->warmUp($cacheDir);
|
|
||||||
|
if ($router instanceof WarmableInterface) {
|
||||||
|
$router->warmUp($cacheDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,18 +629,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->info('validation configuration')
|
->info('validation configuration')
|
||||||
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
|
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('cache')
|
->scalarNode('cache')->end()
|
||||||
->beforeNormalization()
|
|
||||||
// Can be removed in 4.0, when validator.mapping.cache.doctrine.apc is removed
|
|
||||||
->ifString()->then(function ($v) {
|
|
||||||
if ('validator.mapping.cache.doctrine.apc' === $v && !class_exists('Doctrine\Common\Cache\ApcCache')) {
|
|
||||||
throw new LogicException('Doctrine APC cache for the validator cannot be enabled as the Doctrine Cache package is not installed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $v;
|
|
||||||
})
|
|
||||||
->end()
|
|
||||||
->end()
|
|
||||||
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
|
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
|
||||||
->arrayNode('static_method')
|
->arrayNode('static_method')
|
||||||
->defaultValue(array('loadValidatorMetadata'))
|
->defaultValue(array('loadValidatorMetadata'))
|
||||||
|
@ -49,17 +49,6 @@
|
|||||||
</argument>
|
</argument>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="validator.mapping.cache.doctrine.apc" class="Symfony\Component\Validator\Mapping\Cache\DoctrineCache">
|
|
||||||
<argument type="service">
|
|
||||||
<service class="Doctrine\Common\Cache\ApcCache">
|
|
||||||
<call method="setNamespace">
|
|
||||||
<argument>%validator.mapping.cache.prefix%</argument>
|
|
||||||
</call>
|
|
||||||
</service>
|
|
||||||
</argument>
|
|
||||||
<deprecated>The "%service_id%" service is deprecated since Symfony 3.4 and will be removed in 4.0. Use a Psr6 cache like "validator.mapping.cache.symfony" instead.</deprecated>
|
|
||||||
</service>
|
|
||||||
|
|
||||||
<service id="validator.validator_factory" class="Symfony\Component\Validator\ContainerConstraintValidatorFactory">
|
<service id="validator.validator_factory" class="Symfony\Component\Validator\ContainerConstraintValidatorFactory">
|
||||||
<argument /> <!-- Constraint validators locator -->
|
<argument /> <!-- Constraint validators locator -->
|
||||||
</service>
|
</service>
|
||||||
|
@ -31,7 +31,7 @@ class WebProfilerExtensionTest extends TestCase
|
|||||||
{
|
{
|
||||||
$errors = array();
|
$errors = array();
|
||||||
foreach ($container->getServiceIds() as $id) {
|
foreach ($container->getServiceIds() as $id) {
|
||||||
if (in_array($id, $knownPrivates, true)) { // to be removed in 4.0
|
if (in_array($id, $knownPrivates, true)) { // for BC with 3.4
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -189,7 +189,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
|||||||
/**
|
/**
|
||||||
* Returns whether the form and all children are valid.
|
* Returns whether the form and all children are valid.
|
||||||
*
|
*
|
||||||
* If the form is not submitted, this method always returns false (but will throw an exception in 4.0).
|
* @throws Exception\LogicException If the form is not submitted.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user