[php-lumen] Set required PHP version to ^7.2.5 (#6949)

* Set required PHP version to ^7.2.5

* Write .gitignore into srcBasePath

* Update dependencies

* Copy latest Lumen sources to templates

* Add Lumen license template

* Use Lumen license in templates

* Fix typo in readme

* Add Init App Config readme section

* Add composer.lock to root gitignore

* Add Travis-CI task

* Set OAS 3.0 input spec file for samples

* Refresh samples
This commit is contained in:
Yuriy Belenko 2020-08-04 05:33:10 +03:00 committed by GitHub
parent ca3fa4b9cb
commit ba8a50137a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
84 changed files with 626 additions and 267 deletions

3
.gitignore vendored
View File

@ -173,6 +173,9 @@ samples/client/petstore/python-asyncio/.venv/
samples/client/petstore/python-asyncio/.pytest_cache/
samples/client/petstore/python-tornado/.venv/
# PHP
samples/server/petstore/php-lumen/lib/composer.lock
# ts
samples/client/petstore/typescript-angular2/npm/npm-debug.log
samples/client/petstore/typescript-node/npm/npm-debug.log

View File

@ -1,4 +1,4 @@
generatorName: php-lumen
outputDir: samples/server/petstore/php-lumen
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/php-lumen

View File

@ -105,6 +105,18 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
* are available in models, apis, and supporting files
*/
additionalProperties.put("apiVersion", apiVersion);
}
@Override
public void processOpts() {
super.processOpts();
// reset supporting files defined in AbstractPhpCodegen
supportingFiles.clear();
// AbstractPhpCodegen generates .gitignore in output folder
// current build needs .gitignore in a "lib" folder which is srcBasePath
supportingFiles.add(new SupportingFile("gitignore", srcBasePath, ".gitignore"));
/*
* Supporting Files. You can write single files for the generator with the
@ -112,7 +124,11 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
* it will be processed by the template engine. Otherwise, it will be copied
*/
supportingFiles.add(new SupportingFile(".env.example", srcBasePath, ".env.example"));
supportingFiles.add(new SupportingFile("storage_logs_.gitignore", srcBasePath + File.separator + "storage" + File.separator + "logs", ".gitignore"));
supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "logs", ".gitignore"));
supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "app", ".gitignore"));
supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "framework" + File.separator + "views", ".gitignore"));
supportingFiles.add(new SupportingFile("storage_framework_cache_gitignore", srcBasePath + File.separator + "storage" + File.separator + "framework" + File.separator + "cache", ".gitignore"));
supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "framework" + File.separator + "cache" + File.separator + "data", ".gitignore"));
supportingFiles.add(new SupportingFile("artisan", srcBasePath, "artisan"));
supportingFiles.add(new SupportingFile("composer.mustache", srcBasePath, "composer.json"));
supportingFiles.add(new SupportingFile("readme.md", srcBasePath, "readme.md"));
@ -142,6 +158,9 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
supportingFiles.add(new SupportingFile("routes.mustache", srcBasePath + File.separator + "routes", "web.php"));
supportingFiles.add(new SupportingFile("ExampleTest.php", srcBasePath + File.separator + "tests", "ExampleTest.php"));
supportingFiles.add(new SupportingFile("TestCase.php", srcBasePath + File.separator + "tests", "TestCase.php"));
supportingFiles.add(new SupportingFile("editorconfig", srcBasePath, ".editorconfig"));
supportingFiles.add(new SupportingFile("styleci", srcBasePath, ".styleci.yml"));
supportingFiles.add(new SupportingFile("phpunit.xml", srcBasePath, "phpunit.xml"));
}
// override with any special post-processing

View File

@ -1,6 +1,8 @@
APP_NAME=Lumen
APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=UTC
LOG_CHANNEL=stack
@ -14,4 +16,4 @@ DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
QUEUE_DRIVER=sync
QUEUE_CONNECTION=sync

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Providers;
use Illuminate\Support\ServiceProvider;

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Providers;
use App\User;

View File

@ -1,11 +1,6 @@
<?php
/*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
namespace App\Http\Middleware;
use Closure;

View File

@ -1,11 +1,6 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
namespace App\Http\Controllers;
use Laravel\Lumen\Routing\Controller as BaseController;

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Events;
use Illuminate\Queue\SerializesModels;

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Providers;
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
@ -12,8 +13,8 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected $listen = [
'App\Events\ExampleEvent' => [
'App\Listeners\ExampleListener',
\App\Events\ExampleEvent::class => [
\App\Listeners\ExampleListener::class,
],
];
}

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Http\Controllers;
class ExampleController extends Controller

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Events;
class ExampleEvent extends Event

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Jobs;
class ExampleJob extends Job

View File

@ -1,10 +1,11 @@
<?php
{{>licenseInfoLumen}}
namespace App\Listeners;
use App\Events\ExampleEvent;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class ExampleListener
{
@ -21,7 +22,7 @@ class ExampleListener
/**
* Handle the event.
*
* @param ExampleEvent $event
* @param \App\Events\ExampleEvent $event
* @return void
*/
public function handle(ExampleEvent $event)

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
namespace App\Http\Middleware;
use Closure;

View File

@ -1,5 +1,6 @@
<?php
{{>licenseInfoLumen}}
use Laravel\Lumen\Testing\DatabaseMigrations;
use Laravel\Lumen\Testing\DatabaseTransactions;

View File

@ -1,19 +1,14 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
namespace App\Exceptions;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Validation\ValidationException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;
class Handler extends ExceptionHandler
{
@ -34,23 +29,27 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Throwable $exception
* @return void
*
* @throws \Exception
*/
public function report(Exception $e)
public function report(Throwable $exception)
{
parent::report($e);
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
* @param \Throwable $exception
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
* @throws \Throwable
*/
public function render($request, Exception $e)
public function render($request, Throwable $exception)
{
return parent::render($request, $e);
return parent::render($request, $exception);
}
}

View File

@ -1,11 +1,12 @@
<?php
{{>licenseInfoLumen}}
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
abstract class Job implements ShouldQueue
{

View File

@ -1,11 +1,6 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;

View File

@ -1,17 +1,23 @@
<?php
{{>licenseInfoLumen}}
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(App\User::class, function (Faker\Generator $faker) {
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->email,

View File

@ -1,6 +1,9 @@
<?php
abstract class TestCase extends Laravel\Lumen\Testing\TestCase
{{>licenseInfoLumen}}
use Laravel\Lumen\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
/**
* Creates the application.

View File

@ -1,22 +1,15 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
namespace App;
use Illuminate\Auth\Authenticatable;
use Laravel\Lumen\Auth\Authorizable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Model;
use Laravel\Lumen\Auth\Authorizable;
class User extends Model implements
AuthenticatableContract,
AuthorizableContract
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable;

View File

@ -1,18 +1,13 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
require_once __DIR__.'/../vendor/autoload.php';
try {
(new Dotenv\Dotenv(__DIR__.'/../'))->load();
} catch (Dotenv\Exception\InvalidPathException $e) {
//
}
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
dirname(__DIR__)
))->bootstrap();
date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
/*
|--------------------------------------------------------------------------
@ -26,7 +21,7 @@ try {
*/
$app = new Laravel\Lumen\Application(
realpath(__DIR__.'/../')
dirname(__DIR__)
);
// $app->withFacades();
@ -54,6 +49,19 @@ $app->singleton(
App\Console\Kernel::class
);
/*
|--------------------------------------------------------------------------
| Register Config Files
|--------------------------------------------------------------------------
|
| Now we will register the "app" configuration file. If the file exists in
| your configuration directory it will be loaded; otherwise, we'll load
| the default version. You may register other files below as needed.
|
*/
$app->configure('app');
/*
|--------------------------------------------------------------------------
| Register Middleware
@ -66,7 +74,7 @@ $app->singleton(
*/
// $app->middleware([
// App\Http\Middleware\ExampleMiddleware::class
// App\Http\Middleware\ExampleMiddleware::class
// ]);
// $app->routeMiddleware([
@ -105,6 +113,4 @@ $app->router->group([
require __DIR__.'/../routes/web.php';
});
$app->withFacades();
return $app;

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
{{>licenseInfoLumen}}
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

View File

@ -24,29 +24,26 @@
],
"type": "project",
"require": {
"php": ">=7.1.3",
"laravel/lumen-framework": "5.6.*",
"vlucas/phpdotenv": "~2.2"
"php": "^7.2.5",
"laravel/lumen-framework": "^7.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~7.0",
"mockery/mockery": "~1.0"
"fzaninotto/faker": "^1.9",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
"tests/"
]
},
"config": {
@ -55,5 +52,10 @@
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
}
}

View File

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2

View File

@ -1,8 +1,6 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
composer.phar
/vendor/
# 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
/vendor
/.idea
Homestead.json
Homestead.yaml
.env
.phpunit.result.cache

View File

@ -1,11 +1,6 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
{{>licenseInfoLumen}}
/*
|--------------------------------------------------------------------------
| Create The Application

View File

@ -1,7 +1,7 @@
/**
* {{{appName}}}
* {{{appDescription}}}
* PHP version 7.1.3
* PHP version 7.2.5
*
* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}

View File

@ -0,0 +1,3 @@
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/

View File

@ -1,14 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/app.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Application Test Suite">
<directory suffix="Test.php">./tests</directory>
@ -20,9 +14,8 @@
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="E_ALL" />
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="QUEUE_CONNECTION" value="sync"/>
</php>
</phpunit>

View File

@ -1,7 +1,7 @@
# OpenAPITools generated server
## Requirements
* PHP 7.1.3 or newer
* PHP 7.2.5 or newer
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the
@ -18,9 +18,15 @@ This example uses the [Lumen Framework](http://lumen.laravel.com/). To see how
Switch to the generated Lumen server stub directory.
Using `composer update` to install the framework and dependencies via [Composer](http://getcomposer.org/).
### Init App Config
Use `.env.example` as starting point for a new application config:
```console
$ composer run post-root-package-install
```
## Note
The `composer update` should be the first thing to do right after generating Lumen server stub. The autoload.php will be generated only after excuting `composer update`.
The `composer update` should be the first thing to do right after generating Lumen server stub. The autoload.php will be generated only after executing `composer update`.
Or there would be errors during service or model migration.
### Running the generated server stub

View File

@ -1,11 +1,23 @@
<?php
{{>licenseInfo}}
{{>licenseInfoLumen}}
{{#apiInfo}}/**
* {{appName}}
* @version {{appVersion}}
*/
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/', function () use ($router) {
return $router->app->version();
});
@ -19,8 +31,8 @@ $router->get('/', function () use ($router) {
* Notes: {{notes}}
*/
$router->{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', '{{classname}}@{{operationId}}');
{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}

View File

@ -0,0 +1,3 @@
*
!data/
!.gitignore

View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -0,0 +1,6 @@
php:
preset: laravel
disabled:
- unused_use
js: true
css: true

View File

@ -1182,6 +1182,7 @@
<module>samples/server/petstore/python-flask</module>
<module>samples/server/petstore/php-slim4</module>
<module>samples/server/petstore/php-laravel</module>
<module>samples/server/petstore/php-lumen</module>
<module>samples/server/petstore/rust-server</module>
<!-- clients -->
<!--<module>samples/client/petstore/perl</module>

View File

@ -1,8 +0,0 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
composer.phar
/vendor/
# 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

View File

@ -1,5 +1,7 @@
.gitignore
lib/.editorconfig
lib/.env.example
lib/.gitignore
lib/.styleci.yml
lib/app/Console/Commands/.gitkeep
lib/app/Console/Kernel.php
lib/app/Events/Event.php
@ -7,6 +9,7 @@ lib/app/Events/ExampleEvent.php
lib/app/Exceptions/Handler.php
lib/app/Http/Controllers/AnotherFakeApi.php
lib/app/Http/Controllers/Controller.php
lib/app/Http/Controllers/DefaultApi.php
lib/app/Http/Controllers/ExampleController.php
lib/app/Http/Controllers/FakeApi.php
lib/app/Http/Controllers/FakeClassnameTags123Api.php
@ -28,11 +31,16 @@ lib/composer.json
lib/database/factories/ModelFactory.php
lib/database/migrations/.gitkeep
lib/database/seeds/DatabaseSeeder.php
lib/phpunit.xml
lib/public/.htaccess
lib/public/index.php
lib/readme.md
lib/resources/views/.gitkeep
lib/routes/web.php
lib/storage/app/.gitignore
lib/storage/framework/cache/.gitignore
lib/storage/framework/cache/data/.gitignore
lib/storage/framework/views/.gitignore
lib/storage/logs/.gitignore
lib/tests/ExampleTest.php
lib/tests/TestCase.php

View File

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2

View File

@ -1,6 +1,8 @@
APP_NAME=Lumen
APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=UTC
LOG_CHANNEL=stack
@ -14,4 +16,4 @@ DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
QUEUE_DRIVER=sync
QUEUE_CONNECTION=sync

View File

@ -0,0 +1,6 @@
/vendor
/.idea
Homestead.json
Homestead.yaml
.env
.phpunit.result.cache

View File

@ -0,0 +1,6 @@
php:
preset: laravel
disabled:
- unused_use
js: true
css: true

View File

@ -1,9 +1,7 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Console;

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Events;
use Illuminate\Queue\SerializesModels;

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Events;
class ExampleEvent extends Event

View File

@ -1,19 +1,17 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Exceptions;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Validation\ValidationException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;
class Handler extends ExceptionHandler
{
@ -34,23 +32,27 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Throwable $exception
* @return void
*
* @throws \Exception
*/
public function report(Exception $e)
public function report(Throwable $exception)
{
parent::report($e);
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
* @param \Throwable $exception
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
* @throws \Throwable
*/
public function render($request, Exception $e)
public function render($request, Throwable $exception)
{
return parent::render($request, $e);
return parent::render($request, $exception);
}
}

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -43,10 +43,10 @@ class AnotherFakeApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling call123TestSpecialTags');
if (!isset($input['client'])) {
throw new \InvalidArgumentException('Missing the required parameter $client when calling call123TestSpecialTags');
}
$body = $input['body'];
$client = $input['client'];
return response('How about implementing call123TestSpecialTags as a patch method ?');

View File

@ -1,9 +1,7 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Http\Controllers;

View File

@ -3,8 +3,9 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.2.5
*
* OpenAPI spec version: 1.0.0
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Http\Controllers;
class ExampleController extends Controller

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -43,10 +43,10 @@ class FakeApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling testClientModel');
if (!isset($input['client'])) {
throw new \InvalidArgumentException('Missing the required parameter $client when calling testClientModel');
}
$body = $input['body'];
$client = $input['client'];
return response('How about implementing testClientModel as a patch method ?');
@ -54,7 +54,7 @@ class FakeApi extends Controller
/**
* Operation testEndpointParameters
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
*
*
* @return Http response
@ -240,10 +240,10 @@ class FakeApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling testBodyWithFileSchema');
if (!isset($input['file_schema_test_class'])) {
throw new \InvalidArgumentException('Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema');
}
$body = $input['body'];
$file_schema_test_class = $input['file_schema_test_class'];
return response('How about implementing testBodyWithFileSchema as a put method ?');
@ -269,23 +269,23 @@ class FakeApi extends Controller
}
$query = $input['query'];
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling testBodyWithQueryParams');
if (!isset($input['user'])) {
throw new \InvalidArgumentException('Missing the required parameter $user when calling testBodyWithQueryParams');
}
$body = $input['body'];
$user = $input['user'];
return response('How about implementing testBodyWithQueryParams as a put method ?');
}
/**
* Operation createXmlItem
* Operation fakeHealthGet
*
* creates an XmlItem.
* Health check endpoint.
*
*
* @return Http response
*/
public function createXmlItem()
public function fakeHealthGet()
{
$input = Request::all();
@ -293,13 +293,36 @@ class FakeApi extends Controller
//not path params validation
if (!isset($input['xml_item'])) {
throw new \InvalidArgumentException('Missing the required parameter $xml_item when calling createXmlItem');
return response('How about implementing fakeHealthGet as a get method ?');
}
/**
* Operation fakeHttpSignatureTest
*
* test http signature authentication.
*
*
* @return Http response
*/
public function fakeHttpSignatureTest()
{
$input = Request::all();
//path params validation
//not path params validation
if (!isset($input['pet'])) {
throw new \InvalidArgumentException('Missing the required parameter $pet when calling fakeHttpSignatureTest');
}
$xml_item = $input['xml_item'];
$pet = $input['pet'];
$query_1 = $input['query_1'];
$header_1 = $input['header_1'];
return response('How about implementing createXmlItem as a post method ?');
return response('How about implementing fakeHttpSignatureTest as a get method ?');
}
/**
* Operation testInlineAdditionalProperties
@ -317,10 +340,10 @@ class FakeApi extends Controller
//not path params validation
if (!isset($input['param'])) {
throw new \InvalidArgumentException('Missing the required parameter $param when calling testInlineAdditionalProperties');
if (!isset($input['request_body'])) {
throw new \InvalidArgumentException('Missing the required parameter $request_body when calling testInlineAdditionalProperties');
}
$param = $input['param'];
$request_body = $input['request_body'];
return response('How about implementing testInlineAdditionalProperties as a post method ?');
@ -391,7 +414,7 @@ class FakeApi extends Controller
//not path params validation
$body = $input['body'];
$outer_composite = $input['outer_composite'];
return response('How about implementing fakeOuterCompositeSerialize as a post method ?');

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -43,10 +43,10 @@ class FakeClassnameTags123Api extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling testClassname');
if (!isset($input['client'])) {
throw new \InvalidArgumentException('Missing the required parameter $client when calling testClassname');
}
$body = $input['body'];
$client = $input['client'];
return response('How about implementing testClassname as a patch method ?');

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -63,10 +63,10 @@ class PetApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet');
if (!isset($input['pet'])) {
throw new \InvalidArgumentException('Missing the required parameter $pet when calling addPet');
}
$body = $input['body'];
$pet = $input['pet'];
return response('How about implementing addPet as a post method ?');
@ -87,10 +87,10 @@ class PetApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet');
if (!isset($input['pet'])) {
throw new \InvalidArgumentException('Missing the required parameter $pet when calling updatePet');
}
$body = $input['body'];
$pet = $input['pet'];
return response('How about implementing updatePet as a put method ?');

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -62,10 +62,10 @@ class StoreApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder');
if (!isset($input['order'])) {
throw new \InvalidArgumentException('Missing the required parameter $order when calling placeOrder');
}
$body = $input['body'];
$order = $input['order'];
return response('How about implementing placeOrder as a post method ?');

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -43,10 +43,10 @@ class UserApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser');
if (!isset($input['user'])) {
throw new \InvalidArgumentException('Missing the required parameter $user when calling createUser');
}
$body = $input['body'];
$user = $input['user'];
return response('How about implementing createUser as a post method ?');
@ -67,10 +67,10 @@ class UserApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput');
if (!isset($input['user'])) {
throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithArrayInput');
}
$body = $input['body'];
$user = $input['user'];
return response('How about implementing createUsersWithArrayInput as a post method ?');
@ -91,10 +91,10 @@ class UserApi extends Controller
//not path params validation
if (!isset($input['body'])) {
throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput');
if (!isset($input['user'])) {
throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithListInput');
}
$body = $input['body'];
$user = $input['user'];
return response('How about implementing createUsersWithListInput as a post method ?');

View File

@ -1,9 +1,7 @@
<?php
/*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Http\Middleware;

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Http\Middleware;
use Closure;

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Jobs;
class ExampleJob extends Job

View File

@ -1,11 +1,15 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
abstract class Job implements ShouldQueue
{

View File

@ -1,10 +1,14 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Listeners;
use App\Events\ExampleEvent;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class ExampleListener
{
@ -21,7 +25,7 @@ class ExampleListener
/**
* Handle the event.
*
* @param ExampleEvent $event
* @param \App\Events\ExampleEvent $event
* @return void
*/
public function handle(ExampleEvent $event)

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Providers;
use Illuminate\Support\ServiceProvider;

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Providers;
use App\User;

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App\Providers;
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
@ -12,8 +16,8 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected $listen = [
'App\Events\ExampleEvent' => [
'App\Listeners\ExampleListener',
\App\Events\ExampleEvent::class => [
\App\Listeners\ExampleListener::class,
],
];
}

View File

@ -1,22 +1,18 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
namespace App;
use Illuminate\Auth\Authenticatable;
use Laravel\Lumen\Auth\Authorizable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Model;
use Laravel\Lumen\Auth\Authorizable;
class User extends Model implements
AuthenticatableContract,
AuthorizableContract
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable;

View File

@ -1,6 +1,10 @@
#!/usr/bin/env php
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

View File

@ -1,18 +1,16 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
require_once __DIR__.'/../vendor/autoload.php';
try {
(new Dotenv\Dotenv(__DIR__.'/../'))->load();
} catch (Dotenv\Exception\InvalidPathException $e) {
//
}
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
dirname(__DIR__)
))->bootstrap();
date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
/*
|--------------------------------------------------------------------------
@ -26,7 +24,7 @@ try {
*/
$app = new Laravel\Lumen\Application(
realpath(__DIR__.'/../')
dirname(__DIR__)
);
// $app->withFacades();
@ -54,6 +52,19 @@ $app->singleton(
App\Console\Kernel::class
);
/*
|--------------------------------------------------------------------------
| Register Config Files
|--------------------------------------------------------------------------
|
| Now we will register the "app" configuration file. If the file exists in
| your configuration directory it will be loaded; otherwise, we'll load
| the default version. You may register other files below as needed.
|
*/
$app->configure('app');
/*
|--------------------------------------------------------------------------
| Register Middleware
@ -66,7 +77,7 @@ $app->singleton(
*/
// $app->middleware([
// App\Http\Middleware\ExampleMiddleware::class
// App\Http\Middleware\ExampleMiddleware::class
// ]);
// $app->routeMiddleware([
@ -105,6 +116,4 @@ $app->router->group([
require __DIR__.'/../routes/web.php';
});
$app->withFacades();
return $app;

View File

@ -21,29 +21,26 @@
],
"type": "project",
"require": {
"php": ">=7.1.3",
"laravel/lumen-framework": "5.6.*",
"vlucas/phpdotenv": "~2.2"
"php": "^7.2.5",
"laravel/lumen-framework": "^7.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~7.0",
"mockery/mockery": "~1.0"
"fzaninotto/faker": "^1.9",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
"tests/"
]
},
"config": {
@ -52,5 +49,10 @@
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
}
}

View File

@ -1,17 +1,26 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(App\User::class, function (Faker\Generator $faker) {
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->email,

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Application Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
</php>
</phpunit>

View File

@ -1,9 +1,7 @@
<?php
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
/*

View File

@ -1,7 +1,7 @@
# OpenAPITools generated server
## Requirements
* PHP 7.1.3 or newer
* PHP 7.2.5 or newer
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the
@ -18,9 +18,15 @@ This example uses the [Lumen Framework](http://lumen.laravel.com/). To see how
Switch to the generated Lumen server stub directory.
Using `composer update` to install the framework and dependencies via [Composer](http://getcomposer.org/).
### Init App Config
Use `.env.example` as starting point for a new application config:
```console
$ composer run post-root-package-install
```
## Note
The `composer update` should be the first thing to do right after generating Lumen server stub. The autoload.php will be generated only after excuting `composer update`.
The `composer update` should be the first thing to do right after generating Lumen server stub. The autoload.php will be generated only after executing `composer update`.
Or there would be errors during service or model migration.
### Running the generated server stub

View File

@ -3,7 +3,7 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* PHP version 7.1.3
* PHP version 7.2.5
*
* The version of the OpenAPI document: 1.0.0
*
@ -13,11 +13,26 @@
* Do not edit the class manually.
*/
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
/**
* OpenAPI Petstore
* @version 1.0.0
*/
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/', function () use ($router) {
return $router->app->version();
});
@ -28,216 +43,266 @@ $router->get('/', function () use ($router) {
* Notes: To test special tags and operation ID starting with number
*/
$router->patch('/v2/another-fake/dummy', 'AnotherFakeApi@call123TestSpecialTags');
/**
* get fooGet
* Summary:
* Notes:
*/
$router->get('/v2/foo', 'DefaultApi@fooGet');
/**
* patch testClientModel
* Summary: To test \&quot;client\&quot; model
* Notes: To test \&quot;client\&quot; model
*/
$router->patch('/v2/fake', 'FakeApi@testClientModel');
/**
* post testEndpointParameters
* Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*/
$router->post('/v2/fake', 'FakeApi@testEndpointParameters');
/**
* get testEnumParameters
* Summary: To test enum parameters
* Notes: To test enum parameters
*/
$router->get('/v2/fake', 'FakeApi@testEnumParameters');
/**
* delete testGroupParameters
* Summary: Fake endpoint to test group parameters (optional)
* Notes: Fake endpoint to test group parameters (optional)
*/
$router->delete('/v2/fake', 'FakeApi@testGroupParameters');
/**
* put testBodyWithFileSchema
* Summary:
* Notes: For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*/
$router->put('/v2/fake/body-with-file-schema', 'FakeApi@testBodyWithFileSchema');
/**
* put testBodyWithQueryParams
* Summary:
* Notes:
*/
$router->put('/v2/fake/body-with-query-params', 'FakeApi@testBodyWithQueryParams');
/**
* post createXmlItem
* Summary: creates an XmlItem
* Notes: this route creates an XmlItem
* get fakeHealthGet
* Summary: Health check endpoint
* Notes:
*/
$router->post('/v2/fake/create_xml_item', 'FakeApi@createXmlItem');
$router->get('/v2/fake/health', 'FakeApi@fakeHealthGet');
/**
* get fakeHttpSignatureTest
* Summary: test http signature authentication
* Notes:
*/
$router->get('/v2/fake/http-signature-test', 'FakeApi@fakeHttpSignatureTest');
/**
* post testInlineAdditionalProperties
* Summary: test inline additionalProperties
* Notes:
*/
$router->post('/v2/fake/inline-additionalProperties', 'FakeApi@testInlineAdditionalProperties');
/**
* get testJsonFormData
* Summary: test json serialization of form data
* Notes:
*/
$router->get('/v2/fake/jsonFormData', 'FakeApi@testJsonFormData');
/**
* post fakeOuterBooleanSerialize
* Summary:
* Notes: Test serialization of outer boolean types
*/
$router->post('/v2/fake/outer/boolean', 'FakeApi@fakeOuterBooleanSerialize');
/**
* post fakeOuterCompositeSerialize
* Summary:
* Notes: Test serialization of object with outer number type
*/
$router->post('/v2/fake/outer/composite', 'FakeApi@fakeOuterCompositeSerialize');
/**
* post fakeOuterNumberSerialize
* Summary:
* Notes: Test serialization of outer number types
*/
$router->post('/v2/fake/outer/number', 'FakeApi@fakeOuterNumberSerialize');
/**
* post fakeOuterStringSerialize
* Summary:
* Notes: Test serialization of outer string types
*/
$router->post('/v2/fake/outer/string', 'FakeApi@fakeOuterStringSerialize');
/**
* put testQueryParameterCollectionFormat
* Summary:
* Notes: To test the collection format in query parameters
*/
$router->put('/v2/fake/test-query-paramters', 'FakeApi@testQueryParameterCollectionFormat');
/**
* patch testClassname
* Summary: To test class name in snake case
* Notes: To test class name in snake case
*/
$router->patch('/v2/fake_classname_test', 'FakeClassnameTags123Api@testClassname');
/**
* post uploadFileWithRequiredFile
* Summary: uploads an image (required)
* Notes:
*/
$router->post('/v2/fake/{petId}/uploadImageWithRequiredFile', 'PetApi@uploadFileWithRequiredFile');
/**
* post addPet
* Summary: Add a new pet to the store
* Notes:
*/
$router->post('/v2/pet', 'PetApi@addPet');
/**
* put updatePet
* Summary: Update an existing pet
* Notes:
*/
$router->put('/v2/pet', 'PetApi@updatePet');
/**
* get findPetsByStatus
* Summary: Finds Pets by status
* Notes: Multiple status values can be provided with comma separated strings
*/
$router->get('/v2/pet/findByStatus', 'PetApi@findPetsByStatus');
/**
* get findPetsByTags
* Summary: Finds Pets by tags
* Notes: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*/
$router->get('/v2/pet/findByTags', 'PetApi@findPetsByTags');
/**
* delete deletePet
* Summary: Deletes a pet
* Notes:
*/
$router->delete('/v2/pet/{petId}', 'PetApi@deletePet');
/**
* get getPetById
* Summary: Find pet by ID
* Notes: Returns a single pet
*/
$router->get('/v2/pet/{petId}', 'PetApi@getPetById');
/**
* post updatePetWithForm
* Summary: Updates a pet in the store with form data
* Notes:
*/
$router->post('/v2/pet/{petId}', 'PetApi@updatePetWithForm');
/**
* post uploadFile
* Summary: uploads an image
* Notes:
*/
$router->post('/v2/pet/{petId}/uploadImage', 'PetApi@uploadFile');
/**
* get getInventory
* Summary: Returns pet inventories by status
* Notes: Returns a map of status codes to quantities
*/
$router->get('/v2/store/inventory', 'StoreApi@getInventory');
/**
* post placeOrder
* Summary: Place an order for a pet
* Notes:
*/
$router->post('/v2/store/order', 'StoreApi@placeOrder');
/**
* delete deleteOrder
* Summary: Delete purchase order by ID
* Notes: For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*/
$router->delete('/v2/store/order/{order_id}', 'StoreApi@deleteOrder');
/**
* get getOrderById
* Summary: Find purchase order by ID
* Notes: For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*/
$router->get('/v2/store/order/{order_id}', 'StoreApi@getOrderById');
/**
* post createUser
* Summary: Create user
* Notes: This can only be done by the logged in user.
*/
$router->post('/v2/user', 'UserApi@createUser');
/**
* post createUsersWithArrayInput
* Summary: Creates list of users with given input array
* Notes:
*/
$router->post('/v2/user/createWithArray', 'UserApi@createUsersWithArrayInput');
/**
* post createUsersWithListInput
* Summary: Creates list of users with given input array
* Notes:
*/
$router->post('/v2/user/createWithList', 'UserApi@createUsersWithListInput');
/**
* get loginUser
* Summary: Logs user into the system
* Notes:
*/
$router->get('/v2/user/login', 'UserApi@loginUser');
/**
* get logoutUser
* Summary: Logs out current logged in user session
* Notes:
*/
$router->get('/v2/user/logout', 'UserApi@logoutUser');
/**
* delete deleteUser
* Summary: Delete user
* Notes: This can only be done by the logged in user.
*/
$router->delete('/v2/user/{username}', 'UserApi@deleteUser');
/**
* get getUserByName
* Summary: Get user by user name
* Notes:
*/
$router->get('/v2/user/{username}', 'UserApi@getUserByName');
/**
* put updateUser
* Summary: Updated user

View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -0,0 +1,3 @@
*
!data/
!.gitignore

View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,2 +1,2 @@
*
!.gitignore
!.gitignore

View File

@ -1,5 +1,9 @@
<?php
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
use Laravel\Lumen\Testing\DatabaseMigrations;
use Laravel\Lumen\Testing\DatabaseTransactions;

View File

@ -1,6 +1,12 @@
<?php
abstract class TestCase extends Laravel\Lumen\Testing\TestCase
/**
* The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
*/
use Laravel\Lumen\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
/**
* Creates the application.

View File

@ -0,0 +1,74 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>LumenPetstoreServerTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Lumen Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>bundle-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>composer</executable>
<arguments>
<argument>install</argument>
<argument>--working-dir=lib</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>bundle-copy-config</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cp</executable>
<arguments>
<argument>lib/.env.example</argument>
<argument>lib/.env</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>bundle-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>lib/vendor/bin/phpunit</executable>
<arguments>
<argument>--configuration=lib/phpunit.xml</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>