{"action":"closed","issue":{"number":33,"created_at":"2011-10-17T15:41:50Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Scope of Change\n====\nAnnotations will be supported for member variables. XPClass::getFields() \nwill no longer return an hash of name => value for each member variable\nbut an array of Field objects.\n\nRationale\n====\nA situation in which this will be useful is when generating WSDLs for\ncomplex types (objects). Because PHP can not initialize member variables\nto objects and because PHP variables only get a type when they're \nassigned something, we cannot correctly reflect types of those member\nvariables.\n\nFunctionality\n====\n\nType hinting member variables\n----\n\n```php\n<?php\n  class LoginHandler extends Object {\n    var\n      #[@type= 'com.example.intranet.User'] \n      $user   = NULL;\n  }\n?>\n```\n\nRetrieving class fields\n----\n\n```php\n<?php\n  foreach ($class->getFields() as $field) {\n    echo $field->getType(), ' ', $field->getName(), \"\\n\";\n  }\n?>\n```\n\n\nSecurity considerations\n====\nn/a\n\nSpeed impact\n====\n- Reflection will be a bit slower\n\nDependencies\n====\n\nRelated documents\n====\n- xp-framework/rfc #16: Metadata for PHP4\n\n- http://xp-framework.net/downloads/0033.rfc.diff\n  Implementing patch\n  \n- http://xp-framework.net/downloads/ReflectionTest.class.phps\n  Test case (NOTE: requires xp-framework/rfc #32 and xp-framework/rfc #33 patches to work!)\n\n- http://xp-framework.net/downloads/TestClass.class.phps\n  Test class for above test case\n\n","comments":0,"title":"Annotation support for members / lang.reflect.Field","updated_at":"2011-10-17T15:41:50Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/33","id":1929947,"assignee":null,"milestone":null,"closed_at":"2011-10-17T15:41:50Z","user":{"gravatar_id":"26f07e3b262e9a80436f368cb11bd0c2","avatar_url":"https://secure.gravatar.com/avatar/26f07e3b262e9a80436f368cb11bd0c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thekid","id":696742,"login":"thekid"},"html_url":"https://github.com/xp-framework/rfc/issues/33","labels":[{"name":"framework","url":"https://api.github.com/repos/xp-framework/rfc/labels/framework","color":"118f5b"},{"name":"implemented","url":"https://api.github.com/repos/xp-framework/rfc/labels/implemented","color":"807370"}],"state":"closed"},"legacy":{"number":33,"action":"closed","issue":1929947}}