mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
adapt rector rules for chained builder->add
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Utils\Rector\Tests\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector\Fixture;
|
||||
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class MyClass implements FilterInterface
|
||||
{
|
||||
public function describeAction($data, $format = 'string')
|
||||
{
|
||||
// TODO: Implement describeAction() method.
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder
|
||||
->add('foo', PickRollingDateType::class, [
|
||||
'label' => 'Test thing',
|
||||
'data' => new RollingDate(RollingDate::T_TODAY)
|
||||
])
|
||||
->anotherCall('test')
|
||||
->add('baz', TextType::class, [
|
||||
'label' => 'OrNiCar',
|
||||
'data' => 'Castor'
|
||||
])
|
||||
->baz('foo');
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
// TODO: Implement getTitle() method.
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
// TODO: Implement addRole() method.
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
// TODO: Implement alterQuery() method.
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
// TODO: Implement applyOn() method.
|
||||
}
|
||||
}
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Utils\Rector\Tests\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector\Fixture;
|
||||
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class MyClass implements FilterInterface
|
||||
{
|
||||
public function describeAction($data, $format = 'string')
|
||||
{
|
||||
// TODO: Implement describeAction() method.
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder
|
||||
->add('foo', PickRollingDateType::class, [
|
||||
'label' => 'Test thing'
|
||||
])
|
||||
->anotherCall('test')
|
||||
->add('baz', TextType::class, [
|
||||
'label' => 'OrNiCar'
|
||||
])
|
||||
->baz('foo');
|
||||
}
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
return ['foo' => new RollingDate(RollingDate::T_TODAY), 'baz' => 'Castor'];
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
// TODO: Implement getTitle() method.
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
// TODO: Implement addRole() method.
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
// TODO: Implement alterQuery() method.
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
// TODO: Implement applyOn() method.
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user