4 Commits

Author SHA1 Message Date
Yuriy Belenko
0e9d6b09be
[php-slim4] Add monolog package as default logger (#12137)
* Add monolog to templates

* Remove default values from DI\get helper

It turned out \DI\get expects only single argument, current method call
doesn't throw any errors but it should be corrected anyway.

* Refresh samples
2022-04-16 16:20:05 +08:00
Yuriy Belenko
cd56a4b1a1
[php-slim4] Add Mock Server (#12044)
* Setup Data Mocker as dev dependency

New 1.2.0 version of the package contains required factory class.

* Refresh samples
2022-04-09 09:43:07 +08:00
Yuriy Belenko
7b59e602ed
[php-slim4] Add lazy CORS implementation (#11941)
* Add lazy CORS implementation

While Slim4 doc applies CORS headers via middleware but their code team
member recommends to use custom response emitter.

Ref: https://github.com/slimphp/Slim/issues/2999#issuecomment-1066839414

* Refresh samples
2022-03-23 16:46:23 +08:00
Yuriy Belenko
aa61220db2
[php-slim4] Add dependency injection container 2 (#11159)
* Change packages order alphabetically

* Add PHP-DI package to Composer template

* Remove ContainerInterface from APIs

User shouldn't access container directly, it's an anti-pattern.

Ref: https://php-di.org/doc/best-practices.html#rules-for-using-a-container-and-dependency-injection

* Change app templates to use PHP-DI

Application looks more like a default Slim skeleton now.

Ref: https://github.com/slimphp/Slim-Skeleton

* Rename SlimRouter to RegisterRoutes

Since it's callable class new name fits better.

* Add short documentation

* Refresh samples
2021-12-29 10:57:19 +08:00