Added addUse method in ClassGenerator #2702

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

robertboloc commented Oct 8, 2012

Also added a getUses() method.
Issue #2453

weierophinney was assigned Oct 8, 2012

Owner

weierophinney commented Oct 8, 2012

This looks good -- one question, however: shouldn't it support aliasing? Something like:

$generator->setUseClass('Foo\Bar\Baz', 'BarBaz');

which would generate:

use Foo\Bar\Baz as BarBaz;
Contributor

robertboloc commented Oct 9, 2012

I added the aliasing support

Member

ralphschindler commented Oct 9, 2012

I think I'd prefer the api not talk about classes. More succinctly it would just be getUses(), addUse(), etc. The current use case is to add support for traits, which I am not sure are, taxonomically speaking, are close enough related to classes to call them such. Thoughts?

Contributor

robertboloc commented Oct 9, 2012

I agree, I'll refactor the method names and variables :)

Owner

weierophinney commented Oct 10, 2012

@robertboloc thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment