From 412923ab5f396f2528d8350f58e9d9a2570cef81 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Sun, 1 Jul 2018 12:16:55 -0400 Subject: [PATCH] [Slim] Refactoring (#402) * [Slim] Cleanup samples. composer.lock excluded from .gitignore composer.lcok should be commited to SVN. Official recommendation https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control * [Slim] Refactor. Extend AbstractPhpCodegen class * [Slim] Adjust the names (script, sample folder, generator) to lang option --- ...-server.sh => php-slim-server-petstore.sh} | 2 +- ...-server.sh => php-slim-server-petstore.sh} | 2 +- ...-server.sh => php-slim-server-petstore.sh} | 2 +- ...erver.bat => php-slim-server-petstore.bat} | 0 .../codegen/languages/AbstractPhpCodegen.java | 8 +- .../languages/PhpSlimServerCodegen.java | 288 ++-------------- .../resources/php-slim-server}/.gitignore | 2 +- .../{slim => php-slim-server}/.htaccess | 0 .../{slim => php-slim-server}/README.mustache | 0 .../{slim => php-slim-server}/composer.json | 0 .../{slim => php-slim-server}/index.mustache | 0 .../{slim => php-slim-server}/model.mustache | 0 .../options/PhpSlimServerOptionsProvider.java | 21 +- .../slim/PhpSlimServerOptionsTest.java | 18 + .../php-slim}/.gitignore | 2 +- .../{slim => php-slim}/.htaccess | 0 .../.openapi-generator-ignore | 0 .../php-slim/.openapi-generator/VERSION | 1 + .../{slim => php-slim}/README.md | 0 .../{slim => php-slim}/composer.json | 0 .../{slim => php-slim}/index.php | 0 .../lib/Models/ModelReturn.php | 0 .../slim/.openapi-generator/VERSION | 1 - .../petstore-security-test/slim/LICENSE | 201 ----------- .../petstore-security-test/slim/composer.lock | 315 ------------------ samples/server/petstore/php-slim/.gitignore | 2 +- .../lib/Models/$Special[modelName].php | 13 - .../php-slim/lib/Models/200Response.php | 15 - .../lib/Models/ArrayOfArrayOfNumberOnly.php | 2 +- .../php-slim/lib/Models/ArrayOfNumberOnly.php | 2 +- .../petstore/php-slim/lib/Models/Cat.php | 2 +- .../php-slim/lib/Models/FormatTest.php | 8 +- .../petstore/php-slim/lib/Models/List.php | 13 - .../petstore/php-slim/lib/Models/MapTest.php | 2 +- ...PropertiesAndAdditionalPropertiesClass.php | 4 +- .../php-slim/lib/Models/NumberOnly.php | 2 +- .../petstore/php-slim/lib/Models/Order.php | 4 +- .../php-slim/lib/Models/OuterComposite.php | 4 +- .../petstore/php-slim/lib/Models/Return.php | 13 - 39 files changed, 89 insertions(+), 860 deletions(-) rename bin/openapi3/{slim-petstore-server.sh => php-slim-server-petstore.sh} (78%) rename bin/{php-slim-petstore-server.sh => php-slim-server-petstore.sh} (75%) rename bin/security/{slim-petstore-server.sh => php-slim-server-petstore.sh} (75%) rename bin/windows/{php-slim-petstore-server.bat => php-slim-server-petstore.bat} (100%) mode change 100644 => 100755 rename {samples/server/petstore-security-test/slim => modules/openapi-generator/src/main/resources/php-slim-server}/.gitignore (94%) rename modules/openapi-generator/src/main/resources/{slim => php-slim-server}/.htaccess (100%) rename modules/openapi-generator/src/main/resources/{slim => php-slim-server}/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{slim => php-slim-server}/composer.json (100%) rename modules/openapi-generator/src/main/resources/{slim => php-slim-server}/index.mustache (100%) rename modules/openapi-generator/src/main/resources/{slim => php-slim-server}/model.mustache (100%) rename {modules/openapi-generator/src/main/resources/slim => samples/server/petstore-security-test/php-slim}/.gitignore (94%) rename samples/server/petstore-security-test/{slim => php-slim}/.htaccess (100%) rename samples/server/petstore-security-test/{slim => php-slim}/.openapi-generator-ignore (100%) create mode 100644 samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION rename samples/server/petstore-security-test/{slim => php-slim}/README.md (100%) rename samples/server/petstore-security-test/{slim => php-slim}/composer.json (100%) rename samples/server/petstore-security-test/{slim => php-slim}/index.php (100%) rename samples/server/petstore-security-test/{slim => php-slim}/lib/Models/ModelReturn.php (100%) delete mode 100644 samples/server/petstore-security-test/slim/.openapi-generator/VERSION delete mode 100644 samples/server/petstore-security-test/slim/LICENSE delete mode 100644 samples/server/petstore-security-test/slim/composer.lock delete mode 100644 samples/server/petstore/php-slim/lib/Models/$Special[modelName].php delete mode 100644 samples/server/petstore/php-slim/lib/Models/200Response.php delete mode 100644 samples/server/petstore/php-slim/lib/Models/List.php delete mode 100644 samples/server/petstore/php-slim/lib/Models/Return.php diff --git a/bin/openapi3/slim-petstore-server.sh b/bin/openapi3/php-slim-server-petstore.sh similarity index 78% rename from bin/openapi3/slim-petstore-server.sh rename to bin/openapi3/php-slim-server-petstore.sh index 57c912ee866..b737c4f2550 100755 --- a/bin/openapi3/slim-petstore-server.sh +++ b/bin/openapi3/php-slim-server-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-slim -o samples/server/petstore/slim $@" +ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-slim -o samples/server/petstore/php-slim $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/php-slim-petstore-server.sh b/bin/php-slim-server-petstore.sh similarity index 75% rename from bin/php-slim-petstore-server.sh rename to bin/php-slim-server-petstore.sh index 54624118c3b..2a7179f458a 100755 --- a/bin/php-slim-petstore-server.sh +++ b/bin/php-slim-server-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples/server/petstore/php-slim $@" +ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples/server/petstore/php-slim $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/slim-petstore-server.sh b/bin/security/php-slim-server-petstore.sh similarity index 75% rename from bin/security/slim-petstore-server.sh rename to bin/security/php-slim-server-petstore.sh index 8db85ea2dda..d6758284c7a 100755 --- a/bin/security/slim-petstore-server.sh +++ b/bin/security/php-slim-server-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-slim -o samples/server/petstore-security-test/slim $@" +ags="generate -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-slim -o samples/server/petstore-security-test/php-slim $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/php-slim-petstore-server.bat b/bin/windows/php-slim-server-petstore.bat old mode 100644 new mode 100755 similarity index 100% rename from bin/windows/php-slim-petstore-server.bat rename to bin/windows/php-slim-server-petstore.bat diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 3d44cfbf98a..2a0cb487150 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -452,7 +452,13 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg // add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime) if (!name.matches("^\\\\.*")) { - name = modelNamePrefix + name + modelNameSuffix; + if (!StringUtils.isEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } } // camelize the model name diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java index 465dcd1bc8c..1e3a074423d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java @@ -17,41 +17,28 @@ package org.openapitools.codegen.languages; -import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.swagger.v3.oas.models.media.*; import java.io.File; -import java.util.Arrays; import java.util.Map; import java.util.List; import java.util.HashMap; -import java.util.HashSet; -import java.util.regex.Matcher; import java.util.Comparator; import java.util.Collections; -public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfig { +public class PhpSlimServerCodegen extends AbstractPhpCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PhpSlimServerCodegen.class); - protected String invokerPackage; - protected String srcBasePath = "lib"; protected String groupId = "org.openapitools"; protected String artifactId = "openapi-server"; - protected String artifactVersion = "1.0.0"; - protected String packagePath = ""; // empty packagePath (top folder) - - - private String variableNamingConvention = "camelCase"; public PhpSlimServerCodegen() { super(); @@ -60,62 +47,37 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi // at the moment importMapping.clear(); + variableNamingConvention = "camelCase"; + artifactVersion = "1.0.0"; + packagePath = ""; // empty packagePath (top folder) invokerPackage = camelize("OpenAPIServer"); modelPackage = packagePath + "\\Models"; apiPackage = packagePath; outputFolder = "generated-code" + File.separator + "slim"; - modelTemplateFiles.put("model.mustache", ".php"); // no api files apiTemplateFiles.clear(); + // no test files + apiTestTemplateFiles.clear(); + // no doc files + modelDocTemplateFiles.clear(); + apiDocTemplateFiles.clear(); - embeddedTemplateDir = templateDir = "slim"; + embeddedTemplateDir = templateDir = "php-slim-server"; - setReservedWordsLowerCase( - Arrays.asList( - "__halt_compiler", "abstract", "and", "array", "as", "break", "callable", "case", "catch", "class", "clone", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "eval", "exit", "extends", "final", "for", "foreach", "function", "global", "goto", "if", "implements", "include", "include_once", "instanceof", "insteadof", "interface", "isset", "list", "namespace", "new", "or", "print", "private", "protected", "public", "require", "require_once", "return", "static", "switch", "throw", "trait", "try", "unset", "use", "var", "while", "xor") - ); - - additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); + // additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); additionalProperties.put(CodegenConstants.GROUP_ID, groupId); additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); - - // ref: http://php.net/manual/en/language.types.intro.php - languageSpecificPrimitives = new HashSet( - Arrays.asList( - "boolean", - "int", - "integer", - "double", - "float", - "string", - "object", - "DateTime", - "mixed", - "number") - ); - - instantiationTypes.put("array", "array"); - instantiationTypes.put("map", "map"); - - // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types - typeMapping = new HashMap(); - typeMapping.put("integer", "int"); - typeMapping.put("long", "int"); - typeMapping.put("float", "float"); - typeMapping.put("double", "double"); - typeMapping.put("string", "string"); - typeMapping.put("byte", "int"); - typeMapping.put("boolean", "bool"); - typeMapping.put("date", "\\DateTime"); - typeMapping.put("datetime", "\\DateTime"); - typeMapping.put("file", "\\SplFileObject"); - typeMapping.put("map", "map"); - typeMapping.put("array", "array"); - typeMapping.put("list", "array"); - typeMapping.put("object", "object"); - typeMapping.put("binary", "\\SplFileObject"); + // additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + + // override cliOptions from AbstractPhpCodegen + for (CliOption co : cliOptions) { + if (co.getOpt().equals(AbstractPhpCodegen.VARIABLE_NAMING_CONVENTION)) { + co.setDescription("naming convention of variable name, e.g. camelCase."); + co.setDefault("camelCase"); + break; + } + } supportingFiles.add(new SupportingFile("README.mustache", packagePath.replace('/', File.separatorChar), "README.md")); supportingFiles.add(new SupportingFile("composer.json", packagePath.replace('/', File.separatorChar), "composer.json")); @@ -139,212 +101,6 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi return "Generates a PHP Slim Framework server library."; } - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - - @Override - public String apiFileFolder() { - return (outputFolder + File.separator + toPackagePath(apiPackage, srcBasePath)); - } - - @Override - public String modelFileFolder() { - return (outputFolder + File.separator + toPackagePath(modelPackage, srcBasePath)); - } - - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return getTypeDeclaration(inner) + "[]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = (Schema) p.getAdditionalProperties(); - return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]"; - } else if (!StringUtils.isEmpty(p.get$ref())) { - String type = super.getTypeDeclaration(p); - return (!languageSpecificPrimitives.contains(type)) - ? "\\" + modelPackage + "\\" + type : type; - } - return super.getTypeDeclaration(p); - } - - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type = null; - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) { - return type; - } else if (instantiationTypes.containsKey(type)) { - return type; - } - } else { - type = openAPIType; - } - if (type == null) { - return null; - } - return toModelName(type); - } - - @Override - public String getTypeDeclaration(String name) { - if (!languageSpecificPrimitives.contains(name)) { - return "\\" + modelPackage + "\\" + name; - } - return super.getTypeDeclaration(name); - } - - @Override - public String toDefaultValue(Schema p) { - return "null"; - } - - public void setParameterNamingConvention(String variableNamingConvention) { - this.variableNamingConvention = variableNamingConvention; - } - - @Override - public String toVarName(String name) { - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - - if ("camelCase".equals(variableNamingConvention)) { - // return the name in camelCase style - // phone_number => phoneNumber - name = camelize(name, true); - } else { // default to snake case - // return the name in underscore style - // PhoneNumber => phone_number - name = underscore(name); - } - - // parameter name starting with number won't compile - // need to escape it by appending _ at the beginning - if (name.matches("^\\d.*")) { - name = "_" + name; - } - - return name; - } - - @Override - public String toParamName(String name) { - // should be the same as variable name - return toVarName(name); - } - - @Override - public String toModelName(String name) { - // remove [ - name = name.replaceAll("\\]", ""); - - // Note: backslash ("\\") is allowed for e.g. "\\DateTime" - name = name.replaceAll("[^\\w\\\\]+", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - - // remove dollar sign - name = name.replaceAll("$", ""); - - // model name cannot use reserved keyword - if (isReservedWord(name)) { - LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name)); - name = "model_" + name; // e.g. return => ModelReturn (after camelize) - } - - // model name starts with number - if (name.matches("^\\d.*")) { - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name)); - name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) - } - - // add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime) - if (!name.matches("^\\\\.*")) { - if (!StringUtils.isEmpty(modelNamePrefix)) { - name = modelNamePrefix + "_" + name; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - name = name + "_" + modelNameSuffix; - } - } - - // camelize the model name - // phone_number => PhoneNumber - return camelize(name); - } - - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override - public String toOperationId(String operationId) { - // throw exception if method name is empty - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId), true)); - operationId = "call_" + operationId; - } - - return camelize(sanitizeName(operationId), true); - } - - public String toPackagePath(String packageName, String basePath) { - packageName = packageName.replace(invokerPackage, ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - if (basePath != null && basePath.length() > 0) { - basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar; // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - } - - String regFirstPathSeparator; - if ("/".equals(File.separator)) { // for mac, linux - regFirstPathSeparator = "^/"; - } else { // for windows - regFirstPathSeparator = "^\\\\"; - } - - String regLastPathSeparator; - if ("/".equals(File.separator)) { // for mac, linux - regLastPathSeparator = "/$"; - } else { // for windows - regLastPathSeparator = "\\\\$"; - } - - return (getPackagePath() + File.separatorChar + basePath - // Replace period, backslash, forward slash with file separator in package name - + packageName.replaceAll("[\\.\\\\/]", Matcher.quoteReplacement(File.separator)) - // Trim prefix file separators from package path - .replaceAll(regFirstPathSeparator, "")) - // Trim trailing file separators from the overall path - .replaceAll(regLastPathSeparator + "$", ""); - } - - public String getPackagePath() { - return packagePath; - } - - @Override - public String escapeQuotationMark(String input) { - // remove ' to avoid code injection - return input.replace("'", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", ""); - } - @Override public Map postProcessOperations(Map objs) { Map operations = (Map) objs.get("operations"); diff --git a/samples/server/petstore-security-test/slim/.gitignore b/modules/openapi-generator/src/main/resources/php-slim-server/.gitignore similarity index 94% rename from samples/server/petstore-security-test/slim/.gitignore rename to modules/openapi-generator/src/main/resources/php-slim-server/.gitignore index 9ff0a17ae5c..23a42ca8d8a 100644 --- a/samples/server/petstore-security-test/slim/.gitignore +++ b/modules/openapi-generator/src/main/resources/php-slim-server/.gitignore @@ -3,4 +3,4 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock \ No newline at end of file +# composer.lock \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/slim/.htaccess b/modules/openapi-generator/src/main/resources/php-slim-server/.htaccess similarity index 100% rename from modules/openapi-generator/src/main/resources/slim/.htaccess rename to modules/openapi-generator/src/main/resources/php-slim-server/.htaccess diff --git a/modules/openapi-generator/src/main/resources/slim/README.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/slim/README.mustache rename to modules/openapi-generator/src/main/resources/php-slim-server/README.mustache diff --git a/modules/openapi-generator/src/main/resources/slim/composer.json b/modules/openapi-generator/src/main/resources/php-slim-server/composer.json similarity index 100% rename from modules/openapi-generator/src/main/resources/slim/composer.json rename to modules/openapi-generator/src/main/resources/php-slim-server/composer.json diff --git a/modules/openapi-generator/src/main/resources/slim/index.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/index.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/slim/index.mustache rename to modules/openapi-generator/src/main/resources/php-slim-server/index.mustache diff --git a/modules/openapi-generator/src/main/resources/slim/model.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/slim/model.mustache rename to modules/openapi-generator/src/main/resources/php-slim-server/model.mustache diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java index b100303b581..8df3c500758 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java @@ -18,12 +18,22 @@ package org.openapitools.codegen.options; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.AbstractPhpCodegen; import com.google.common.collect.ImmutableMap; import java.util.Map; public class PhpSlimServerOptionsProvider implements OptionsProvider { + public static final String MODEL_PACKAGE_VALUE = "package"; + public static final String API_PACKAGE_VALUE = "apiPackage"; + public static final String VARIABLE_NAMING_CONVENTION_VALUE = "camelCase"; + public static final String INVOKER_PACKAGE_VALUE = "OpenAPIServer"; + public static final String PACKAGE_PATH_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"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -37,7 +47,16 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider { @Override public Map createOptions() { ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) + return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE) + .put(AbstractPhpCodegen.VARIABLE_NAMING_CONVENTION, VARIABLE_NAMING_CONVENTION_VALUE) + .put(AbstractPhpCodegen.PACKAGE_PATH, PACKAGE_PATH_VALUE) + .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) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java index a442d716394..c21aaf3c6f7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java @@ -43,6 +43,24 @@ public class PhpSlimServerOptionsTest extends AbstractOptionsTest { @Override protected void setExpectations() { new Expectations(clientCodegen) {{ + clientCodegen.setModelPackage(PhpSlimServerOptionsProvider.MODEL_PACKAGE_VALUE); + times = 1; + clientCodegen.setApiPackage(PhpSlimServerOptionsProvider.API_PACKAGE_VALUE); + times = 1; + clientCodegen.setParameterNamingConvention(PhpSlimServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); + times = 1; + clientCodegen.setInvokerPackage(PhpSlimServerOptionsProvider.INVOKER_PACKAGE_VALUE); + times = 1; + clientCodegen.setPackagePath(PhpSlimServerOptionsProvider.PACKAGE_PATH_VALUE); + 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)); times = 1; }}; diff --git a/modules/openapi-generator/src/main/resources/slim/.gitignore b/samples/server/petstore-security-test/php-slim/.gitignore similarity index 94% rename from modules/openapi-generator/src/main/resources/slim/.gitignore rename to samples/server/petstore-security-test/php-slim/.gitignore index 9ff0a17ae5c..23a42ca8d8a 100644 --- a/modules/openapi-generator/src/main/resources/slim/.gitignore +++ b/samples/server/petstore-security-test/php-slim/.gitignore @@ -3,4 +3,4 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock \ No newline at end of file +# composer.lock \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/.htaccess b/samples/server/petstore-security-test/php-slim/.htaccess similarity index 100% rename from samples/server/petstore-security-test/slim/.htaccess rename to samples/server/petstore-security-test/php-slim/.htaccess diff --git a/samples/server/petstore-security-test/slim/.openapi-generator-ignore b/samples/server/petstore-security-test/php-slim/.openapi-generator-ignore similarity index 100% rename from samples/server/petstore-security-test/slim/.openapi-generator-ignore rename to samples/server/petstore-security-test/php-slim/.openapi-generator-ignore diff --git a/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION b/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION new file mode 100644 index 00000000000..0628777500b --- /dev/null +++ b/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/README.md b/samples/server/petstore-security-test/php-slim/README.md similarity index 100% rename from samples/server/petstore-security-test/slim/README.md rename to samples/server/petstore-security-test/php-slim/README.md diff --git a/samples/server/petstore-security-test/slim/composer.json b/samples/server/petstore-security-test/php-slim/composer.json similarity index 100% rename from samples/server/petstore-security-test/slim/composer.json rename to samples/server/petstore-security-test/php-slim/composer.json diff --git a/samples/server/petstore-security-test/slim/index.php b/samples/server/petstore-security-test/php-slim/index.php similarity index 100% rename from samples/server/petstore-security-test/slim/index.php rename to samples/server/petstore-security-test/php-slim/index.php diff --git a/samples/server/petstore-security-test/slim/lib/Models/ModelReturn.php b/samples/server/petstore-security-test/php-slim/lib/Models/ModelReturn.php similarity index 100% rename from samples/server/petstore-security-test/slim/lib/Models/ModelReturn.php rename to samples/server/petstore-security-test/php-slim/lib/Models/ModelReturn.php diff --git a/samples/server/petstore-security-test/slim/.openapi-generator/VERSION b/samples/server/petstore-security-test/slim/.openapi-generator/VERSION deleted file mode 100644 index 82602aa4190..00000000000 --- a/samples/server/petstore-security-test/slim/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/LICENSE b/samples/server/petstore-security-test/slim/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/samples/server/petstore-security-test/slim/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/samples/server/petstore-security-test/slim/composer.lock b/samples/server/petstore-security-test/slim/composer.lock deleted file mode 100644 index c31fb841c9b..00000000000 --- a/samples/server/petstore-security-test/slim/composer.lock +++ /dev/null @@ -1,315 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "913417690829da41975a473b88f30f64", - "packages": [ - { - "name": "container-interop/container-interop", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "shasum": "" - }, - "require": { - "psr/container": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14T19:40:03+00:00" - }, - { - "name": "nikic/fast-route", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|~5.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ], - "time": "2018-02-13T20:26:39+00:00" - }, - { - "name": "pimple/pimple", - "version": "v3.2.3", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/container": "^1.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ], - "time": "2018-01-21T07:42:36+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "slim/slim", - "version": "3.10.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/d8aabeacc3688b25e2f2dd2db91df91ec6fdd748", - "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "^1.2", - "nikic/fast-route": "^1.0", - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "psr/container": "^1.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0", - "squizlabs/php_codesniffer": "^2.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - } - ], - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "https://slimframework.com", - "keywords": [ - "api", - "framework", - "micro", - "router" - ], - "time": "2018-04-19T19:29:08+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "RC", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/samples/server/petstore/php-slim/.gitignore b/samples/server/petstore/php-slim/.gitignore index 9ff0a17ae5c..23a42ca8d8a 100644 --- a/samples/server/petstore/php-slim/.gitignore +++ b/samples/server/petstore/php-slim/.gitignore @@ -3,4 +3,4 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock \ No newline at end of file +# composer.lock \ No newline at end of file diff --git a/samples/server/petstore/php-slim/lib/Models/$Special[modelName].php b/samples/server/petstore/php-slim/lib/Models/$Special[modelName].php deleted file mode 100644 index 3a1a686dd11..00000000000 --- a/samples/server/petstore/php-slim/lib/Models/$Special[modelName].php +++ /dev/null @@ -1,13 +0,0 @@ -