Merge branch '5.2' into 5.x
* 5.2: Use ::class keyword when possible
This commit is contained in:
commit
665222cf4d
@ -361,7 +361,7 @@ class ChoiceType extends AbstractType
|
||||
$resolver->setAllowedTypes('choice_value', ['null', 'callable', 'string', PropertyPath::class, ChoiceValue::class]);
|
||||
$resolver->setAllowedTypes('choice_attr', ['null', 'array', 'callable', 'string', PropertyPath::class, ChoiceAttr::class]);
|
||||
$resolver->setAllowedTypes('choice_translation_parameters', ['null', 'array', 'callable', ChoiceTranslationParameters::class]);
|
||||
$resolver->setAllowedTypes('preferred_choices', ['array', '\Traversable', 'callable', 'string', PropertyPath::class, PreferredChoice::class]);
|
||||
$resolver->setAllowedTypes('preferred_choices', ['array', \Traversable::class, 'callable', 'string', PropertyPath::class, PreferredChoice::class]);
|
||||
$resolver->setAllowedTypes('group_by', ['null', 'callable', 'string', PropertyPath::class, GroupBy::class]);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ class PropertyAccessDecoratorTest extends TestCase
|
||||
|
||||
$this->decoratedFactory->expects($this->once())
|
||||
->method('createListFromChoices')
|
||||
->with($choices, $this->isInstanceOf('\Closure'), $this->isInstanceOf('\Closure'))
|
||||
->with($choices, $this->isInstanceOf(\Closure::class), $this->isInstanceOf(\Closure::class))
|
||||
->willReturnCallback(function ($choices, $value, $callback) {
|
||||
return new ArrayChoiceList(array_map($value, array_filter($choices, $callback)));
|
||||
});
|
||||
@ -97,7 +97,7 @@ class PropertyAccessDecoratorTest extends TestCase
|
||||
|
||||
$this->decoratedFactory->expects($this->once())
|
||||
->method('createListFromChoices')
|
||||
->with($choices, $this->isInstanceOf('\Closure'), $this->isInstanceOf('\Closure'))
|
||||
->with($choices, $this->isInstanceOf(\Closure::class), $this->isInstanceOf(\Closure::class))
|
||||
->willReturnCallback(function ($choices, $value, $callback) {
|
||||
return new ArrayChoiceList(array_map($value, array_filter($choices, $callback)));
|
||||
});
|
||||
@ -134,7 +134,7 @@ class PropertyAccessDecoratorTest extends TestCase
|
||||
|
||||
$this->decoratedFactory->expects($this->once())
|
||||
->method('createListFromLoader')
|
||||
->with($loader, $this->isInstanceOf('\Closure'), $this->isInstanceOf('\Closure'))
|
||||
->with($loader, $this->isInstanceOf(\Closure::class), $this->isInstanceOf(\Closure::class))
|
||||
->willReturnCallback(function ($loader, $value, $callback) use ($choices) {
|
||||
return new ArrayChoiceList(array_map($value, array_filter($choices, $callback)));
|
||||
});
|
||||
|
@ -22,6 +22,7 @@ use Symfony\Component\Form\Forms;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\SubmitButtonBuilder;
|
||||
use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer;
|
||||
use Symfony\Component\Form\Util\InheritDataAwareIterator;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
@ -513,9 +514,9 @@ class CompoundFormTest extends AbstractFormTest
|
||||
|
||||
$mapper->expects($this->once())
|
||||
->method('mapFormsToData')
|
||||
->with($this->isInstanceOf('\RecursiveIteratorIterator'), 'bar')
|
||||
->with($this->isInstanceOf(\RecursiveIteratorIterator::class), 'bar')
|
||||
->willReturnCallback(function (\RecursiveIteratorIterator $iterator) use ($child1, $child2) {
|
||||
$this->assertInstanceOf('Symfony\Component\Form\Util\InheritDataAwareIterator', $iterator->getInnerIterator());
|
||||
$this->assertInstanceOf(InheritDataAwareIterator::class, $iterator->getInnerIterator());
|
||||
$this->assertSame(['firstName' => $child1, 'lastName' => $child2], iterator_to_array($iterator));
|
||||
$this->assertEquals('Bernhard', $child1->getData());
|
||||
$this->assertEquals('Schussek', $child2->getData());
|
||||
@ -585,9 +586,9 @@ class CompoundFormTest extends AbstractFormTest
|
||||
|
||||
$mapper->expects($this->once())
|
||||
->method('mapFormsToData')
|
||||
->with($this->isInstanceOf('\RecursiveIteratorIterator'), $object)
|
||||
->with($this->isInstanceOf(\RecursiveIteratorIterator::class), $object)
|
||||
->willReturnCallback(function (\RecursiveIteratorIterator $iterator) use ($child) {
|
||||
$this->assertInstanceOf('Symfony\Component\Form\Util\InheritDataAwareIterator', $iterator->getInnerIterator());
|
||||
$this->assertInstanceOf(InheritDataAwareIterator::class, $iterator->getInnerIterator());
|
||||
$this->assertSame(['name' => $child], iterator_to_array($iterator));
|
||||
});
|
||||
|
||||
|
@ -882,7 +882,7 @@ class SimpleFormTest extends AbstractFormTest
|
||||
|
||||
public function testViewDataMayBeArrayAccessIfDataClassIsNull()
|
||||
{
|
||||
$arrayAccess = $this->getMockBuilder('\ArrayAccess')->getMock();
|
||||
$arrayAccess = $this->getMockBuilder(\ArrayAccess::class)->getMock();
|
||||
$config = new FormConfigBuilder('name', null, $this->dispatcher);
|
||||
$config->addViewTransformer(new FixedDataTransformer([
|
||||
'' => '',
|
||||
|
@ -66,7 +66,7 @@ class IntlBundleReaderTest extends TestCase
|
||||
// "mo" = "ro_MD" -> "ro"
|
||||
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'mo');
|
||||
|
||||
$this->assertInstanceOf('\ArrayAccess', $data);
|
||||
$this->assertInstanceOf(\ArrayAccess::class, $data);
|
||||
$this->assertSame('Bam', $data['Baz'], 'data from the aliased locale can be accessed');
|
||||
$this->assertArrayNotHasKey('Foo', $data);
|
||||
$this->assertNull($data['Foo']);
|
||||
|
@ -117,7 +117,7 @@ abstract class AbstractMimeTypeGuesserTest extends TestCase
|
||||
@chmod($path, 0333);
|
||||
|
||||
if ('0333' == substr(sprintf('%o', fileperms($path)), -4)) {
|
||||
$this->expectException('\InvalidArgumentException');
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->getGuesser()->guessMimeType($path);
|
||||
} else {
|
||||
$this->markTestSkipped('Can not verify chmod operations, change of file permissions failed');
|
||||
|
Reference in New Issue
Block a user