Back to ChainedHandler class

Method checkIfRehashNeeded

public bool
checkIfRehashNeeded
(string $hash)
Check if the password requires rehashing
Parameters
  • string $hash The password hash to check
Returns
  • bool
Since
  • 4.0.0

Method checkIfRehashNeeded - Source code

/**
 * Check if the password requires rehashing
 *
 * @param   string  $hash  The password hash to check
 *
 * @return  boolean
 *
 * @since   4.0.0
 */
public function checkIfRehashNeeded(string $hash) : bool
{
    foreach ($this->handlers as $handler) {
        if ($handler instanceof CheckIfRehashNeededHandlerInterface && $handler->isSupported() && $handler->checkIfRehashNeeded($hash)) {
            return true;
        }
    }
    return false;
}