Skip to content

Commit

Permalink
Common: Updating documentation for TypedValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFrost committed Jan 4, 2012
1 parent 423072a commit 40eca1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/TypedValue.php
Expand Up @@ -28,6 +28,10 @@ class TypedValue {
/**
* Creates a new TypedValue. The type and value passed in the arguments
* will become available in the $type and $value member variables.
*
* @param mixed $type A 'type' to associate with the value. The type can
* be any kind of native type or object.
* @param mixed $value The value to be stored.
*/
public function __construct($type, $value) {
$this->type = &$type;
Expand All @@ -37,13 +41,17 @@ public function __construct($type, $value) {
/**
* When treated as a string, a TypedValue will default to its value's
* string representation.
*
* @return string A string representation of the stored value.
*/
public function __toString() {
return $this->value;
}

/**
* Allows a TypedValue to be used with the 'clone' keyword.
*
* @return TypedValue A new copy of this TypedValue object.
*/
public function __clone() {
return new TypedValue($this->type, $this->value);
Expand Down

0 comments on commit 40eca1b

Please sign in to comment.