diff --git a/src/main/java/io/swagger/codegen/languages/php/PhpClientCodegen.java b/src/main/java/io/swagger/codegen/languages/php/PhpClientCodegen.java index dd84987830..7c9a98b4a2 100644 --- a/src/main/java/io/swagger/codegen/languages/php/PhpClientCodegen.java +++ b/src/main/java/io/swagger/codegen/languages/php/PhpClientCodegen.java @@ -209,20 +209,6 @@ public String getHelp() { @Override public void processOpts() { - super.processOpts(); - - if (additionalProperties.containsKey(PACKAGE_PATH)) { - this.setPackagePath((String) additionalProperties.get(PACKAGE_PATH)); - } else { - additionalProperties.put(PACKAGE_PATH, packagePath); - } - - if (additionalProperties.containsKey(SRC_BASE_PATH)) { - this.setSrcBasePath((String) additionalProperties.get(SRC_BASE_PATH)); - } else { - additionalProperties.put(SRC_BASE_PATH, srcBasePath); - } - if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); @@ -251,6 +237,20 @@ public void processOpts() { additionalProperties.put(COMPOSER_PROJECT_NAME, composerProjectName); } + super.processOpts(); + + if (additionalProperties.containsKey(PACKAGE_PATH)) { + this.setPackagePath((String) additionalProperties.get(PACKAGE_PATH)); + } else { + additionalProperties.put(PACKAGE_PATH, packagePath); + } + + if (additionalProperties.containsKey(SRC_BASE_PATH)) { + this.setSrcBasePath((String) additionalProperties.get(SRC_BASE_PATH)); + } else { + additionalProperties.put(SRC_BASE_PATH, srcBasePath); + } + if (additionalProperties.containsKey(CodegenConstants.GIT_USER_ID)) { this.setGitUserId((String) additionalProperties.get(CodegenConstants.GIT_USER_ID)); } else { diff --git a/src/test/java/io/swagger/codegen/languages/php/PhpClientCodegenTest.java b/src/test/java/io/swagger/codegen/languages/php/PhpClientCodegenTest.java index 5f9e134556..7dcdc46bc1 100644 --- a/src/test/java/io/swagger/codegen/languages/php/PhpClientCodegenTest.java +++ b/src/test/java/io/swagger/codegen/languages/php/PhpClientCodegenTest.java @@ -18,6 +18,7 @@ public void testInitialValues() throws Exception { Assert.assertEquals(codegen.invokerPackage, "Swagger\\Client"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "Swagger\\Client"); Assert.assertEquals(codegen.getSortParamsByRequiredFlag(), Boolean.TRUE); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG), Boolean.TRUE); Assert.assertEquals(codegen.getHideGenerationTimestamp(), Boolean.TRUE); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); } @@ -39,6 +40,7 @@ public void testSetters() throws Exception { Assert.assertEquals(codegen.invokerPackage, "My\\Client\\Invoker"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "My\\Client\\Invoker"); Assert.assertEquals(codegen.getSortParamsByRequiredFlag(), Boolean.FALSE); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG), Boolean.FALSE); Assert.assertEquals(codegen.getHideGenerationTimestamp(), Boolean.FALSE); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); }