Skip to content

Simplified file properties definition for the php file generation #591

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

Conversation

bohdan-harniuk
Copy link
Collaborator

Description (*)
It is an improvement for the tool that simplifies file properties definition.
The main points of this enhancement:

  1. extract initialisation of the PhpClassTypesBuilder instance to the base class for all PHP generators (PhpFileGenerator)
  2. extract file attributes merging and the "USES" attribute definition to the base class
  3. simplifying access to set properties and types through the one method

Before we had to call the appendProperty method to add simple property and append to add a type. Now we can use the append method for both cases. There is the syntax/metadata for this method:

public PhpClassTypesBuilder append(final @NotNull String propertyName, final @NotNull String propertyValue, final boolean isAddToImports) {...}

To add a simple property we just need to specify the isAddToImports argument as false. This argument is used to define if that property needs to be added to the imports (uses) section of the file.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with integration/functional tests (if applicable)
  • All automated tests passed successfully (all builds are green)

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.

3 participants