is_string($value) && realpath($value) !== false ? str_replace('\\', '/', realpath($value)) : null; if (! app()->environment('testing') || DB::connection()->getConfig('host') !== '127.0.0.1' || DB::connection()->getConfig('port') !== '55439' || ! preg_match('/^compras_receipts_test_[a-f0-9]{12}$/D', DB::connection()->getDatabaseName()) || $normal($source) !== $normal($root.'/general-ledger') || $normal(config('common-finance-bundle.root')) !== $normal($root) || config('common-finance-bundle.manifest_sha256') !== $pin || $normal(config('general-ledger.path')) !== $normal($source)) { throw new LogicException('Only the pinned independently verified private ledger runtime is allowed.'); } // AppServiceProvider already verified the pinned loader before loading Bundle or Payables. Bundle::verify($root, $pin); require_once $source.'/bootstrap.php'; foreach ([LedgerSchema::class => $root.'/general-ledger', BudgetControl::class => base_path('storage/framework/testing/requisition-cycles-qa-35701ec1614f871e/budget-control'), PayablesSchema::class => $root.'/payables'] as $class => $boundary) { $file = (new ReflectionClass($class))->getFileName(); if (! is_string($file) || ! str_starts_with($normal($file) ?? '', ($normal($boundary) ?? 'unavailable').'/')) { throw new LogicException('A financial class escaped the pinned private composition.'); } } return $source; }