Changeset 706
- Timestamp:
- 06/05/07 21:04:10 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/stubBaseObject.php
r698 r706 3 3 * base class for all other stubbles classes except static ones and classes 4 4 * extending php built-in classes 5 * 5 * 6 6 * @author Frank Kleine <mikey@stubbles.net> 7 7 * @package stubbles … … 10 10 * base class for all other stubbles classes except static ones and classes 11 11 * extending php built-in classes 12 * 12 * 13 13 * @package stubbles 14 14 */ … … 45 45 * 46 46 * @return string 47 * @XMLIgnore 47 48 */ 48 49 public function getClassName() … … 55 56 * 56 57 * @return string 58 * @XMLIgnore 57 59 */ 58 60 public function hashCode() … … 73 75 return ($this->hashCode() == $compare->hashCode()); 74 76 } 75 77 76 78 return false; 77 79 } … … 79 81 /** 80 82 * returns a string representation of the class 81 * 83 * 82 84 * The result is a short but informative representation about the class and 83 85 * its values. Per default, this method returns: … … 102 104 /** 103 105 * returns a string representation of the class 104 * 106 * 105 107 * The result is a short but informative representation about the class and 106 108 * its values. Per default, this method returns: … … 129 131 $properties = get_object_vars($object); 130 132 } 131 133 132 134 $string = $object->getClassName() . " {\n"; 133 135 foreach ($properties as $name => $value) { … … 135 137 continue; 136 138 } 137 139 138 140 $string .= ' ' . $name . '(' . self::determineType($value) . '): '; 139 141 if (($value instanceof self) == false) { … … 141 143 continue; 142 144 } 143 145 144 146 $lines = explode("\n", (string) $value); 145 147 $lineCounter = 0; … … 148 150 continue; 149 151 } 150 152 151 153 if (0 != $lineCounter) { 152 154 $string .= ' ' . $line . "\n"; … … 154 156 $string .= $line . "\n"; 155 157 } 156 158 157 159 $lineCounter++; 158 160 } 159 161 } 160 162 161 163 $string .= "}\n"; 162 164 return $string; … … 175 177 return gettype($value); 176 178 } 177 179 178 180 return 'resource[' . get_resource_type($value) . ']'; 179 181 } 180 182 181 183 if ($value instanceof stubObject) { 182 184 return $value->getClassName(); 183 185 } 184 186 185 187 return get_class($value); 186 188 }
