return false;
} /**
* Verify this is an allowed file for its destination.
*/
private function verifyAllowed(string
$from, string
$to): void
{ // Verify this is an allowed file for its destination
foreach ($this->restrictions
as $directory =>
$pattern) { if (strpos($to,
$directory) === 0 && self::
matchFiles([$to],
$pattern) ===
[]) { throw PublisherException::
forFileNotAllowed($from,
$directory,
$pattern);
} } } /**
* Copies a file with directory creation and identical file awareness.
* Intentionally allows errors.
*
* @throws PublisherException For collisions and restriction violations
*/
private function safeCopyFile(string
$from, string
$to, bool
$replace): void
{