Agreed. Adding type annotations is already a huge refactor in itself though and pretty risky with PHP. Once you have that done life will be much easier.
function foo(string $bar) { ... }
foo(1234) // kaboom?<?php //Enter your code here, enjoy!
function foo(string $bar) { return $bar . $bar; }
echo foo(1234);
To get the true benefits of typing you should also run a static type analyzer.