commit14
This commit is contained in:
@@ -16,6 +16,19 @@ final class BudgetOverlay
|
||||
}
|
||||
$source = str_replace($anchor, $anchor."\n if (config('purchasing-operational.enabled') === true) {\n \\Tempo\\Purchasing\\Delivery\\Installation::assertBudgetReady(DB::connection());\n return;\n }", $source);
|
||||
|
||||
return [$path => ['before_sha256' => $before, 'after_sha256' => hash('sha256', $source), 'contents' => $source]];
|
||||
$result = [$path => ['before_sha256' => $before, 'after_sha256' => hash('sha256', $source), 'contents' => $source]];
|
||||
$path = 'app/Modules/Purchasing/BudgetWorkspace.php';
|
||||
$source = file_get_contents($host.'/'.$path);
|
||||
$before = hash('sha256', $source);
|
||||
$anchor = 'public function command(User $user, string $action, array $input, string $key): array'."\n {";
|
||||
$source = str_replace("\r\n", "\n", $source);
|
||||
if (substr_count($source, $anchor) !== 1) {
|
||||
throw new \RuntimeException('Workspace orçamental divergente.');
|
||||
}
|
||||
$source = str_replace($anchor, $anchor."\n if (config('purchasing-operational.enabled') === true) { abort_unless(in_array(\$action, ['create', 'approve'], true), 403, 'Movimentos orçamentais operacionais pertencem ao processo de origem.'); }", $source);
|
||||
$source = str_replace("'synthetic_only' => true", "'synthetic_only' => config('purchasing-operational.enabled') !== true", $source);
|
||||
$result[$path] = ['before_sha256' => $before, 'after_sha256' => hash('sha256', $source), 'contents' => $source];
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user