120 Commits

Author SHA1 Message Date
Yuriy Belenko
ca4f718748 [Slim4] Add ModelUtils and StringUtils (#4855)
* [Slim4] Add StringUtils and ModelUtils classes

* [Slim4] Refresh samples
2019-12-22 15:04:30 +08:00
Yuriy Belenko
04ac754d3e [Slim4] Add object support to Data Mocker (#4853)
* [Slim4] Add new method to Mocker interface

* [Slim4] Add tests and implement mockObject method

* [Slim4] Accept items as object in mockArray method

* [Slim4] Add test for array of objects

* [Slim4] Refresh samples

* [Slim4] Remove abandoned debug comment

* [Slim4] Improve tests code coverage
2019-12-22 15:03:22 +08:00
William Cheng
165a9e0508 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-20 20:52:27 +08:00
William Cheng
531dc30917 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-20 20:38:49 +08:00
Yuriy Belenko
c6ec794293 [Slim4] Add PHP syntax checker (#4831) 2019-12-19 11:07:10 +08:00
Yuriy Belenko
0ae1ea68fb [Slim4] Add array support to Data Mocker (#4801)
* [Slim4] Add new method to Mocker interface

* [Slim4] Add tests and implement mockArray method

* [Slim4] Refresh samples

* [Slim4] Extract OAS properties in separated method
2019-12-18 09:59:35 +08:00
Yuriy Belenko
7bd378c026 [Slim4] Data mocker for scalar types (#4751)
* [Slim4] Add OpenApiDataMocker interface template

* [Slim4] Implement scalar types in data mocker

* [Slim4] Cleanup, remove unused variables

I've rejected the idea to keep Composer dependencies in Java/codegen
variables at some point of time. It seems that after Git rebase I forgot
to delete them.

* [Slim4] Refresh samples

* [Slim4] Add pattern option to mockString method

[ref] https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.8

* [Slim4] Add enum option to mockString method

[ref] https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.20

* [Slim4] Refactor mockInteger and mockNumber tests

* [Slim4] Refactor mockString tests

* [Slim4] Use null coalescing operator

* [Slim4] Implement enum option in mockString method

* [Slim4] Add tests for enum option of mockString
2019-12-16 17:32:07 +08:00
William Cheng
466a67c9bc Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-12 17:27:49 +08:00
William Cheng
3e34903042 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-11 15:44:50 +08:00
Yuriy Belenko
41bb41c87c [Slim4] Update templates to comply PSR-12 coding style (#4728)
* [Slim4] Bump PHP_CodeSniffer version to 3.5.*

* [Slim4] Update samples

* [Slim4] Update template to meet PSR-12
2019-12-09 11:20:21 +08:00
William Cheng
11c7007429
Prepare v4.2.3 (#4663)
* update version

* update doc

* update samples
2019-12-02 15:26:01 +08:00
William Cheng
fffe7c8a83 update samples 2019-11-23 00:24:50 +08:00
William Cheng
ac8b96b972 update samples without batch mode 2019-11-21 17:13:30 +08:00
William Cheng
facabd4472 Merge branch '4.3.x' into 5.0.x 2019-11-21 15:19:31 +08:00
William Cheng
60f4de0f22 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-11-20 18:15:22 +08:00
William Cheng
f07b3e0521
Prepare 4.2.2-SNAPSHOT (#4497)
* update to 4.2.2-SNAPSHOT

* update doc

* update samples

* skip ocaml test

* update version

* fix version
2019-11-15 21:34:25 +08:00
William Cheng
4ca9430474 sync master, update doc 2019-11-04 09:38:22 +08:00
William Cheng
4824bb7711 sync master, update samples 2019-11-04 09:28:19 +08:00
William Cheng
47e2c0d027
update samples (#4334) 2019-10-31 13:31:49 +08:00
Yuriy Belenko
8e78b14e28 New PHP Slim4 Server Generator (#3658)
* [Slim4] Copy Slim3 generator as starting point

* [Slim4] Add psr7Implementation generator option

Slim supports PSR-7 interfaces for its Request and Response objects.
Slim provides its own PSR-7 implementation so that it works out of the
box.
However, you are free to replace Slim’s default PSR-7 objects with
a third-party implementation.
[Ref] https://www.slimframework.com/docs/v4/concepts/value-objects.html

* [Slim4] Handle psr7Implementation generator option

It somehow ended up with composerPackages and composerDevPackages
codegen variables and two additional functions. Hope, it's not too much.

* [Slim4] Extend from Slim3 generator

* [Slim4] Bump PHP Slim Framework version to 4.0.0

* [Slim4] Bump required PHP version to 7.1

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Remove app settings

Slim’s App settings used to be a part of the container and  they have
now been decoupled from it.

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Set container argument optional

Slim uses an optional dependency container to prepare, manage,
and inject application dependencies.
Slim supports containers that implement PSR-11
like [PHP-DI](http://php-di.org/doc/frameworks/slim.html).

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Change response body write

You can't write to response instance directly anymore,
need to retrieve body object first.

[Doc](https://www.slimframework.com/docs/v4/objects/response.html#the-response-body)

* [Slim4] Change Slim\App constructor

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Refactor token authentication options

User can provide array or Container as constructor argument from now.
Small refactoring required to retrieve authentication options from
that argument.

* [Slim4] Add PSR-7 implementation codegen flags

This approach seems more flexible to me.
User can customize templates in favor of chosen PSR7 implementation.
It's easier to change Composer packages and their versions.

* [Slim4] Add JsonBodyParserMiddleware

Slim4 doesn't parse JSON body, need to add suggested middleware.
Ref: https://www.slimframework.com/docs/v4/objects/request.html#the-request-body

* [Slim4] Remove request's deprecated methods usage

Since Slim 4.0.0 ServerRequest implementation doesn't have
getQueryParam and getParsedBodyParam methods anymore.

* [Slim4] Use getUploadedFiles for multipart request

isMultipart codegen property is always false so far.
Hope that bug will be fixed soon.

* [Slim4] Add samples
2019-10-21 22:20:12 +08:00