Cphalcon: [BUG]: Closure not working in filter

Created on 25 Sep 2019  路  3Comments  路  Source: phalcon/cphalcon

Describe the bug
When using a closure as a filter sanitizing fails.

To Reproduce

Steps to reproduce the behavior:

        $locator = new FilterFactory();
        $filter = $locator->newInstance();
        $filter->set(
            'testappend',
            function ($input) {
                return $input.'test';
            }
        );
        $value = 'cheese';
        $actual = $filter->sanitize($value, 'testappend');

        $expected = $value.'test';
        $I->assertEquals($expected, $actual);

Output

[ArgumentCountError] Too few arguments to function Phalcon\Test\Unit\Filter\Filter\SanitizeMultipleCest::Phalcon\Test\Unit\Filter\Filter\{closure}(), 0 passed and exactly 1 expected  

Details

  • Phalcon version: (4.0.0-rc.1)
  • PHP Version: (7.3)
bug low

Most helpful comment

Resolved

All 3 comments

What is actually returned? Is there anything in $input variable in closure?

@Jurigag Sorry, it's in now

Resolved

Was this page helpful?
0 / 5 - 0 ratings