Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended cg lib: Traits and Interface support #23

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Extended cg lib: Traits and Interface support #23

wants to merge 9 commits into from

Conversation

gossi
Copy link

@gossi gossi commented May 22, 2014

Hey,

I needed a good codegen lib with traits and interface support. Your codegen lib was the best I found, though missing what I needed. I baked it in. All changes:

  • requires php 5.4
  • New Model, heavily composed from various traits
  • Docblock Model, based on phpDocumentor/ReflectionDocBlock
  • More metadata for all models -> docblock generation from models
  • New CodeGenerator class, that recursively generates docblock before code generation
  • Some API changes, so incompatible with the current version
  • Needs an update to a new major version (see below)
  • Uhm, I have a different code style, so at best the code should be run through a code formatter

I would suggest a new name, because the library is hardly findable. New and better name probably is: php-code-generator or php-codegen. Because a new version is needed, I think this fits perfectly with a new name. How actively maintained is this project for this?

I will use my fork for my current project. I think I will find another round of issues when using it from a particular project. At least in the early days.

In a perfect world:

  • Code from a file -> generate the model through reflection and regenerate the code again -> still is the same [still not the case]
  • At best, a code formatter is run after code generation to properly deal with issues (e.g. indentation in code blocks). I started one as a nightly experiment: gossi/php-code-formatter (still is a bigger project than a nightly experiment 馃槃)

Would love to hear feedback
gossi

@@ -1,4 +1,10 @@
.project
.buildpath
.settings/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 lines are speciifc to your dev setup, not to the project. You should ignore them locally (you can even put the rule once to apply it for the whole machine): https://help.github.com/articles/ignoring-files

@stof
Copy link

stof commented May 22, 2014

I always find it weird to see a PR beign opened rewriting a library entirely without any previous discussion on it to know what the maintainer thinks about it...

Note that I'm not the maintainer

@gossi
Copy link
Author

gossi commented May 22, 2014

Hum, ye rewrite somehow sounds weird. It's more an extension that I needed and pushed back now.

@gossi gossi changed the title rewrite cg lib Extended cg lib May 22, 2014
@gossi gossi changed the title Extended cg lib Extended cg lib: Traits and Interface support May 22, 2014
@stof
Copy link

stof commented May 22, 2014

Well, if it is not BC (and it is not as it removes the 5.3 support for instance and drops some classes), it is not just an extension.

@gossi
Copy link
Author

gossi commented Oct 1, 2014

Any news on this @schmittjoh ? Because I'm planning on releasing my fork as its own version. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants