I noticed an oddity (possibly a bug?) in PHPStorm today when working with the DOMPDF library. All the PHP classes are named as classname.cls.php – and PHPStorm, which is normally excellent at finding classes, just does not like this, so I was working with an unfamiliar library without any autocomplete features, which is rather akin to being asked to navigate an unfamiliar room while blindfolded. You’ll get there eventually but you might break a few things along the way.

To fix this, I edited the autoloader in autoload.inc.php to look for _cls.php instead, and in dompdf_config.inc.php I changed font.cls.php to font_cls.php. Then I simply renamed all .cls.php files to _cls.php from the command line (Windows):

dir /B > fileList.txt
for /f "tokens=1,2,3 delims=." %%i in (fileList.txt) DO ren "%%i.cls.php" %%i_cls.php

(This is as a batch file – you can replace the double %s with single ones if you’re just typing the commands in.)