/**
  * Sets the cost for they blowfish hash method.
  *
  * @param int $cost Valid values are 4-31
  * @return void
  */
 public static function setCost($cost)
 {
     if ($cost < 4 || $cost > 31) {
         trigger_error(__d('cake_dev', 'Invalid value, cost must be between %s and %s', array(4, 31)), E_USER_WARNING);
         return null;
     }
     static::$hashCost = $cost;
 }
Exemple #2
0
 /**
  * Sets the cost for they blowfish hash method.
  *
  * @param int $cost Valid values are 4-31
  * @return void
  * @throws \Cake\Error\Exception When cost is invalid.
  */
 public static function setCost($cost)
 {
     if ($cost < 4 || $cost > 31) {
         throw new Exception(vsprintf('Invalid value, cost must be between %s and %s', array(4, 31)));
     }
     static::$hashCost = $cost;
 }