kevinkhill / php-duration

Convert durations of time between colon-formatted, human-readable, and seconds
MIT License
158 stars 26 forks source link

Use phpstan to improve code quality #16

Closed robertfausk closed 3 years ago

robertfausk commented 5 years ago

see: https://github.com/phpstan/phpstan

e.g. new Duration() expects null via type hint which throws phpstan violations in projects using:

$duration = new Duration(60);

when these projects use phpstan. At least in latest stable version ;) In master it is fixed.

e.g. 2: $housPerDay in constructor doesn't have a type hint.

kevinkhill commented 5 years ago

I've wanted to play with phpstan/psalm/phan but don't seem to ever have the time. If you want to integrate it into the project and add composer scripts to run it, I would happily accept a pull request.

kevinkhill commented 3 years ago

Thanks @AntonLazarev!