Merge branch '2.8' into 3.0
* 2.8: fixed CS fixed CS fixed test fixed CS Remove default match from AbstractConfigCommand::findExtension [FrameworkBundle][Validator] Fix apc cache service deprecation
This commit is contained in:
commit
dba07f35c1
@ -780,6 +780,27 @@ UPGRADE FROM 2.x to 3.0
|
|||||||
interface.
|
interface.
|
||||||
The `security.csrf.token_manager` should be used instead.
|
The `security.csrf.token_manager` should be used instead.
|
||||||
|
|
||||||
|
* The `validator.mapping.cache.apc` service has been removed in favor of the `validator.mapping.cache.doctrine.apc` one.
|
||||||
|
|
||||||
|
* The ability to pass `apc` as the `framework.validation.cache` configuration key value has been removed.
|
||||||
|
Use `validator.mapping.cache.doctrine.apc` instead:
|
||||||
|
|
||||||
|
Before:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
framework:
|
||||||
|
validation:
|
||||||
|
cache: apc
|
||||||
|
```
|
||||||
|
|
||||||
|
After:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
framework:
|
||||||
|
validation:
|
||||||
|
cache: validator.mapping.cache.doctrine.apc
|
||||||
|
```
|
||||||
|
|
||||||
### HttpKernel
|
### HttpKernel
|
||||||
|
|
||||||
* The `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed in
|
* The `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed in
|
||||||
|
@ -109,5 +109,4 @@ EOPHP
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,17 +87,17 @@ class TranslationExtensionTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
// transchoice
|
// transchoice
|
||||||
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||||
'There is no apples', array('count' => 0),),
|
'There is no apples', array('count' => 0)),
|
||||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||||
'There is 5 apples', array('count' => 5),),
|
'There is 5 apples', array('count' => 5)),
|
||||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||||
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'),),
|
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
|
||||||
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||||
'There is 5 apples (Symfony)', array('count' => 5),),
|
'There is 5 apples (Symfony)', array('count' => 5)),
|
||||||
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||||
'There is no apples', array('count' => 0),),
|
'There is no apples', array('count' => 0)),
|
||||||
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||||
'There is 5 apples',),
|
'There is 5 apples'),
|
||||||
|
|
||||||
// trans filter
|
// trans filter
|
||||||
array('{{ "Hello"|trans }}', 'Hello'),
|
array('{{ "Hello"|trans }}', 'Hello'),
|
||||||
|
@ -45,26 +45,25 @@ abstract class AbstractConfigCommand extends ContainerDebugCommand
|
|||||||
|
|
||||||
protected function findExtension($name)
|
protected function findExtension($name)
|
||||||
{
|
{
|
||||||
$extension = null;
|
|
||||||
$bundles = $this->initializeBundles();
|
$bundles = $this->initializeBundles();
|
||||||
foreach ($bundles as $bundle) {
|
foreach ($bundles as $bundle) {
|
||||||
|
if ($name === $bundle->getName()) {
|
||||||
|
return $bundle->getContainerExtension();
|
||||||
|
}
|
||||||
|
|
||||||
$extension = $bundle->getContainerExtension();
|
$extension = $bundle->getContainerExtension();
|
||||||
|
if ($extension && $name === $extension->getAlias()) {
|
||||||
if ($extension && ($name === $extension->getAlias() || $name === $bundle->getName())) {
|
return $extension;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$extension) {
|
if ('Bundle' !== substr($name, -6)) {
|
||||||
|
$message = sprintf('No extensions with configuration available for "%s"', $name);
|
||||||
|
} else {
|
||||||
$message = sprintf('No extension with alias "%s" is enabled', $name);
|
$message = sprintf('No extension with alias "%s" is enabled', $name);
|
||||||
if (preg_match('/Bundle$/', $name)) {
|
|
||||||
$message = sprintf('No extensions with configuration available for "%s"', $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \LogicException($message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $extension;
|
throw new \LogicException($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateConfiguration(ExtensionInterface $extension, $configuration)
|
public function validateConfiguration(ExtensionInterface $extension, $configuration)
|
||||||
|
@ -191,7 +191,7 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
$output .= "\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no');
|
$output .= "\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no');
|
||||||
|
|
||||||
foreach ($definition->getAutowiringTypes() as $autowiringType) {
|
foreach ($definition->getAutowiringTypes() as $autowiringType) {
|
||||||
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
|
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,7 +439,15 @@ class Configuration implements ConfigurationInterface
|
|||||||
->scalarNode('cache')
|
->scalarNode('cache')
|
||||||
->beforeNormalization()
|
->beforeNormalization()
|
||||||
// Can be removed in 3.0, once ApcCache support is dropped
|
// Can be removed in 3.0, once ApcCache support is dropped
|
||||||
->ifString()->then(function ($v) { return 'apc' === $v ? 'validator.mapping.cache.apc' : $v; })
|
->ifString()->then(function ($v) {
|
||||||
|
if ('apc' === $v) {
|
||||||
|
@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);
|
||||||
|
|
||||||
|
return 'validator.mapping.cache.apc';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $v;
|
||||||
|
})
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->booleanNode('enable_annotations')->defaultFalse()->end()
|
->booleanNode('enable_annotations')->defaultFalse()->end()
|
||||||
|
@ -28,8 +28,14 @@
|
|||||||
|
|
||||||
<service id="validator.mapping.class_metadata_factory" alias="validator" public="false" />
|
<service id="validator.mapping.class_metadata_factory" alias="validator" public="false" />
|
||||||
|
|
||||||
<service id="validator.mapping.cache.apc" class="Symfony\Component\Validator\Mapping\Cache\ApcCache" public="false">
|
<service id="validator.mapping.cache.doctrine.apc" class="Symfony\Component\Validator\Mapping\Cache\DoctrineCache" public="false">
|
||||||
<argument>%validator.mapping.cache.prefix%</argument>
|
<argument type="service">
|
||||||
|
<service class="Doctrine\Common\Cache\ApcCache">
|
||||||
|
<call method="setNamespace">
|
||||||
|
<argument>%validator.mapping.cache.prefix%</argument>
|
||||||
|
</call>
|
||||||
|
</service>
|
||||||
|
</argument>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="validator.validator_factory" class="Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory" public="false">
|
<service id="validator.validator_factory" class="Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory" public="false">
|
||||||
|
@ -53,7 +53,7 @@ class PropertyInfoPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('findTaggedServiceIds'));
|
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('findTaggedServiceIds'));
|
||||||
|
|
||||||
$container->expects($this->any())
|
$container->expects($this->any())
|
||||||
->method('findTaggedServiceIds')
|
->method('findTaggedServiceIds')
|
||||||
->will($this->returnValue(array()));
|
->will($this->returnValue(array()));
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ $container->loadFromExtension('framework', array(
|
|||||||
),
|
),
|
||||||
'validation' => array(
|
'validation' => array(
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'cache' => 'apc',
|
'cache' => 'validator.mapping.cache.doctrine.apc',
|
||||||
),
|
),
|
||||||
'annotations' => array(
|
'annotations' => array(
|
||||||
'cache' => 'file',
|
'cache' => 'file',
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<framework:translator enabled="true" fallback="fr" logging="true">
|
<framework:translator enabled="true" fallback="fr" logging="true">
|
||||||
<framework:path>%kernel.root_dir%/Fixtures/translations</framework:path>
|
<framework:path>%kernel.root_dir%/Fixtures/translations</framework:path>
|
||||||
</framework:translator>
|
</framework:translator>
|
||||||
<framework:validation enabled="true" cache="apc" />
|
<framework:validation enabled="true" cache="validator.mapping.cache.doctrine.apc" />
|
||||||
<framework:annotations cache="file" debug="true" file-cache-dir="%kernel.cache_dir%/annotations" />
|
<framework:annotations cache="file" debug="true" file-cache-dir="%kernel.cache_dir%/annotations" />
|
||||||
<framework:serializer enabled="true" enable-annotations="true" cache="serializer.mapping.cache.apc" name-converter="serializer.name_converter.camel_case_to_snake_case" />
|
<framework:serializer enabled="true" enable-annotations="true" cache="serializer.mapping.cache.apc" name-converter="serializer.name_converter.camel_case_to_snake_case" />
|
||||||
</framework:config>
|
</framework:config>
|
||||||
|
@ -44,7 +44,7 @@ framework:
|
|||||||
paths: ['%kernel.root_dir%/Fixtures/translations']
|
paths: ['%kernel.root_dir%/Fixtures/translations']
|
||||||
validation:
|
validation:
|
||||||
enabled: true
|
enabled: true
|
||||||
cache: apc
|
cache: validator.mapping.cache.doctrine.apc
|
||||||
annotations:
|
annotations:
|
||||||
cache: file
|
cache: file
|
||||||
debug: true
|
debug: true
|
||||||
|
@ -300,7 +300,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
|||||||
$this->assertSame('addMethodMapping', $calls[4][0]);
|
$this->assertSame('addMethodMapping', $calls[4][0]);
|
||||||
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
|
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
|
||||||
$this->assertSame('setMetadataCache', $calls[5][0]);
|
$this->assertSame('setMetadataCache', $calls[5][0]);
|
||||||
$this->assertEquals(array(new Reference('validator.mapping.cache.apc')), $calls[5][1]);
|
$this->assertEquals(array(new Reference('validator.mapping.cache.doctrine.apc')), $calls[5][1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testValidationService()
|
public function testValidationService()
|
||||||
|
@ -89,7 +89,7 @@ class SecurityDataCollector extends DataCollector
|
|||||||
if (null !== $this->logoutUrlGenerator) {
|
if (null !== $this->logoutUrlGenerator) {
|
||||||
$logoutUrl = $this->logoutUrlGenerator->getLogoutPath();
|
$logoutUrl = $this->logoutUrlGenerator->getLogoutPath();
|
||||||
}
|
}
|
||||||
} catch(\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// fail silently when the logout URL cannot be generated
|
// fail silently when the logout URL cannot be generated
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class LdapFactory implements UserProviderFactoryInterface
|
|||||||
->scalarNode('search_dn')->end()
|
->scalarNode('search_dn')->end()
|
||||||
->scalarNode('search_password')->end()
|
->scalarNode('search_password')->end()
|
||||||
->arrayNode('default_roles')
|
->arrayNode('default_roles')
|
||||||
->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end()
|
->beforeNormalization()->ifString()->then(function ($v) { return preg_split('/\s*,\s*/', $v); })->end()
|
||||||
->requiresAtLeastOneElement()
|
->requiresAtLeastOneElement()
|
||||||
->prototype('scalar')->end()
|
->prototype('scalar')->end()
|
||||||
->end()
|
->end()
|
||||||
|
@ -45,5 +45,4 @@ interface ResourceCheckerInterface
|
|||||||
* @return bool True if the resource has not changed since the given timestamp, false otherwise.
|
* @return bool True if the resource has not changed since the given timestamp, false otherwise.
|
||||||
*/
|
*/
|
||||||
public function isFresh(ResourceInterface $resource, $timestamp);
|
public function isFresh(ResourceInterface $resource, $timestamp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class SymfonyStyle extends OutputStyle
|
|||||||
|
|
||||||
$messages = is_array($message) ? array_values($message) : array($message);
|
$messages = is_array($message) ? array_values($message) : array($message);
|
||||||
foreach ($messages as $message) {
|
foreach ($messages as $message) {
|
||||||
$this->writeln(sprintf(' %s', $message));
|
$this->writeln(sprintf(' %s', $message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ class SymfonyStyle extends OutputStyle
|
|||||||
|
|
||||||
$messages = is_array($message) ? array_values($message) : array($message);
|
$messages = is_array($message) ? array_values($message) : array($message);
|
||||||
foreach ($messages as $message) {
|
foreach ($messages as $message) {
|
||||||
$this->writeln(sprintf(' // %s', $message));
|
$this->writeln(sprintf(' // %s', $message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ class DebugClassLoader
|
|||||||
$i = count($tail) - 1;
|
$i = count($tail) - 1;
|
||||||
$j = count($real) - 1;
|
$j = count($real) - 1;
|
||||||
|
|
||||||
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
|
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
|
||||||
--$i;
|
--$i;
|
||||||
--$j;
|
--$j;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDeprecatedSuper($class, $super, $type)
|
public function testDeprecatedSuper($class, $super, $type)
|
||||||
{
|
{
|
||||||
set_error_handler(function() { return false; });
|
set_error_handler(function () { return false; });
|
||||||
$e = error_reporting(0);
|
$e = error_reporting(0);
|
||||||
trigger_error('', E_USER_DEPRECATED);
|
trigger_error('', E_USER_DEPRECATED);
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testInterfaceExtendsDeprecatedInterface()
|
public function testInterfaceExtendsDeprecatedInterface()
|
||||||
{
|
{
|
||||||
set_error_handler(function() { return false; });
|
set_error_handler(function () { return false; });
|
||||||
$e = error_reporting(0);
|
$e = error_reporting(0);
|
||||||
trigger_error('', E_USER_NOTICE);
|
trigger_error('', E_USER_NOTICE);
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testDeprecatedSuperInSameNamespace()
|
public function testDeprecatedSuperInSameNamespace()
|
||||||
{
|
{
|
||||||
set_error_handler(function() { return false; });
|
set_error_handler(function () { return false; });
|
||||||
$e = error_reporting(0);
|
$e = error_reporting(0);
|
||||||
trigger_error('', E_USER_NOTICE);
|
trigger_error('', E_USER_NOTICE);
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->markTestSkipped('PHP7 already prevents using reserved names.');
|
$this->markTestSkipped('PHP7 already prevents using reserved names.');
|
||||||
}
|
}
|
||||||
|
|
||||||
set_error_handler(function() { return false; });
|
set_error_handler(function () { return false; });
|
||||||
$e = error_reporting(0);
|
$e = error_reporting(0);
|
||||||
trigger_error('', E_USER_NOTICE);
|
trigger_error('', E_USER_NOTICE);
|
||||||
|
|
||||||
|
@ -602,7 +602,6 @@ EOF;
|
|||||||
*
|
*
|
||||||
* This service is autowired.
|
* This service is autowired.
|
||||||
EOF;
|
EOF;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($definition->isLazy()) {
|
if ($definition->isLazy()) {
|
||||||
|
@ -69,7 +69,7 @@ class LockHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Silence error reporting
|
// Silence error reporting
|
||||||
set_error_handler(function() {});
|
set_error_handler(function () {});
|
||||||
|
|
||||||
if (!$this->handle = fopen($this->file, 'r')) {
|
if (!$this->handle = fopen($this->file, 'r')) {
|
||||||
if ($this->handle = fopen($this->file, 'x')) {
|
if ($this->handle = fopen($this->file, 'x')) {
|
||||||
|
@ -1005,7 +1005,6 @@ class FilesystemTest extends FilesystemTestCase
|
|||||||
|
|
||||||
// The compress.zlib:// stream does not support mode x: creates the file, errors "failed to open stream: operation failed" and returns false
|
// The compress.zlib:// stream does not support mode x: creates the file, errors "failed to open stream: operation failed" and returns false
|
||||||
$this->filesystem->tempnam($dirname, 'bar');
|
$this->filesystem->tempnam($dirname, 'bar');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTempnamWithPHPTempSchemeFails()
|
public function testTempnamWithPHPTempSchemeFails()
|
||||||
|
@ -521,8 +521,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
|
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
|
||||||
->path('/^dir/');
|
->path('/^dir/');
|
||||||
|
|
||||||
$expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir',
|
$expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir', 'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat');
|
||||||
'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat',);
|
|
||||||
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +43,9 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase
|
|||||||
'category' => array(
|
'category' => array(
|
||||||
'fishing' => array(
|
'fishing' => array(
|
||||||
'first' => 'cod',
|
'first' => 'cod',
|
||||||
'second' => 'sole',),
|
'second' => 'sole',
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
$this->bag = new AttributeBag('_sf2');
|
$this->bag = new AttributeBag('_sf2');
|
||||||
$this->bag->initialize($this->array);
|
$this->bag->initialize($this->array);
|
||||||
|
@ -43,8 +43,9 @@ class NamespacedAttributeBagTest extends \PHPUnit_Framework_TestCase
|
|||||||
'category' => array(
|
'category' => array(
|
||||||
'fishing' => array(
|
'fishing' => array(
|
||||||
'first' => 'cod',
|
'first' => 'cod',
|
||||||
'second' => 'sole',),
|
'second' => 'sole',
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
$this->bag = new NamespacedAttributeBag('_sf2', '/');
|
$this->bag = new NamespacedAttributeBag('_sf2', '/');
|
||||||
$this->bag->initialize($this->array);
|
$this->bag->initialize($this->array);
|
||||||
|
@ -1102,7 +1102,7 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->resolver->setNormalizer('catcher', function (Options $options) {
|
$this->resolver->setNormalizer('catcher', function (Options $options) {
|
||||||
try {
|
try {
|
||||||
return $options['thrower'];
|
return $options['thrower'];
|
||||||
} catch(\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1126,7 +1126,7 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->resolver->setDefault('catcher', function (Options $options) {
|
$this->resolver->setDefault('catcher', function (Options $options) {
|
||||||
try {
|
try {
|
||||||
return $options['thrower'];
|
return $options['thrower'];
|
||||||
} catch(\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -132,7 +132,7 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
->method('isOutputDisabled')
|
->method('isOutputDisabled')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
$process->expects($this->once())
|
$process->expects($this->once())
|
||||||
->method('getWorkingDirectory')
|
->method('getWorkingDirectory')
|
||||||
->will($this->returnValue($workingDirectory));
|
->will($this->returnValue($workingDirectory));
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('/foo'),
|
array('/foo'),
|
||||||
'/foo', '#^/foo$#s', array(), array(
|
'/foo', '#^/foo$#s', array(), array(
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a variable',
|
'Route with a variable',
|
||||||
@ -46,7 +47,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'/foo', '#^/foo/(?P<bar>[^/]++)$#s', array('bar'), array(
|
'/foo', '#^/foo/(?P<bar>[^/]++)$#s', array('bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a variable that has a default value',
|
'Route with a variable that has a default value',
|
||||||
@ -54,7 +56,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'/foo', '#^/foo(?:/(?P<bar>[^/]++))?$#s', array('bar'), array(
|
'/foo', '#^/foo(?:/(?P<bar>[^/]++))?$#s', array('bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with several variables',
|
'Route with several variables',
|
||||||
@ -63,7 +66,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '/', '[^/]++', 'foobar'),
|
array('variable', '/', '[^/]++', 'foobar'),
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with several variables that have default values',
|
'Route with several variables that have default values',
|
||||||
@ -72,7 +76,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '/', '[^/]++', 'foobar'),
|
array('variable', '/', '[^/]++', 'foobar'),
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with several variables but some of them have no default values',
|
'Route with several variables but some of them have no default values',
|
||||||
@ -81,28 +86,32 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '/', '[^/]++', 'foobar'),
|
array('variable', '/', '[^/]++', 'foobar'),
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with an optional variable as the first segment',
|
'Route with an optional variable as the first segment',
|
||||||
array('/{bar}', array('bar' => 'bar')),
|
array('/{bar}', array('bar' => 'bar')),
|
||||||
'', '#^/(?P<bar>[^/]++)?$#s', array('bar'), array(
|
'', '#^/(?P<bar>[^/]++)?$#s', array('bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a requirement of 0',
|
'Route with a requirement of 0',
|
||||||
array('/{bar}', array('bar' => null), array('bar' => '0')),
|
array('/{bar}', array('bar' => null), array('bar' => '0')),
|
||||||
'', '#^/(?P<bar>0)?$#s', array('bar'), array(
|
'', '#^/(?P<bar>0)?$#s', array('bar'), array(
|
||||||
array('variable', '/', '0', 'bar'),
|
array('variable', '/', '0', 'bar'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with an optional variable as the first segment with requirements',
|
'Route with an optional variable as the first segment with requirements',
|
||||||
array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')),
|
array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')),
|
||||||
'', '#^/(?P<bar>(foo|bar))?$#s', array('bar'), array(
|
'', '#^/(?P<bar>(foo|bar))?$#s', array('bar'), array(
|
||||||
array('variable', '/', '(foo|bar)', 'bar'),
|
array('variable', '/', '(foo|bar)', 'bar'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with only optional variables',
|
'Route with only optional variables',
|
||||||
@ -110,44 +119,49 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'', '#^/(?P<foo>[^/]++)?(?:/(?P<bar>[^/]++))?$#s', array('foo', 'bar'), array(
|
'', '#^/(?P<foo>[^/]++)?(?:/(?P<bar>[^/]++))?$#s', array('foo', 'bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('variable', '/', '[^/]++', 'foo'),
|
array('variable', '/', '[^/]++', 'foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a variable in last position',
|
'Route with a variable in last position',
|
||||||
array('/foo-{bar}'),
|
array('/foo-{bar}'),
|
||||||
'/foo', '#^/foo\-(?P<bar>[^/]++)$#s', array('bar'), array(
|
'/foo', '#^/foo\-(?P<bar>[^/]++)$#s', array('bar'), array(
|
||||||
array('variable', '-', '[^/]++', 'bar'),
|
array('variable', '-', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with nested placeholders',
|
'Route with nested placeholders',
|
||||||
array('/{static{var}static}'),
|
array('/{static{var}static}'),
|
||||||
'/{static', '#^/\{static(?P<var>[^/]+)static\}$#s', array('var'), array(
|
'/{static', '#^/\{static(?P<var>[^/]+)static\}$#s', array('var'), array(
|
||||||
array('text', 'static}'),
|
array('text', 'static}'),
|
||||||
array('variable', '', '[^/]+', 'var'),
|
array('variable', '', '[^/]+', 'var'),
|
||||||
array('text', '/{static'),
|
array('text', '/{static'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route without separator between variables',
|
'Route without separator between variables',
|
||||||
array('/{w}{x}{y}{z}.{_format}', array('z' => 'default-z', '_format' => 'html'), array('y' => '(y|Y)')),
|
array('/{w}{x}{y}{z}.{_format}', array('z' => 'default-z', '_format' => 'html'), array('y' => '(y|Y)')),
|
||||||
'', '#^/(?P<w>[^/\.]+)(?P<x>[^/\.]+)(?P<y>(y|Y))(?:(?P<z>[^/\.]++)(?:\.(?P<_format>[^/]++))?)?$#s', array('w', 'x', 'y', 'z', '_format'), array(
|
'', '#^/(?P<w>[^/\.]+)(?P<x>[^/\.]+)(?P<y>(y|Y))(?:(?P<z>[^/\.]++)(?:\.(?P<_format>[^/]++))?)?$#s', array('w', 'x', 'y', 'z', '_format'), array(
|
||||||
array('variable', '.', '[^/]++', '_format'),
|
array('variable', '.', '[^/]++', '_format'),
|
||||||
array('variable', '', '[^/\.]++', 'z'),
|
array('variable', '', '[^/\.]++', 'z'),
|
||||||
array('variable', '', '(y|Y)', 'y'),
|
array('variable', '', '(y|Y)', 'y'),
|
||||||
array('variable', '', '[^/\.]+', 'x'),
|
array('variable', '', '[^/\.]+', 'x'),
|
||||||
array('variable', '/', '[^/\.]+', 'w'),
|
array('variable', '/', '[^/\.]+', 'w'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a format',
|
'Route with a format',
|
||||||
array('/foo/{bar}.{_format}'),
|
array('/foo/{bar}.{_format}'),
|
||||||
'/foo', '#^/foo/(?P<bar>[^/\.]++)\.(?P<_format>[^/]++)$#s', array('bar', '_format'), array(
|
'/foo', '#^/foo/(?P<bar>[^/\.]++)\.(?P<_format>[^/]++)$#s', array('bar', '_format'), array(
|
||||||
array('variable', '.', '[^/]++', '_format'),
|
array('variable', '.', '[^/]++', '_format'),
|
||||||
array('variable', '/', '[^/\.]++', 'bar'),
|
array('variable', '/', '[^/\.]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,5 +105,4 @@ class LdapUserProvider implements UserProviderInterface
|
|||||||
{
|
{
|
||||||
return $class === 'Symfony\Component\Security\Core\User\User';
|
return $class === 'Symfony\Component\Security\Core\User\User';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
|
|||||||
foreach ($this->normalizers as $normalizer) {
|
foreach ($this->normalizers as $normalizer) {
|
||||||
if ($normalizer instanceof DenormalizerInterface
|
if ($normalizer instanceof DenormalizerInterface
|
||||||
&& $normalizer->supportsDenormalization($data, $class, $format)) {
|
&& $normalizer->supportsDenormalization($data, $class, $format)) {
|
||||||
|
|
||||||
return $normalizer->denormalize($data, $class, $format, $context);
|
return $normalizer->denormalize($data, $class, $format, $context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -439,4 +439,3 @@ class StaticPropertyDummy
|
|||||||
{
|
{
|
||||||
private static $property = 'value';
|
private static $property = 'value';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,5 +79,4 @@ class TargetOperationTest extends AbstractOperationTest
|
|||||||
{
|
{
|
||||||
return new TargetOperation($source, $target);
|
return new TargetOperation($source, $target);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,13 @@ class Escaper
|
|||||||
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
||||||
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
||||||
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
|
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
|
||||||
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",);
|
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9");
|
||||||
private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
|
private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
|
||||||
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
||||||
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
||||||
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
||||||
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
|
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
|
||||||
'\\N', '\\_', '\\L', '\\P',);
|
'\\N', '\\_', '\\L', '\\P');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a PHP value would require double quoting in YAML.
|
* Determines if a PHP value would require double quoting in YAML.
|
||||||
|
@ -26,7 +26,7 @@ class Unescaper
|
|||||||
/**
|
/**
|
||||||
* Regex fragment that matches an escaped character in a double quoted string.
|
* Regex fragment that matches an escaped character in a double quoted string.
|
||||||
*/
|
*/
|
||||||
const REGEX_ESCAPED_CHARACTER = "\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)";
|
const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unescapes a single quoted string.
|
* Unescapes a single quoted string.
|
||||||
|
Reference in New Issue
Block a user