protected function isWritable($fileList, $path)
{
$notWritable = [];
if (!file_exists($path)) {
throw new \RuntimeException(sprintf('"%s" not writable', $path));
}
foreach ($fileList as $file) {
$file = $path . '/' . $file;
while (!file_exists($file)) {
$file = dirname($file);
}
if (!is_writable($file)) {
$notWritable[] = $file;
}
}
return $notWritable ?: true;
}