Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Extract IndexAction from ForgotController #964

Merged
merged 1 commit into from Dec 18, 2017

Conversation

localheinz
Copy link
Contributor

This PR

  • extracts an IndexAction from the ForgotController

Follows #912.

/** @var FormFactoryInterface $formFactory */
$formFactory = $app['form.factory'];

$resetForm = $formFactory->createBuilder(ForgotForm::class)->getForm();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't need to inject the entire FormFactory if all we need is an actual form.

bind:
$resetForm: '@OpenCFP\Http\Form\ForgotForm'

OpenCFP\Http\Form\ForgotForm:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derrabus

Since I believe you are the one who has the most experience with Symfony, can you take a look and suggest a better way to wire up an actual form from a form type, if you can think of one?

@@ -19,7 +19,7 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;

class ForgotForm extends AbstractType
final class ForgotFormType extends AbstractType
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed this class as it's not actually a form, but a definition of a form, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this change is unrelated to the rest of the PR, maybe move it to another PR?

$formType = $this->faker()->word;

$form = $this->createMock(Form\FormInterface::class);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be done with Prophecy?

Copy link
Contributor

@chartjes chartjes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chartjes chartjes merged commit 6c2df2e into opencfp:master Dec 18, 2017
@localheinz localheinz deleted the feature/forgot-index-action branch December 18, 2017 19:53
@localheinz
Copy link
Contributor Author

Thank you, @chartjes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants