Merge branch '5.2' into 5.x
* 5.2: Remove "requires PHP 7.2" annotations quote all dumped unicode spaces Switched from parent type hard-coded FQCN to `::class` keyword.
This commit is contained in:
commit
3c738b3e2c
@ -23,6 +23,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\ChoiceList\ChoiceList;
|
||||
use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator;
|
||||
use Symfony\Component\Form\Exception\RuntimeException;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\Options;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
@ -239,7 +240,7 @@ abstract class DoctrineType extends AbstractType implements ResetInterface
|
||||
|
||||
public function getParent()
|
||||
{
|
||||
return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
|
||||
return ChoiceType::class;
|
||||
}
|
||||
|
||||
public function reset()
|
||||
|
@ -399,9 +399,6 @@ class CheckTypeDeclarationsPassTest extends TestCase
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.2
|
||||
*/
|
||||
public function testProcessSuccessWhenPassingDefinitionForObjectType()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
@ -331,9 +331,6 @@ class RegisterListenersPassTest extends TestCase
|
||||
$registerListenersPass->process($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.2
|
||||
*/
|
||||
public function testOmitEventNameAndMethodOnGenericListener()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\Form;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
use Symfony\Component\Form\Util\StringUtil;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@ -60,6 +61,6 @@ abstract class AbstractType implements FormTypeInterface
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return 'Symfony\Component\Form\Extension\Core\Type\FormType';
|
||||
return FormType::class;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\Form\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
@ -38,6 +39,6 @@ class ChoiceSubType extends AbstractType
|
||||
*/
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
|
||||
return ChoiceType::class;
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class Escaper
|
||||
|
||||
// Determines if the PHP value contains any single characters that would
|
||||
// cause it to require single quoting in YAML.
|
||||
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
|
||||
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -635,6 +635,21 @@ YAML;
|
||||
{
|
||||
$this->assertSame('{ foo: ~ }', $this->dumper->dump(['foo' => null], 0, 0, Yaml::DUMP_NULL_AS_TILDE));
|
||||
}
|
||||
|
||||
public function testDumpIdeographicSpaces()
|
||||
{
|
||||
$expected = <<<YAML
|
||||
alone: ' '
|
||||
within_string: 'a b'
|
||||
regular_space: 'a b'
|
||||
|
||||
YAML;
|
||||
$this->assertSame($expected, $this->dumper->dump([
|
||||
'alone' => ' ',
|
||||
'within_string' => 'a b',
|
||||
'regular_space' => 'a b',
|
||||
], 2));
|
||||
}
|
||||
}
|
||||
|
||||
class A
|
||||
|
@ -514,6 +514,10 @@ class InlineTest extends TestCase
|
||||
['"0123\r"', "0123\r"],
|
||||
['"0123\t"', "0123\t"],
|
||||
['"0123\v"', "0123\v"],
|
||||
|
||||
// whitespaces
|
||||
'ideographic space' => ["' '", ' '],
|
||||
'ideographic space surrounded by characters' => ["'a b'", 'a b'],
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user