Skip to content

Remove last legacy codes #23569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Twig/Extension/RoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public function getUrl($name, $parameters = array(), $schemeRelative = false)
*
* @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
$paramsNode = $argsNode->hasNode('parameters') ? $argsNode->getNode('parameters') : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,12 @@
*/
class RouterCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
{
protected $router;
private $container;

/**
* Constructor.
*
* @param ContainerInterface $container
*/
public function __construct($container)
public function __construct(ContainerInterface $container)
{
// As this cache warmer is optional, dependencies should be lazy-loaded, that's why a container should be injected.
if ($container instanceof ContainerInterface) {
$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__));
}
$this->container = $container;
}

/**
Expand All @@ -53,8 +41,10 @@ public function __construct($container)
*/
public function warmUp($cacheDir)
{
if ($this->router instanceof WarmableInterface) {
$this->router->warmUp($cacheDir);
$router = $this->container->get('router');

if ($router instanceof WarmableInterface) {
$router->warmUp($cacheDir);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,18 +629,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
->info('validation configuration')
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->children()
->scalarNode('cache')
->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()
->scalarNode('cache')->end()
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
->arrayNode('static_method')
->defaultValue(array('loadValidatorMetadata'))
Expand Down
11 changes: 0 additions & 11 deletions src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@
</argument>
</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">
<argument /> <!-- Constraint validators locator -->
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function assertSaneContainer(Container $container, $message = '',
{
$errors = array();
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;
}
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function addError(FormError $error);
/**
* 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
*/
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy