Skip to content

InputFilter is created twice #15

@ivan-wolf

Description

@ivan-wolf

Please consider the following code from ValidatiorHandler:

    private function getInputFilter($inputFilterService)
    {
        $inputFilter = $this->inputFilterManager->get($inputFilterService);

        if (! $inputFilter instanceof InputFilter) {
            throw new ValidationClassNotExists(
                sprintf(
                    'Listed input filter "%s" does not exist; cannot validate request',
                    $inputFilterService
                )
            );
        }

        return $this->inputFilterManager->get($inputFilterService);
    }

In the return statement, there's no need to get the input filter again from the manager. We can just return $inputFilter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions