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

InputFilter is created twice #15

Open
ivan-wolf opened this issue Jan 6, 2019 · 0 comments
Open

InputFilter is created twice #15

ivan-wolf opened this issue Jan 6, 2019 · 0 comments

Comments

@ivan-wolf
Copy link

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.

rppgorecki pushed a commit to rppgorecki/ze-content-validation that referenced this issue Nov 7, 2019
 1. mvlabs#15
 2. $inputFilter->getInvalidInput() can return instance of InputFilterInterface, which doesn't implement getName()
@rppgorecki rppgorecki mentioned this issue Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant