if directory is passed, recursively goes through all php files

If you want to apply this to an entire project, file by file is not particularly practical so I made some adjustments