gothinkster / slim-php-realworld-example-app

Exemplary real world application built with Slim
https://realworld.io
427 stars 96 forks source link

#17 upgrade to slim 4 #18

Open gustavofabiane opened 4 years ago

gustavofabiane commented 4 years ago

17 Update the application to Slim 4.

Note: I'm opening the PR as draft and will update the readme.md and docs/ soon.

Tests suites are OK, also tested with React + Redux Front End. Postman collection API Test is running with errors for date format [Article's "createdAt" property is an ISO 8601 timestamp] and also fails in register tests because response attributes doesn't match.

Also found an issue on article list that the articlesCount were resulting an empty set if the OFFSET clause exists in the query builder so I've adjusted it to count the articles before addins the offset clause.

Fixed validation of timestamps in model transformers which were using undefined variable $user

New dependencies:

alhoqbani commented 4 years ago

Thanks @gustavofabiane for your contribution and the great work, and apologies for my delay :(

I run the test suits and run the app with vue frontend, everything works fine. Unfortunately, I cannot do a full review of your code. It's been a while since I worked on Slim framework.

It would be great if @EricSimons could assign the repo to someone else from the slim community or perhaps @gustavofabiane can take over.

gustavofabiane commented 4 years ago

Hello, I just upgraded the readme.md with the changes that affected some application core, since Slim 4 are decoupled from another libraries (besides FastRoute), the main changes affected the way middleware, settings, routes and dependencies are declared.

PHP-DI also uses autowire so the Container don't need to be injected in controllers. BaseController now has a constructor that resolves the application dependencies, as the project is an example we can keep it simple.

@alhoqbani There still points where we can do some improvements. I don't have much time either but I can contribute whenever I can.