CRM-15626 fixes - Relationship Create Widget Not always showing the correct available...
[civicrm-core.git] / CRM / Core / Key.php
index 3817f8c49c958fae64c1b3eea78cf518f32903a6..8e430822e215cfaa3c357cc485c7a1430e85bc80 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -56,6 +56,9 @@ class CRM_Core_Key {
     return self::$_key;
   }
 
+  /**
+   * @return mixed|null|string
+   */
   static function sessionID() {
     if (!self::$_sessionID) {
       $session = CRM_Core_Session::singleton();
@@ -72,12 +75,12 @@ class CRM_Core_Key {
    * Generate a form key based on form name, the current user session
    * and a private key. Modelled after drupal's form API
    *
-   * @param string  $value       name of the form
-   * @paeam boolean $addSequence should we add a unique sequence number to the end of the key
+   * @param string $name
+   * @param bool $addSequence should we add a unique sequence number to the end of the key
    *
    * @return string       valid formID
    * @static
-   * @acess public
+   * @access public
    */
   static function get($name, $addSequence = FALSE) {
     $privateKey = self::privateKey();
@@ -95,12 +98,13 @@ class CRM_Core_Key {
   /**
    * Validate a form key based on the form name
    *
-   * @param string $formKey
+   * @param string $key
    * @param string $name
+   * @param bool $addSequence
    *
    * @return string $formKey if valid, else null
    * @static
-   * @acess public
+   * @access public
    */
   static function validate($key, $name, $addSequence = FALSE) {
     if (!is_string($key)) {
@@ -125,6 +129,11 @@ class CRM_Core_Key {
     return $key;
   }
 
+  /**
+   * @param $key
+   *
+   * @return bool
+   */
   static function valid($key) {
     // a valid key is a 32 digit hex number
     // followed by an optional _ and a number between 1 and 10000