Skip to content

Userfriendly API for Namespace, Function, Class, Methods and Properties #12

@mneuhaus

Description

@mneuhaus

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 and now the ExtensionBuilder. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions