nikic/PHP-Parser — Issue #12: Userfriendly API for Namespace, Function, Class, Methods and Properties
Author: mneuhaus
Created: 2012-03-01 15:14:00+00:00
State: open

Hey!

i've been thinking about using your Parser to create a Tool to Manipulate Classes. This has been a common practice among the TYPO3 Community with the old [kickstarter](http://www.video2brain.com/de/videos-26020.htm) and now the [ExtensionBuilder](http://typo3.org/documentation/document-library/extension-manuals/extension_builder/2.2.0/view/1/2/). The biggest caveat to date is the manipulation of those generated classes once the developer started to modify them. it's has been quite a buggy hassle to modfiy manually modified classes. This could simply be improved by your PHP-Parser.

To make this easier i'd propose to add some simple to use API to PHP-Parser make it easier to accomplish this task.
I've forked your Repo and started to implement some of these.

*Main thing i would like to know, is if you would be willing to integrate it directly into your Parser or if you think, that this doesn't really belong directly in the Parser and instead in a seperate library.*

For Example:

**General**

- getByType(Class|Method|Property|...)

**Namespace**

- getClasses()
- getFunctions()
- getName(), getType(), etc

**Class**

- getMethods()
- getProperties()
- addMethod()
- createMethod()
- addProperty()
- createProperty()
- getName(), getType(), etc

**Method**

- getArguments()
- getName(), getType(), etc

**Property**

- getName(), getType(), etc

Greetings Marc