Skip to content

Commit 49dee2f

Browse files
committed
minor #17480 Static code analysis (Koc)
This PR was merged into the 2.3 branch. Discussion ---------- Static code analysis | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Things that done: * fix case in method calls * removed unused imports * use shorter concat where it possible * optimize some css * removed duplicated array keys * removed redurant return statements * removed one-time variables * do not pass arguments that not used in functions Commits ------- 8db691a Static code analysis
2 parents 04e76b1 + 294f072 commit 49dee2f

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

Extension/Core/Type/ChoiceType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7171

7272
if ($options['multiple']) {
7373
$builder->addViewTransformer(new ChoicesToBooleanArrayTransformer($options['choice_list']));
74-
$builder->addEventSubscriber(new FixCheckboxInputListener($options['choice_list']), 10);
74+
$builder->addEventSubscriber(new FixCheckboxInputListener($options['choice_list']));
7575
} else {
7676
$builder->addViewTransformer(new ChoiceToBooleanArrayTransformer($options['choice_list'], $builder->has('placeholder')));
77-
$builder->addEventSubscriber(new FixRadioInputListener($options['choice_list'], $builder->has('placeholder')), 10);
77+
$builder->addEventSubscriber(new FixRadioInputListener($options['choice_list'], $builder->has('placeholder')));
7878
}
7979
} else {
8080
if ($options['multiple']) {

Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,6 @@ public function getValidationGroups(FormInterface $form)
569569
return array('group1', 'group2');
570570
}
571571

572-
private function getMockExecutionContext()
573-
{
574-
return $this->getMock('Symfony\Component\Validator\ExecutionContextInterface');
575-
}
576-
577572
/**
578573
* @param string $name
579574
* @param string $dataClass

Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testValidationGroupsCanBeSetToCallback()
6464
public function testValidationGroupsCanBeSetToClosure()
6565
{
6666
$form = $this->createForm(array(
67-
'validation_groups' => function (FormInterface $form) { return; },
67+
'validation_groups' => function (FormInterface $form) { },
6868
));
6969

7070
$this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups')));

Tests/Util/OrderedHashMapTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,6 @@ public function testCount()
482482
unset($map[0]);
483483
$map[] = 3;
484484

485-
$this->assertSame(2, count($map));
485+
$this->assertCount(2, $map);
486486
}
487487
}

0 commit comments

Comments
 (0)