php-school / learn-you-php

🏆 Learn You PHP! - An introduction to PHP's core features: i/o, http, arrays, exceptions and so on.
http://www.phpschool.io/
MIT License
319 stars 36 forks source link

Rewrite exercise to use league/route and symfony/string #106

Closed AydinHassan closed 1 year ago

AydinHassan commented 1 year ago

Hey @mikeymike would appreciate a review here.

Basically all the deps we used in this exercise are not updated and do not work with PHP 8.1. So I had to search for a new routing library library. They are all not very simple, with league/route being the best one I could find. It is still more complicated, requiring you to marshal the request objects and output the responses, so you need to learn about PSR7 as well now and pull in an additional 2 libraries.

symfony/string seemed like a good alternative for stringy but it doesn't support swapping case so I changed that to snake case.

Is the problem file understandable or too complicated?