Skip to content

Commit

Permalink
enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
devajmeireles committed Sep 18, 2024
1 parent 46601e8 commit 51da5d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Response/PreventInjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function forEnvironments(): bool
*/
private function forMobile(): bool
{
if (config('envbar.on_mobile')) {
if (config('envbar.on_mobile') === true) {
return false;
}

Expand Down
1 change: 0 additions & 1 deletion src/Response/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public static function js(): Htmlable
public function component(): View
{
return view('envbar::components.envbar', [
'id' => uniqid(),
'show' => Cache::pull('envbar::show'),
...app(EnvBarComponentCompiler::class)(),
]);
Expand Down
4 changes: 4 additions & 0 deletions src/Response/ResponseHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public function __invoke(): Response
{
$content = $this->response->getContent();

if ($content === false) {
return $this->response;
}

if (($head = strpos($content, '<head>')) !== false) {
$content = substr_replace($content, $this->render->css(), $head + 6, 0); // @phpstan-ignore-line
$content = substr_replace($content, $this->render->js(), $head + 6, 0); // @phpstan-ignore-line
Expand Down
3 changes: 0 additions & 3 deletions src/View/Components/BaseComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

abstract class BaseComponent extends Component
{
/** Runtime configurations obtained from the EnvBar component. */
public array $configuration = [];

abstract public function blade(): View;

public function render(): Closure
Expand Down

0 comments on commit 51da5d7

Please sign in to comment.