Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mautic.corals.io/vendor/bjeavons/zxcvbn-php/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mautic.corals.io/vendor/bjeavons/zxcvbn-php/src/Feedback.php
<?php

declare(strict_types=1);

namespace ZxcvbnPhp;

use ZxcvbnPhp\Matchers\MatchInterface;

/**
 * Feedback - gives some user guidance based on the strength
 * of a password
 *
 * @see zxcvbn/src/feedback.coffee
 */
class Feedback
{
    /**
     * @param int $score
     * @param MatchInterface[] $sequence
     * @return array
     */
    public function getFeedback(int $score, array $sequence): array
    {
        // starting feedback
        if (count($sequence) === 0) {
            return [
                'warning'     => '',
                'suggestions' => [
                    "Use a few words, avoid common phrases",
                    "No need for symbols, digits, or uppercase letters",
                ],
            ];
        }

        // no feedback if score is good or great.
        if ($score > 2) {
            return [
                'warning'     => '',
                'suggestions' => [],
            ];
        }

        // tie feedback to the longest match for longer sequences
        $longestMatch = $sequence[0];
        foreach (array_slice($sequence, 1) as $match) {
            if (mb_strlen($match->token) > mb_strlen($longestMatch->token)) {
                $longestMatch = $match;
            }
        }

        $feedback = $longestMatch->getFeedback(count($sequence) === 1);
        $extraFeedback = 'Add another word or two. Uncommon words are better.';

        array_unshift($feedback['suggestions'], $extraFeedback);
        return $feedback;
    }
}

Spamworldpro Mini