friends-of-presta / fop_console

Prestashop Module providing a set of shell/terminal commands for developers (PrestaShop 1.7.5+)
Academic Free License v3.0
84 stars 35 forks source link

improve FOPCommandFormatsValidator / Prepare for phpstan #211

Closed SebSept closed 2 years ago

SebSept commented 2 years ago

I rewrote the class. It was a need while I was implementing the phpstan rule (#97). The basis still the same even if a lot of code has changed. The tests provided were a must to do this refactoring (gg @Kaudaj).

Features :

SebSept commented 2 years ago

Thanks for reviewing. That's right multi words domains are not handled. Your example is relevant. But currently, none exists and I'm used to don't code thing that are not needed. I think it's a better option to code things when they are needed not because we imagine they could exists. Our code must be ready to accept changes, but that's another question.

However, I'll give it a try tonight.

SebSept commented 2 years ago

I'll add some tests and we'll fix what's possible or not..

SebSept commented 2 years ago

Added tests with the current real data. Only one command is not correct (mine 😭 😄 )

Formats : ( domain and action are placeholders )

Words separators :

see ./Resources/commands-realworld.csv and Resources/commands-realworld.csv for examples.