Changeset 942
- Timestamp:
- 09/25/07 23:29:11 (1 year ago)
- Files:
-
- trunk/src/main/php/net/stubbles/rdbms/persistence/stubPersistenceHelper.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/reflection/reflection.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/reflection/stubReflectionFunction.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/reflection/stubReflectionMethod.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/rdbms/persistence/stubPersistenceHelper.php
r928 r942 90 90 } 91 91 92 switch ( strtolower($returnType)) {92 switch ($returnType->value()) { 93 93 case 'int': 94 case 'integer':95 94 $column->setType('INT'); 96 95 $column->setSize(10); 97 96 break; 98 97 99 case 'double':100 98 case 'float': 101 99 $column->setType('FLOAT'); … … 104 102 105 103 case 'bool': 106 case 'boolean':107 104 $column->setType('TINYINT'); 108 105 $column->setSize(1); trunk/src/main/php/net/stubbles/reflection/reflection.php
r698 r942 18 18 'net.stubbles.reflection.stubReflectionPackage', 19 19 'net.stubbles.reflection.stubReflectionParameter', 20 'net.stubbles.reflection.stubReflectionProperty' 20 'net.stubbles.reflection.stubReflectionPrimitive', 21 'net.stubbles.reflection.stubReflectionProperty', 22 'net.stubbles.reflection.stubReflectionType' 21 23 ); 22 24 ?> trunk/src/main/php/net/stubbles/reflection/stubReflectionFunction.php
r901 r942 9 9 */ 10 10 stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotationFactory', 11 'net.stubbles.reflection.stubReflectionParameter' 11 'net.stubbles.reflection.stubReflectionClass', 12 'net.stubbles.reflection.stubReflectionParameter', 13 'net.stubbles.reflection.stubReflectionPrimitive' 12 14 ); 13 15 /** … … 119 121 * returns information about the return type of a function 120 122 * 121 * If the return type is a known class the return value is an instance of 122 * stubReflectionClass, if it is a scalar type or an unknown class the 123 * return value is a string and if the function does not have a return value 124 * this method returns null. 123 * If the return type is a class the return value is an instance of 124 * stubReflectionClass (if the class is unknown a 125 * stubClassNotFoundException will be thrown), if it is a scalar type the 126 * return value is an instance of stubReflectionPrimitive, and if the 127 * method does not have a return value this method returns null. 125 128 * Please be aware that this is guessing from the doc block with which the 126 129 * function is documented. If the doc block is missing or incorrect the … … 128 131 * hints for return values in PHP itself. 129 132 * 130 * @return st ring|stubReflectionClass133 * @return stubReflectionType 131 134 */ 132 135 public function getReturnType() … … 139 142 $returnParts = explode(' ', trim(str_replace('@return', '', $returnPart))); 140 143 $returnType = trim($returnParts[0]); 141 if (class_exists($returnType, false) === true) { 144 try { 145 return stubReflectionPrimitive::forName(new ReflectionClass('stubReflectionPrimitive'), $returnType); 146 } catch (stubIllegalArgumentException $iae) { 142 147 return new stubReflectionClass($returnType); 143 148 } 144 145 return $returnType;146 149 } 147 150 } trunk/src/main/php/net/stubbles/reflection/stubReflectionMethod.php
r900 r942 10 10 stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotationFactory', 11 11 'net.stubbles.reflection.stubReflectionClass', 12 'net.stubbles.reflection.stubReflectionParameter' 12 'net.stubbles.reflection.stubReflectionParameter', 13 'net.stubbles.reflection.stubReflectionPrimitive' 13 14 ); 14 15 /** … … 140 141 * returns information about the return type of a method 141 142 * 142 * If the return type is a known class the return value is an instance of 143 * stubReflectionClass, if it is a scalar type or an unknown class the 144 * return value is a string and if the method does not have a return value 145 * this method returns null. 143 * If the return type is a class the return value is an instance of 144 * stubReflectionClass (if the class is unknown a 145 * stubClassNotFoundException will be thrown), if it is a scalar type the 146 * return value is an instance of stubReflectionPrimitive, and if the 147 * method does not have a return value this method returns null. 146 148 * Please be aware that this is guessing from the doc block with which the 147 149 * method is documented. If the doc block is missing or incorrect the return … … 149 151 * return values in PHP itself. 150 152 * 151 * @return st ring|stubReflectionClass153 * @return stubReflectionType 152 154 */ 153 155 public function getReturnType() … … 160 162 $returnParts = explode(' ', trim(str_replace('@return', '', $returnPart))); 161 163 $returnType = trim($returnParts[0]); 162 if (class_exists($returnType, false) === true) { 164 try { 165 return stubReflectionPrimitive::forName(new ReflectionClass('stubReflectionPrimitive'), $returnType); 166 } catch (stubIllegalArgumentException $iae) { 163 167 return new stubReflectionClass($returnType); 164 168 } 165 166 return $returnType;167 169 } 168 170 }
