[TYPO3-50-general] Generic Object Access

Robert Lemke robert at typo3.org
Tue Jan 6 10:31:12 CET 2009


Hi Bastian,

thanks a lot! Keep The Code Clean!

robert

Am 06.01.2009 um 09:57 schrieb Bastian Waidelich:

> Sebastian Kurfürst wrote:
>
> Hi Sebastian,
>
>> http://forge.typo3.org/repositories/entry/package-flow3/trunk/Classes/Reflection/F3_FLOW3_Reflection_ObjectAccess.php?rev=1695
>
> Hopefully properties make it into PHP as a language construct some  
> day..
> Until then this seems like a good solution for me!
> Some notes regarding the code:
>
> - line 24:
>  * [Enter description here]
>
> lazy? ;]~
>
>
> - line 50:
> static public function getProperty($object, $property) {
>
> This should be "$propertyName" instead of "$property" IMO as it does  
> not
> refer to the property but to its identifier.
>
>
> - line 79:
> static public function setProperty($object, $property,  
> $propertyValue) {
>
> The same here.
>
>
> - line 102:
> static public function getDeclaredPropertyNames($object) {
>
> Why "declared"? could be just "getPropertyNames"
>
> - line 111:
> $properties = array_unique($declaredPropertyNames);
>
> call me picky, but "$properties" -> "$propertyNames", no?
>
>
> - line 116:
> static public function getAllProperties($object) {
>
> javadoc comments missing
>
>
> - line 119:
> echo $property;
>
> ¡Ay, caramba!
>
>
> - line 148:
> //if (property_exists($object, $property)) {
>
> SVN does not like commented out code ;)
>
>
> - line 149:
> if (array_key_exists($property, get_class_vars(get_class($object)))) {
>
> Why don't you use get_object_vars here? Then you wouldn't have to
> convert the object to a class first.
>
>
> - line 160:
> static protected function buildGetterMethodName($property) {
>
> no javadoc comments.
>
>
> - line 163:
> static protected function buildSetterMethodName($property) {
>
> no javadoc comments.
>
>
> All the best
> Bastian
> _______________________________________________
> TYPO3-project-5_0-general mailing list
> TYPO3-project-5_0-general at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-5_0-general



More information about the TYPO3-project-5_0-general mailing list