nahakiole / staruml-php

PHP extension for StarUML
https://staruml.io/extensions
MIT License
17 stars 8 forks source link

Type-hint arguments and return types #3

Closed EvanWashkow closed 3 years ago

EvanWashkow commented 5 years ago

Could you add (or direct me) to how I can generate code with 7.1 type hints?

function myFunction( int $integer ): string
{
    return "{$integer}";
}
nahakiole commented 5 years ago

Thanks for the feeback :)

At the moment the plugin doesn't support the type hints. If you want to give it a crack yourself the code would have to be implemented somewhere around here: https://github.com/nahakiole/staruml-php/blob/master/code-generator.js#L369

But it would need a additional preference to toggle this behavior on or off. https://github.com/nahakiole/staruml-php/blob/master/preferences/preference.json

I will try to implement it, but can't yet say when I'll have time to do it.

nahakiole commented 3 years ago

Issues was fixed by @ricardopedias and is published in release 0.2.0 https://github.com/nahakiole/staruml-php/releases/tag/0.2.0

nahakiole commented 3 years ago

I will inform StarUML, and they should publish it to the repository in the next few days.