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

Remove global options from PHP generators #2403

Merged
merged 2 commits into from
Mar 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/generators/php-laravel.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ sidebar_label: php-laravel
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|srcBasePath|The directory to serve as source root.| |null|
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
2 changes: 0 additions & 2 deletions docs/generators/php-lumen.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ sidebar_label: php-lumen
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|srcBasePath|The directory to serve as source root.| |null|
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
2 changes: 0 additions & 2 deletions docs/generators/php-slim.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ sidebar_label: php-slim
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|srcBasePath|The directory to serve as source root.| |null|
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
2 changes: 0 additions & 2 deletions docs/generators/php-symfony.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ sidebar_label: php-symfony
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|srcBasePath|The directory to serve as source root.| |null|
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
|composerVendorName|The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets| |null|
|bundleName|The name of the Symfony bundle. The template uses {{bundleName}}| |null|
Expand Down
2 changes: 0 additions & 2 deletions docs/generators/php-ze-ph.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ sidebar_label: php-ze-ph
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|srcBasePath|The directory to serve as source root.| |null|
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
2 changes: 0 additions & 2 deletions docs/generators/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ sidebar_label: php
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
|srcBasePath|The directory to serve as source root.| |null|
|gitUserId|Git user ID, e.g. openapitools.| |null|
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
|hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true|
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*ap Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
/* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
* Copyright 2018 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -132,8 +132,6 @@ public AbstractPhpCodegen() {
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay\\Pets"));
cliOptions.add(new CliOption(PACKAGE_NAME, "The main package name for classes. e.g. GeneratedPetstore"));
cliOptions.add(new CliOption(SRC_BASE_PATH, "The directory to serve as source root."));
cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, "The version to use in the composer package version field. e.g. 1.2.3"));
}

Expand Down Expand Up @@ -180,18 +178,6 @@ public void processOpts() {
}
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);

if (additionalProperties.containsKey(CodegenConstants.GIT_USER_ID)) {
this.setGitUserId((String) additionalProperties.get(CodegenConstants.GIT_USER_ID));
} else {
additionalProperties.put(CodegenConstants.GIT_USER_ID, gitUserId);
}

if (additionalProperties.containsKey(CodegenConstants.GIT_REPO_ID)) {
this.setGitRepoId((String) additionalProperties.get(CodegenConstants.GIT_REPO_ID));
} else {
additionalProperties.put(CodegenConstants.GIT_REPO_ID, gitRepoId);
}

if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) {
this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ protected void setExpectations() {
times = 1;
clientCodegen.setSrcBasePath(PhpLumenServerOptionsProvider.SRC_BASE_PATH_VALUE);
times = 1;
clientCodegen.setGitUserId(PhpLumenServerOptionsProvider.GIT_USER_ID_VALUE);
times = 1;
clientCodegen.setGitRepoId(PhpLumenServerOptionsProvider.GIT_REPO_ID_VALUE);
times = 1;
clientCodegen.setArtifactVersion(PhpLumenServerOptionsProvider.ARTIFACT_VERSION_VALUE);
times = 1;
}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class PhpClientOptionsProvider implements OptionsProvider {
public static final String INVOKER_PACKAGE_VALUE = "OpenAPITools\\Client\\Php";
public static final String PACKAGE_NAME_VALUE = "OpenAPIToolsClient-php";
public static final String SRC_BASE_PATH_VALUE = "libPhp";
public static final String GIT_USER_ID_VALUE = "gitOpenAPIToolsPhp";
public static final String GIT_REPO_ID_VALUE = "git-openapi-tools-client-php";
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true";
Expand All @@ -54,8 +52,6 @@ public Map<String, String> createOptions() {
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
.put(PhpClientCodegen.PACKAGE_NAME, PACKAGE_NAME_VALUE)
.put(PhpClientCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
.put(CodegenConstants.GIT_USER_ID, GIT_USER_ID_VALUE)
.put(CodegenConstants.GIT_REPO_ID, GIT_REPO_ID_VALUE)
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class PhpLumenServerOptionsProvider implements OptionsProvider {
public static final String INVOKER_PACKAGE_VALUE = "lumen";
public static final String PACKAGE_NAME_VALUE = "php";
public static final String SRC_BASE_PATH_VALUE = "libPhp";
public static final String GIT_USER_ID_VALUE = "gitOpenAPIToolsPhp";
public static final String GIT_REPO_ID_VALUE = "git-openapi-tools-php";
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true";
Expand All @@ -54,8 +52,6 @@ public Map<String, String> createOptions() {
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
.put(CodegenConstants.GIT_USER_ID, GIT_USER_ID_VALUE)
.put(CodegenConstants.GIT_REPO_ID, GIT_REPO_ID_VALUE)
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider {
public static final String INVOKER_PACKAGE_VALUE = "OpenAPIServer";
public static final String PACKAGE_NAME_VALUE = "";
public static final String SRC_BASE_PATH_VALUE = "src";
public static final String GIT_USER_ID_VALUE = "gitOpenAPIToolsPhp";
public static final String GIT_REPO_ID_VALUE = "git-openapi-tools-php";
public static final String ARTIFACT_VERSION_VALUE = "1.0.0";
public static final String SORT_PARAMS_VALUE = "false";
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
Expand All @@ -52,8 +50,6 @@ public Map<String, String> createOptions() {
.put(AbstractPhpCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
.put(CodegenConstants.GIT_USER_ID, GIT_USER_ID_VALUE)
.put(CodegenConstants.GIT_REPO_ID, GIT_REPO_ID_VALUE)
.put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ protected void setExpectations() {
times = 1;
clientCodegen.setSrcBasePath(PhpClientOptionsProvider.SRC_BASE_PATH_VALUE);
times = 1;
clientCodegen.setGitUserId(PhpClientOptionsProvider.GIT_USER_ID_VALUE);
times = 1;
clientCodegen.setGitRepoId(PhpClientOptionsProvider.GIT_REPO_ID_VALUE);
times = 1;
clientCodegen.setArtifactVersion(PhpClientOptionsProvider.ARTIFACT_VERSION_VALUE);
times = 1;
}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ protected void setExpectations() {
times = 1;
clientCodegen.setSrcBasePath(PhpSlimServerOptionsProvider.SRC_BASE_PATH_VALUE);
times = 1;
clientCodegen.setGitUserId(PhpSlimServerOptionsProvider.GIT_USER_ID_VALUE);
times = 1;
clientCodegen.setGitRepoId(PhpSlimServerOptionsProvider.GIT_REPO_ID_VALUE);
times = 1;
clientCodegen.setArtifactVersion(PhpSlimServerOptionsProvider.ARTIFACT_VERSION_VALUE);
times = 1;
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE));
Expand Down