Skip to content

Commit 9d4abf8

Browse files
Merge branch '3.4' into 4.0
* 3.4: [Form] fix truncating form views in data collector [TwigBridge][Form] fix tests by moving AbstractBootstrap* cases to the bridge
2 parents dcf55f4 + 707e52a commit 9d4abf8

10 files changed

+7
-13
lines changed

src/Symfony/Component/Form/Tests/AbstractBootstrap3HorizontalLayoutTest.php renamed to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3HorizontalLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Tests;
12+
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

1414
abstract class AbstractBootstrap3HorizontalLayoutTest extends AbstractBootstrap3LayoutTest
1515
{

src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php renamed to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Tests;
12+
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

1414
use Symfony\Component\Form\FormError;
15+
use Symfony\Component\Form\Tests\AbstractLayoutTest;
1516

1617
abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
1718
{

src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php renamed to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4HorizontalLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Tests;
12+
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

1414
use Symfony\Component\Form\FormError;
1515

src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php renamed to src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Tests;
12+
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

1414
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
1515
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
1919
use Symfony\Component\Form\FormRenderer;
2020
use Symfony\Component\Form\FormView;
21-
use Symfony\Component\Form\Tests\AbstractBootstrap3HorizontalLayoutTest;
2221
use Twig\Environment;
2322

2423
class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3HorizontalLayoutTest

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
1919
use Symfony\Component\Form\FormRenderer;
2020
use Symfony\Component\Form\FormView;
21-
use Symfony\Component\Form\Tests\AbstractBootstrap3LayoutTest;
2221
use Twig\Environment;
2322

2423
class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
1919
use Symfony\Component\Form\FormRenderer;
2020
use Symfony\Component\Form\FormView;
21-
use Symfony\Component\Form\Tests\AbstractBootstrap4HorizontalLayoutTest;
2221
use Twig\Environment;
2322

2423
/**

src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
1919
use Symfony\Component\Form\FormRenderer;
2020
use Symfony\Component\Form\FormView;
21-
use Symfony\Component\Form\Tests\AbstractBootstrap4LayoutTest;
2221
use Twig\Environment;
2322

2423
/**

src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\Validator\ConstraintViolationInterface;
2020
use Symfony\Component\VarDumper\Caster\Caster;
2121
use Symfony\Component\VarDumper\Caster\ClassStub;
22+
use Symfony\Component\VarDumper\Caster\StubCaster;
2223
use Symfony\Component\VarDumper\Cloner\Stub;
2324

2425
/**
@@ -261,6 +262,7 @@ protected function getCasters()
261262
Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())),
262263
);
263264
},
265+
FormView::class => array(StubCaster::class, 'cutInternals'),
264266
ConstraintViolationInterface::class => function (ConstraintViolationInterface $v, array $a) {
265267
return array(
266268
Caster::PREFIX_VIRTUAL.'root' => $v->getRoot(),

src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Form\FormInterface;
1515
use Symfony\Component\Form\FormView;
1616
use Symfony\Component\Validator\ConstraintViolationInterface;
17-
use Symfony\Component\VarDumper\Caster\CutStub;
1817

1918
/**
2019
* Default implementation of {@link FormDataExtractorInterface}.
@@ -145,10 +144,6 @@ public function extractViewVariables(FormView $view)
145144
);
146145

147146
foreach ($view->vars as $varName => $value) {
148-
// Removing redundant variable from view variables
149-
if ('form' === $varName) {
150-
$value = new CutStub($value);
151-
}
152147
$data['view_vars'][$varName] = $value;
153148
}
154149

0 commit comments

Comments
 (0)