Skip to content

Commit 09f92ba

Browse files
committed
Merge branch '3.0'
* 3.0: fixed CS fixed CS fixed CS fixed test fixed CS Remove default match from AbstractConfigCommand::findExtension Remove unused imports [FrameworkBundle][Validator] Fix apc cache service deprecation
2 parents 05afbb8 + 7a90d5c commit 09f92ba

File tree

105 files changed

+126
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+126
-158
lines changed

UPGRADE-3.0.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,27 @@ UPGRADE FROM 2.x to 3.0
780780
interface.
781781
The `security.csrf.token_manager` should be used instead.
782782

783+
* The `validator.mapping.cache.apc` service has been removed in favor of the `validator.mapping.cache.doctrine.apc` one.
784+
785+
* The ability to pass `apc` as the `framework.validation.cache` configuration key value has been removed.
786+
Use `validator.mapping.cache.doctrine.apc` instead:
787+
788+
Before:
789+
790+
```yaml
791+
framework:
792+
validation:
793+
cache: apc
794+
```
795+
796+
After:
797+
798+
```yaml
799+
framework:
800+
validation:
801+
cache: validator.mapping.cache.doctrine.apc
802+
```
803+
783804
### HttpKernel
784805

785806
* The `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed in

src/Symfony/Bridge/PhpUnit/ClockMock.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,4 @@ function usleep(\$us)
109109
);
110110
}
111111
}
112-
113112
}

src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Twig\Extension;
1313

1414
use Symfony\Component\HttpFoundation\RequestStack;
15-
use Symfony\Component\HttpFoundation\Request;
1615

1716
/**
1817
* Twig extension for the Symfony HttpFoundation component.

src/Symfony/Bridge/Twig/Tests/Extension/ExpressionExtensionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

1414
use Symfony\Bridge\Twig\Extension\ExpressionExtension;
15-
use Symfony\Component\ExpressionLanguage\Expression;
1615

1716
class ExpressionExtensionTest extends \PHPUnit_Framework_TestCase
1817
{

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ public function getTransTests()
8787

8888
// transchoice
8989
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
90-
'There is no apples', array('count' => 0),),
90+
'There is no apples', array('count' => 0)),
9191
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
92-
'There is 5 apples', array('count' => 5),),
92+
'There is 5 apples', array('count' => 5)),
9393
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
94-
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'),),
94+
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
9595
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
96-
'There is 5 apples (Symfony)', array('count' => 5),),
96+
'There is 5 apples (Symfony)', array('count' => 5)),
9797
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
98-
'There is no apples', array('count' => 0),),
98+
'There is no apples', array('count' => 0)),
9999
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
100-
'There is 5 apples',),
100+
'There is 5 apples'),
101101

102102
// trans filter
103103
array('{{ "Hello"|trans }}', 'Hello'),

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,25 @@ protected function listBundles($output)
4545

4646
protected function findExtension($name)
4747
{
48-
$extension = null;
4948
$bundles = $this->initializeBundles();
5049
foreach ($bundles as $bundle) {
51-
$extension = $bundle->getContainerExtension();
50+
if ($name === $bundle->getName()) {
51+
return $bundle->getContainerExtension();
52+
}
5253

53-
if ($extension && ($name === $extension->getAlias() || $name === $bundle->getName())) {
54-
break;
54+
$extension = $bundle->getContainerExtension();
55+
if ($extension && $name === $extension->getAlias()) {
56+
return $extension;
5557
}
5658
}
5759

58-
if (!$extension) {
60+
if ('Bundle' !== substr($name, -6)) {
61+
$message = sprintf('No extensions with configuration available for "%s"', $name);
62+
} else {
5963
$message = sprintf('No extension with alias "%s" is enabled', $name);
60-
if (preg_match('/Bundle$/', $name)) {
61-
$message = sprintf('No extensions with configuration available for "%s"', $name);
62-
}
63-
64-
throw new \LogicException($message);
6564
}
6665

67-
return $extension;
66+
throw new \LogicException($message);
6867
}
6968

7069
public function validateConfiguration(ExtensionInterface $extension, $configuration)

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14-
use Symfony\Component\Console\Helper\Table;
1514
use Symfony\Component\Console\Input\InputArgument;
1615
use Symfony\Component\Console\Input\InputInterface;
1716
use Symfony\Component\Console\Input\InputOption;

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
191191
$output .= "\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no');
192192

193193
foreach ($definition->getAutowiringTypes() as $autowiringType) {
194-
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
194+
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
195195
}
196196
}
197197

src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
1515
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
16-
use Symfony\Component\HttpFoundation\Request;
1716
use Symfony\Component\HttpFoundation\Response;
1817
use Symfony\Component\HttpFoundation\RedirectResponse;
1918
use Symfony\Component\HttpFoundation\StreamedResponse;
@@ -25,7 +24,6 @@
2524
use Symfony\Component\Form\Form;
2625
use Symfony\Component\Form\FormBuilder;
2726
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
28-
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2927
use Doctrine\Bundle\DoctrineBundle\Registry;
3028

3129
/**

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,15 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
439439
->scalarNode('cache')
440440
->beforeNormalization()
441441
// Can be removed in 3.0, once ApcCache support is dropped
442-
->ifString()->then(function ($v) { return 'apc' === $v ? 'validator.mapping.cache.apc' : $v; })
442+
->ifString()->then(function ($v) {
443+
if ('apc' === $v) {
444+
@trigger_error('The ability to pass "apc" as the framework.validation.cache configuration key value is deprecated since version 2.8 and will be removed in 3.0. Use the "validator.mapping.cache.doctrine.apc" service id instead.', E_USER_DEPRECATED);
445+
446+
return 'validator.mapping.cache.apc';
447+
}
448+
449+
return $v;
450+
})
443451
->end()
444452
->end()
445453
->booleanNode('enable_annotations')->defaultFalse()->end()

0 commit comments

Comments
 (0)