Introduced various bug fixes and improvements
This commit is contained in:
parent
6a2c0fb118
commit
ff7ba8a226
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Zxcvbn\Abstracts;
|
||||
|
||||
abstract class ScoreDefinitions
|
||||
{
|
||||
const ExtremelyGuessable = 0;
|
||||
|
||||
const VeryGuessable = 1;
|
||||
|
||||
const SomewhatGuessable = 2;
|
||||
|
||||
const SafelyUnguessable = 3;
|
||||
|
||||
const VeryUnguessable = 4;
|
||||
}
|
|
@ -83,8 +83,8 @@
|
|||
$matcher = new Matcher();
|
||||
|
||||
$baseAnalysis = $scorer->getMostGuessableMatchSequence($repeatedChar, $matcher->getMatches($repeatedChar));
|
||||
$baseMatches = $baseAnalysis['sequence'];
|
||||
$baseGuesses = $baseAnalysis['guesses'];
|
||||
$baseMatches = $baseAnalysis->Sequence;
|
||||
$baseGuesses = $baseAnalysis->Guesses;
|
||||
|
||||
$repeatCount = mb_strlen($match[0]['token']) / mb_strlen($repeatedChar);
|
||||
|
||||
|
|
|
@ -146,6 +146,8 @@ namespace Zxcvbn\Classes\Matchers;
|
|||
$curChar = mb_substr($password, $j, 1);
|
||||
foreach ($adjacents as $adj)
|
||||
{
|
||||
if($adj == null)
|
||||
continue;
|
||||
$curDirection += 1;
|
||||
$curCharPos = static::indexOf($adj, $curChar);
|
||||
if ($adj !== null && $curCharPos !== -1)
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
public static function match(string $password, array $userInputs = []);
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
* @return integer|float
|
||||
*/
|
||||
public function getGuesses(): int;
|
||||
public function getGuesses();
|
||||
|
||||
/**
|
||||
* @return float
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* @param string $warning
|
||||
* @param array $Suggestions
|
||||
*/
|
||||
public function __construct(string $warning=(string)null, array $Suggestions=[])
|
||||
public function __construct(string $warning='', array $Suggestions=[])
|
||||
{
|
||||
$this->Warning = $warning;
|
||||
$this->Suggestions = $Suggestions;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
$this->matcher = new Matcher();
|
||||
$this->scorer = new Scorer();
|
||||
$this->timeEstimator = new TimeEstimator();
|
||||
$this->feedback = new Feedback();
|
||||
$this->feedback = new FeedbackUtilities();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue