kadet1090 / KeyLighter

Yet another syntax highlighter for PHP
https://keylighter.kadet.net
MIT License
32 stars 2 forks source link

Switch whole project to use strict type checks #26

Closed Sobak closed 4 years ago

Sobak commented 4 years ago

I decided that if we want to enter the typed PHP world we should do this step by step. Adding declare(strict_types=1) to every single file in multiple (upcoming!) pull requests seemed like wasted effort. Therefore, I think we should do it all at once.

I temporarily kept second commit to show you how little changes were required to make the project running with strictly checked types. Literally two lines changed and one little mistake copy&pasted a couple of times in single test :D

Good job, seriously!

I'm of course scared if the project actually still works. I run all CLI commands one by one, I tested highlightning some random files, I checked phpStorm inspections for every single changed file and I obviously run the test suite. Not sure what else can be done in reasonable time.

Sobak commented 4 years ago

Final note: I was looking for some tool (like phpcs inspection) to enforce strict_types for the future and maybe even add those for us. Problem is, all tools I could find su ...bstantially lacked a couple of things ^^ (like e.g. dignity or error-free code).

Finally I run simple regex-based find&replace on proper files/directories.