<?php
 abstract class vB_Utility_Password_Algorithm { use vB_Utility_Trait_NoSerialize; public static function instance($scheme) { $algorithm = explode(':', $scheme, 2); $class = 'vB_Utility_Password_Algorithm_' . ucfirst($algorithm[0]); if (class_exists($class)) { return new $class($scheme); } throw new vB_Utility_Password_Exception_InvalidScheme(); } protected function __construct($scheme) { } abstract public function generateToken($password); abstract public function verifyPassword($password, $token); public function requireRehash($token) { return false; } } 