Code Duplication    Length = 34-34 lines in 3 locations

src/User/Command/BuildLoginForm.php 1 location

@@ 16-49 (lines=34) @@
13
 * @author        Ryan Thompson <[email protected]>
14
 * @package       Anomaly\UsersModule\User\Command
15
 */
16
class BuildLoginForm implements SelfHandling
17
{
18
19
    /**
20
     * The form parameters.
21
     *
22
     * @var array
23
     */
24
    protected $parameters;
25
26
    /**
27
     * Create a new BuildLoginForm instance.
28
     *
29
     * @param array $parameters
30
     */
31
    public function __construct(array $parameters = [])
32
    {
33
        $this->parameters = $parameters;
34
    }
35
36
    /**
37
     * Handle the command.
38
     *
39
     * @param PluginForm $form
40
     * @param Decorator  $decorator
41
     * @return \Anomaly\Streams\Platform\Ui\Form\FormBuilder
42
     */
43
    public function handle(PluginForm $form, Decorator $decorator)
44
    {
45
        $parameters = array_merge_recursive($this->parameters, ['builder' => LoginFormBuilder::class]);
46
47
        return $decorator->decorate($form->make($parameters)->getForm());
48
    }
49
}
50

src/User/Command/BuildRegisterForm.php 1 location

@@ 16-49 (lines=34) @@
13
 * @author        Ryan Thompson <[email protected]>
14
 * @package       Anomaly\UsersModule\User\Command
15
 */
16
class BuildRegisterForm implements SelfHandling
17
{
18
19
    /**
20
     * The form parameters.
21
     *
22
     * @var array
23
     */
24
    protected $parameters;
25
26
    /**
27
     * Create a new BuildRegisterForm instance.
28
     *
29
     * @param array $parameters
30
     */
31
    public function __construct(array $parameters = [])
32
    {
33
        $this->parameters = $parameters;
34
    }
35
36
    /**
37
     * Handle the command.
38
     *
39
     * @param PluginForm $form
40
     * @param Decorator  $decorator
41
     * @return \Anomaly\Streams\Platform\Ui\Form\FormBuilder
42
     */
43
    public function handle(PluginForm $form, Decorator $decorator)
44
    {
45
        $parameters = array_merge_recursive($this->parameters, ['builder' => RegisterFormBuilder::class]);
46
47
        return $decorator->decorate($form->make($parameters)->getForm());
48
    }
49
}
50

src/User/Command/BuildResetForm.php 1 location

@@ 16-49 (lines=34) @@
13
 * @author        Ryan Thompson <[email protected]>
14
 * @package       Anomaly\UsersModule\User\Command
15
 */
16
class BuildResetForm implements SelfHandling
17
{
18
19
    /**
20
     * The form parameters.
21
     *
22
     * @var array
23
     */
24
    protected $parameters;
25
26
    /**
27
     * Create a new BuildResetForm instance.
28
     *
29
     * @param array $parameters
30
     */
31
    public function __construct(array $parameters = [])
32
    {
33
        $this->parameters = $parameters;
34
    }
35
36
    /**
37
     * Handle the command.
38
     *
39
     * @param PluginForm $form
40
     * @param Decorator  $decorator
41
     * @return \Anomaly\Streams\Platform\Ui\Form\FormBuilder
42
     */
43
    public function handle(PluginForm $form, Decorator $decorator)
44
    {
45
        $parameters = array_merge_recursive($this->parameters, ['builder' => ResetFormBuilder::class]);
46
47
        return $decorator->decorate($form->make($parameters)->getForm());
48
    }
49
}
50