Devise\Users\Permissions\PermissionsManager::cleanInput PHP Method

cleanInput() protected method

Recursively walks the data received from the form and cleans all duplicate fields and empty values
protected cleanInput ( array &$input ) : void
$input array
return void
    protected function cleanInput(&$input)
    {
        foreach ($input as $key => &$value) {
            if (is_array($value)) {
                if (array_keys($value) !== range(0, count($value) - 1)) {
                    $this->cleanInput($value);
                } else {
                    array_shift($value);
                    foreach ($value as $index => $param) {
                        if ($param == '0') {
                            unset($value[$index]);
                        }
                    }
                }
            }
        }
    }