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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for Trait generator #24

Open
weierophinney opened this issue Dec 31, 2019 · 4 comments
Open

Examples for Trait generator #24

weierophinney opened this issue Dec 31, 2019 · 4 comments

Comments

@weierophinney
Copy link
Member

I had requested traits back in zendframework/zendframework#4876 which is now closed. It appears this support was added via TraitGenerator. Would be great to see some examples included in the docs.


Originally posted by @RSully at zendframework/zend-code#73

@vrkansagara
Copy link

$traitclass = new TraitGenerator();
$traitclass->addMethod('MethodOne');
$traitclass->addConstant('VERSION','1.0.0');
echo $traitclass->generate();
trait 
{
    public const VERSION = '1.0.0';

    public function MethodOne()
    {
    }
}

@weierophinney You can close this issue as I am sharing code for the user.
Ping :- @RSully

@Ocramius
Copy link
Member

You can close this issue as I am sharing code for the user.

Is it part of the docs though? The original issue is indeed about expanding in the RST docs...

@vrkansagara
Copy link

@Ocramius I am thinking to contribute into doc but it was not original into doc so I am not sure about this.

@Ocramius
Copy link
Member

vrkansagara added a commit to vrkansagara/laminas-code that referenced this issue Apr 14, 2021
@froschdesign froschdesign linked a pull request Apr 14, 2021 that will close this issue
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 a pull request may close this issue.

3 participants