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
Enhancement: Extract IndexAction from ForgotController #964
Conversation
/** @var FormFactoryInterface $formFactory */ | ||
$formFactory = $app['form.factory']; | ||
|
||
$resetForm = $formFactory->createBuilder(ForgotForm::class)->getForm(); |
There was a problem hiding this comment.
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.
799add5
to
1f308dd
Compare
bind: | ||
$resetForm: '@OpenCFP\Http\Form\ForgotForm' | ||
|
||
OpenCFP\Http\Form\ForgotForm: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
classes/Http/Form/ForgotFormType.php
Outdated
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
1f308dd
to
85562c2
Compare
85562c2
to
0e25ba0
Compare
$formType = $this->faker()->word; | ||
|
||
$form = $this->createMock(Form\FormInterface::class); | ||
|
There was a problem hiding this comment.
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?
0e25ba0
to
438a59e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thank you, @chartjes! |
This PR
IndexAction
from theForgotController
Follows #912.