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

[PHP] Add interface/abstract/trait helpers #906

Merged
merged 3 commits into from
Sep 2, 2018

Conversation

ybelenko
Copy link
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.3.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

It's obvious that some of PHP generators use Interface/Abstract/Trait classes. I've added few functions to generate names for this classes.
Defaults are set to follow "PSR Naming Conventions".
If user will ask we can add prefix/suffix generator options in future. I don't see modelPrefix generator option, so I assume it's not important now.
I didn't refresh samples, because they are the same.

Refs:
PSR Naming Conventions

cc @jebentier @dkarlovi @mandrean @jfastnacht @ackintosh

It would be helpful to set prefix/suffix for all interfaces, abstracts
and traits in one place. Defaults are set to follow "PSR Naming Conventions".
If user will ask we can add prefix/suffix generator options in future.
I don't see modelPrefix generator option, so I assume it's not important now.

Ref: https://www.php-fig.org/bylaws/psr-naming-conventions/
@ybelenko ybelenko merged commit 8a034ce into OpenAPITools:master Sep 2, 2018
@ybelenko ybelenko deleted the php_interface_suffix_prefix branch November 17, 2018 05:05
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* [PHP] Enhance interfaces, abstracts and traits

It would be helpful to set prefix/suffix for all interfaces, abstracts
and traits in one place. Defaults are set to follow "PSR Naming Conventions".
If user will ask we can add prefix/suffix generator options in future.
I don't see modelPrefix generator option, so I assume it's not important now.

Ref: https://www.php-fig.org/bylaws/psr-naming-conventions/

* [Slim] Refactor to use new helpers

* [Slim] Refresh samples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants