Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
CHANGELOG
=========

0.2.2
-----
* Add `AbstractFlowButtonType` to simplify button type creation

0.2.1
-----
* Add `buildFormFlow(FormFlowBuilderInterface $builder, array $options)` method to `FormFlowTypeInterface`

0.2.0
-----
* [Breaking Changes] Renaming classes (see https://github.com/yceruto/formflow-bundle/pull/4)

0.1.3
-----
* [Breaking Changes] Refactor action handler execution
Expand Down
14 changes: 14 additions & 0 deletions src/Form/Flow/AbstractFlowButtonType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Yceruto\FormFlowBundle\Form\Flow;

use Symfony\Component\Form\AbstractType;
use Yceruto\FormFlowBundle\Form\Flow\Type\FlowButtonType;

abstract class AbstractFlowButtonType extends AbstractType implements FlowButtonTypeInterface
{
public function getParent(): string
{
return FlowButtonType::class;
}
}
10 changes: 2 additions & 8 deletions src/Form/Flow/Type/FlowFinishType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace Yceruto\FormFlowBundle\Form\Flow\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Yceruto\FormFlowBundle\Form\Flow\AbstractFlowButtonType;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonTypeInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowCursor;
use Yceruto\FormFlowBundle\Form\Flow\FormFlowInterface;

class FlowFinishType extends AbstractType implements FlowButtonTypeInterface
class FlowFinishType extends AbstractFlowButtonType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -24,9 +23,4 @@ public function configureOptions(OptionsResolver $resolver): void
'include_if' => fn (FlowCursor $cursor): bool => $cursor->isLastStep(),
]);
}

public function getParent(): string
{
return FlowButtonType::class;
}
}
10 changes: 2 additions & 8 deletions src/Form/Flow/Type/FlowNextType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace Yceruto\FormFlowBundle\Form\Flow\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Yceruto\FormFlowBundle\Form\Flow\AbstractFlowButtonType;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonTypeInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowCursor;
use Yceruto\FormFlowBundle\Form\Flow\FormFlowInterface;

class FlowNextType extends AbstractType implements FlowButtonTypeInterface
class FlowNextType extends AbstractFlowButtonType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -24,9 +23,4 @@ public function configureOptions(OptionsResolver $resolver): void
'include_if' => fn (FlowCursor $cursor): bool => $cursor->canMoveNext(),
]);
}

public function getParent(): string
{
return FlowButtonType::class;
}
}
10 changes: 2 additions & 8 deletions src/Form/Flow/Type/FlowPreviousType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace Yceruto\FormFlowBundle\Form\Flow\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Yceruto\FormFlowBundle\Form\Flow\AbstractFlowButtonType;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonTypeInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowCursor;
use Yceruto\FormFlowBundle\Form\Flow\FormFlowInterface;

class FlowPreviousType extends AbstractType implements FlowButtonTypeInterface
class FlowPreviousType extends AbstractFlowButtonType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -25,9 +24,4 @@ public function configureOptions(OptionsResolver $resolver): void
'clear_submission' => true,
]);
}

public function getParent(): string
{
return FlowButtonType::class;
}
}
10 changes: 2 additions & 8 deletions src/Form/Flow/Type/FlowResetType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Yceruto\FormFlowBundle\Form\Flow\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Yceruto\FormFlowBundle\Form\Flow\AbstractFlowButtonType;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonInterface;
use Yceruto\FormFlowBundle\Form\Flow\FlowButtonTypeInterface;
use Yceruto\FormFlowBundle\Form\Flow\FormFlowInterface;

class FlowResetType extends AbstractType implements FlowButtonTypeInterface
class FlowResetType extends AbstractFlowButtonType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -23,9 +22,4 @@ public function configureOptions(OptionsResolver $resolver): void
'clear_submission' => true,
]);
}

public function getParent(): string
{
return FlowButtonType::class;
}
}