src/Matchers/DictionaryMatch.php
public static function match($password, array $userInputs = [])
    {
        $matches = [];
        $dicts = static::getRankedDictionaries();
        if (!empty($userInputs)) {
            $dicts['user_inputs'] = [];
            foreach ($userInputs as $rank => $input) {
                $input_lower = strtolower($input);
                $rank = is_numeric($rank) ? $rank : count($dicts['user_inputs']);
                $dicts['user_inputs'][$input_lower] = max(1, $rank);
            }
        }
        foreach ($dicts as $name => $dict) {
            $results = static::dictionaryMatch($password, $dict);
            foreach ($results as $result) {
                $result['dictionary_name'] = $name;
                $matches[] = new static($password, $result['begin'], $result['end'], $result['token'], $result);
            }
        }

        return $matches;
    }
public static function match($password, array $userInputs = [])
    {
        $matches = [];
        $dicts = static::getRankedDictionaries();
        if (!empty($userInputs)) {
            $dicts['user_inputs'] = [];
            foreach ($userInputs as $rank => $input) {
                $input_lower = strtolower($input);
                $rank = is_numeric($rank) ? $rank : count($dicts['user_inputs']);
                $dicts['user_inputs'][$input_lower] = max(1, $rank);
            }
        }
        foreach ($dicts as $name => $dict) {
            $results = static::dictionaryMatch($password, $dict);
            foreach ($results as $result) {
                $result['dictionary_name'] = $name;
                $matches[] = new static($password, $result['begin'], $result['end'], $result['token'], $result);
            }
        }

        return $matches;
    }
public static function match ( $ password , array $ userInputs = [ ] ) { $ matches = [ ] ; $ dicts = static :: getRankedDictionaries ( ) ; if ( ! empty ( $ userInputs ) ) { $ dicts [ 'user_inputs' ] = [ ] ; foreach ( $ userInputs as $ rank => $ input ) { $ input_lower = strtolower ( $ input ) ; $ rank = is_numeric ( $ rank ) ? $ rank : count ( $ dicts [ 'user_inputs' ] ) ; $ dicts [ 'user_inputs' ] [ $ input_lower ] = max ( 1 , $ rank ) ; } } foreach ( $ dicts as $ name => $ dict ) { $ results = static :: dictionaryMatch ( $ password , $ dict ) ; foreach ( $ results as $ result ) { $ result [ 'dictionary_name' ] = $ name ; $ matches [ ] = new static ( $ password , $ result [ 'begin' ] , $ result [ 'end' ] , $ result [ 'token' ] , $ result ) ; } } return $ matches ; }
Match occurences of dictionary words in password.

@copydoc Match::match()

@param       $password
@param array $userInputs

@return array
Match occurences of dictionary words in password .