added a comment - - edited
An example of the things fixed since the version in Moodle master:
Undefined variable $file is unlink()ed; see https://github.com/moodle/moodle/blob/master/lib/minify/lib/Minify/Cache/File.php#L41
There's been some amount of fixes on upstream as well: https://github.com/mrclay/minify
Ran into an issue regarding this the other day. When attempting to obtain the exclusive lock in file_put_contents, the cache file is created but left at zero bytes. The second attempt to read the cache file returns the empty file rather than the uncached contents. The fix was merged to upstream.