This assumes the $cacheDir ends with a /, while https://github.com/composer/composer/blob/master/src/Composer/Config.php#L144 makes sure it never ends with a /, so I'd move the `. '/'` down to the next line :)