Permalink
Browse files

minor #28674 [CS] Remove unused variables passed to closures (carusog…

…abriel)

This PR was merged into the 2.8 branch.

Discussion
----------

[CS] Remove unused variables passed to closures

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

Commits
-------

48a7018 [CS] Remove unused variables passed to closures
  • Loading branch information...
nicolas-grekas committed Oct 2, 2018
2 parents a1312fa + 48a7018 commit 8932f5c68877b459d057537c4aca49700d68f68d
@@ -780,8 +780,7 @@ public function testRunDispatchesIntegerExitCode()
// We can assume here that some other test asserts that the event is dispatched at all
$dispatcher = new EventDispatcher();
$self = $this;
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
$passedRightValue = (4 === $event->getExitCode());
});
@@ -820,8 +819,7 @@ public function testRunDispatchesExitCodeOneForExceptionCodeZero()
// We can assume here that some other test asserts that the event is dispatched at all
$dispatcher = new EventDispatcher();
$self = $this;
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
$passedRightValue = (1 === $event->getExitCode());
});
@@ -11,9 +11,7 @@ class AlternatingRowType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$formFactory = $builder->getFormFactory();
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($formFactory) {
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
$form = $event->getForm();
$type = 0 === $form->getName() % 2
? 'Symfony\Component\Form\Extension\Core\Type\TextType'
@@ -964,8 +964,7 @@ public function testUsesCacheToRespondToHeadRequestsWhenFresh()
public function testSendsNoContentWhenFresh()
{
$time = \DateTime::createFromFormat('U', time());
$that = $this;
$this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that, $time) {
$this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time) {
$response->headers->set('Cache-Control', 'public, max-age=10');
$response->headers->set('Last-Modified', $time->format(DATE_RFC2822));
});
@@ -32,9 +32,7 @@ protected function setUp()
public function testSetLazyOption()
{
$test = $this;
$this->options->set('foo', function (Options $options) use ($test) {
$this->options->set('foo', function (Options $options) {
return 'dynamic';
});
@@ -89,7 +87,7 @@ public function testPreviousValueIsNotEvaluatedIfNoSecondArgument()
});
// 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';
});

0 comments on commit 8932f5c

Please sign in to comment.