[CS] Remove unused variables passed to closures
This commit is contained in:
parent
a1312fa4b2
commit
48a70180da
@ -780,8 +780,7 @@ class ApplicationTest extends TestCase
|
|||||||
|
|
||||||
// We can assume here that some other test asserts that the event is dispatched at all
|
// We can assume here that some other test asserts that the event is dispatched at all
|
||||||
$dispatcher = new EventDispatcher();
|
$dispatcher = new EventDispatcher();
|
||||||
$self = $this;
|
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
|
||||||
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
|
|
||||||
$passedRightValue = (4 === $event->getExitCode());
|
$passedRightValue = (4 === $event->getExitCode());
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -820,8 +819,7 @@ class ApplicationTest extends TestCase
|
|||||||
|
|
||||||
// We can assume here that some other test asserts that the event is dispatched at all
|
// We can assume here that some other test asserts that the event is dispatched at all
|
||||||
$dispatcher = new EventDispatcher();
|
$dispatcher = new EventDispatcher();
|
||||||
$self = $this;
|
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
|
||||||
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
|
|
||||||
$passedRightValue = (1 === $event->getExitCode());
|
$passedRightValue = (1 === $event->getExitCode());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,9 +11,7 @@ class AlternatingRowType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$formFactory = $builder->getFormFactory();
|
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
|
||||||
|
|
||||||
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($formFactory) {
|
|
||||||
$form = $event->getForm();
|
$form = $event->getForm();
|
||||||
$type = 0 === $form->getName() % 2
|
$type = 0 === $form->getName() % 2
|
||||||
? 'Symfony\Component\Form\Extension\Core\Type\TextType'
|
? 'Symfony\Component\Form\Extension\Core\Type\TextType'
|
||||||
|
@ -964,8 +964,7 @@ class HttpCacheTest extends HttpCacheTestCase
|
|||||||
public function testSendsNoContentWhenFresh()
|
public function testSendsNoContentWhenFresh()
|
||||||
{
|
{
|
||||||
$time = \DateTime::createFromFormat('U', time());
|
$time = \DateTime::createFromFormat('U', time());
|
||||||
$that = $this;
|
$this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time) {
|
||||||
$this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that, $time) {
|
|
||||||
$response->headers->set('Cache-Control', 'public, max-age=10');
|
$response->headers->set('Cache-Control', 'public, max-age=10');
|
||||||
$response->headers->set('Last-Modified', $time->format(DATE_RFC2822));
|
$response->headers->set('Last-Modified', $time->format(DATE_RFC2822));
|
||||||
});
|
});
|
||||||
|
@ -32,9 +32,7 @@ class LegacyOptionsTest extends TestCase
|
|||||||
|
|
||||||
public function testSetLazyOption()
|
public function testSetLazyOption()
|
||||||
{
|
{
|
||||||
$test = $this;
|
$this->options->set('foo', function (Options $options) {
|
||||||
|
|
||||||
$this->options->set('foo', function (Options $options) use ($test) {
|
|
||||||
return 'dynamic';
|
return 'dynamic';
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -89,7 +87,7 @@ class LegacyOptionsTest extends TestCase
|
|||||||
});
|
});
|
||||||
|
|
||||||
// defined by subclass, no $previousValue argument defined!
|
// defined by subclass, no $previousValue argument defined!
|
||||||
$this->options->overload('foo', function (Options $options) use ($test) {
|
$this->options->overload('foo', function (Options $options) {
|
||||||
return 'dynamic';
|
return 'dynamic';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user