Skip to content

Commit

Permalink
🔧 (Block.php): remove unnecessary code block related to view renderin…
Browse files Browse the repository at this point in the history
…g to improve code readability and maintainability
  • Loading branch information
marco76tv committed Sep 10, 2024
1 parent 5e7375c commit 4ba3f1b
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions View/Components/Render/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function render(): ViewFactory|View
$module = $block?->module ?? 'UI';
$module_low = Str::lower($module);

<<<<<<< HEAD
/**
* @phpstan-var view-string|null
*/
Expand All @@ -60,24 +59,6 @@ public function render(): ViewFactory|View
];

return view('ui::alert', $view_params);
=======
$views = ['ui::components.blocks.'.$this->tpl];
if (null !== $this->model) {
$module = app(GetModuleNameByModelAction::class)->execute($this->model);
$views[] = strtolower($module).'::components.blocks.'.$this->tpl;
}

/**
* @callable
*/
$callback = static fn (string $view) => view()->exists($view);
/**
* @phpstan-var view-string|null
*/
$view = Arr::first($views, $callback);
if (null === $view) {
throw new \Exception('none of these views exists ['.implode(', '.\chr(13), $views).']');
>>>>>>> 16d7e97 (Lint)
}
$view_params = $this->block['data'] ?? [];

Expand Down

0 comments on commit 4ba3f1b

Please sign in to comment.