Add type hinting and PHPDoc blocks to ScriptHandler