src/Traits/BaseTrait.php
private function internalFilterHooks($key, $value, $type = 'input')
    {
        $hook = '';
        switch (trim(strtolower($type))) {
            case 'output':
                $hook = 'filterOutputHook';
                break;
            case 'remove':
                $hook = 'filterRemoveHook';
                break;
            case 'input':
                $hook = 'filterInputHook';
                break;
        }
        if ($hook && method_exists($this, $hook)) {
            $result = $this->$hook($key, $value);
            if ($result !== true && $result !== null) {
                return false;
            }
        }
        return true;
    }
private function internalFilterHooks($key, $value, $type = 'input')
    {
        $hook = '';
        switch (trim(strtolower($type))) {
            case 'output':
                $hook = 'filterOutputHook';
                break;
            case 'remove':
                $hook = 'filterRemoveHook';
                break;
            case 'input':
                $hook = 'filterInputHook';
                break;
        }
        if ($hook && method_exists($this, $hook)) {
            $result = $this->$hook($key, $value);
            if ($result !== true && $result !== null) {
                return false;
            }
        }
        return true;
    }
private function internalFilterHooks ( $ key , $ value , $ type = 'input' ) { $ hook = '' ; switch ( trim ( strtolower ( $ type ) ) ) { case 'output' : $ hook = 'filterOutputHook' ; break ; case 'remove' : $ hook = 'filterRemoveHook' ; break ; case 'input' : $ hook = 'filterInputHook' ; break ; } if ( $ hook && method_exists ( $ this , $ hook ) ) { $ result = $ this -> $ hook ( $ key , $ value ) ; if ( $ result !== true && $ result !== null ) { return false ; } } return true ; }
this function have th base logic of filtering input and output base on
both of key and value
@param mixed $key the key of the element
@param mixed $value the value of the element
@param string $type which input or output are we sanitizing
@return bool is current element valid for input or output
this function have th base logic of filtering input and output base on both of key and value