fileHash($root.'/manifest.json'))) { abort(503, 'Pacote de devolução incompatível.'); } $raw = file_get_contents($root.'/manifest.json'); if ($raw === false) { abort(503, 'Manifesto de devolução indisponível.'); } $manifest = json_decode($raw, true, 512, JSON_THROW_ON_ERROR); foreach (['bootstrap.php', 'src/DeliveryReturnWriter.php'] as $file) { if (! hash_equals($manifest['files'][$file] ?? '', $this->fileHash($root.'/'.$file))) { abort(503, 'Pacote de devolução alterado.'); } } require_once $root.'/bootstrap.php'; return new DeliveryReturnWriter(DB::connection(), 'public', (int) $actor->tenant_id, (int) $actor->id, function () use ($actor) { app(WarehouseReturns::class)->authorize($actor, 'confirm'); }); } }