kohana/ohanzee-helpers — pull request #2 by WinterSilence (2014-03-14 15:16:07+00:00)
Title: New properties, update Cookie::salt(), fix typo

1. Deleted text license, because it' s already defined tag @license
2. Salt separator '~' moved into property `Cookie::$separator`, it will easily change the value if necessary
3. Added `Cookie::$hash_hmac` and `Cookie::$hash_hmac_algo` properties, they used in `Cookie::salt()` for generate secure salt.

Why not alter the class in a singleton? Access to variables must be accessed through methods rather than directly, it would prevent their values.
Example:
~~~
protected $hash_hmac_algo = 'sha512';

public function hashHmacAlgo($algo = null)
{
if ($algo === null) {
return $this->hash_hmac_algo;
}

if (! in_array($algo, hash_algos())) {
// @todo create exceptions and replace it
throw new InvalidArgumentException(
sprintf('%s: unknown hashing algorithm `%s`.', __METHOD__, $algo),
);
}

$this->hash_hmac_algo = $algo;

return $this;
}
~~~