odiseoteam / SyliusReportPlugin

Report Plugin for Sylius. This plugin add a report interface to the Sylius administration. Some reports comes with this bundle but you can create your custom reports.
MIT License
31 stars 10 forks source link

Accept any iterable in Data, not just arrays. Plus code cleanup and PHP dependency bumped to 7.4 #14

Closed rimas-kudelis closed 2 years ago

rimas-kudelis commented 2 years ago
  1. Use property, argument and return typehints everywhere. Typed properties are the reason why the required PHP version has been bumped. But 7.3 only has three months of security support left anyway, so I don't think it's a big deal.
  2. Data class now accepts any iterable as data, not just arrays. ~This is the change that I actually needed. To prevent the process from eating too much RAM, I want to provide an iterable object as data to Data instead of a simple array. I already checked, and the code seems to work well.~ Actually, I just realised that I lied here. I'm still calling setData() with an array argument in my code, and I'm only using the iterable as $rawData within my DataFetcher.
  3. As a result of stricter typing, I fixed some phpspec tests, and removed a couple as well. Sadly, running other tools listed in the testing document seemed to yield too many code style issues in the code that I didn't even touch, so I gave up trying to fix code style as well. And phpunit just exits with No tests executed! (probably because I didn't set up a database), so I couldn't check if any of its tests are failing.
  4. Also as a result of strict typing, a bunch of superfluous PhpDoc annotations have been removed from method and property declarations.
bigboss86 commented 2 years ago

Thanks @rimas-kudelis