dotkernel / admin

DotKernel Admin Application, built on top of Mezzio microframework and using Laminas components.ezzio for branch 2 and above.
https://admin5.dotkernel.net
MIT License
24 stars 5 forks source link

[Insight] Your project should not contain duplicated code - in src/…/InputFilter/AdminInputFilter.php, line 20 #248

Open arhimede opened 2 weeks ago

arhimede commented 2 weeks ago

in src/Admin/src/InputFilter/AdminInputFilter.php, line 20

The next 24 lines appear both in src/Admin/src/InputFilter/AdminInputFilter.php:20 and src/Admin/src/InputFilter/EditAdminInputFilter.php:20.

use Laminas\Validator\StringLength;

/**
 * @extends InputFilter<object>
 */
class AdminInputFilter extends InputFilter
{
    public function init(): void
    {
        $identity = new Input('identity');
        $identity->setRequired(true);

Posted from SymfonyInsight

cPintiuta commented 1 week ago

This should be ignored as the other warning like this was. The dublicate code warning is between create and edit inputs for the admin, whatever changes we make, still will se dublicate code, as the password inputs for create needs to be required and for edit don't. I tried to make a base input filter and create and update to extend that, but still will see dublicate code because of the passwords inputs.