Skip to content

Commit

Permalink
Standardize code style and fix formatting issues.
Browse files Browse the repository at this point in the history
Adjusted the spacing around `declare(strict_types=1)` for consistency with the project's coding standards. Also resolved inconsistencies in code indentation and formatting within the `__toString` method and various function declarations.
  • Loading branch information
wolxXx committed Nov 29, 2024
1 parent 9e4c264 commit 587224e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Util/View/MenuItem.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

namespace DoEveryApp\Util\View;

Expand All @@ -19,19 +19,19 @@ class MenuItem

public function __toString()
{
$isActive = true === in_array($this->currentRoutePattern, $this->activeRoutes);
$isActive = true === in_array($this->currentRoutePattern, $this->activeRoutes,);
$class = 'nav-link menu-button';
if (true === $isActive) {
$class .= ' menu-button-active active';
}

return <<<HTML
<li class="nav-item">
<a href="{$this->target}" class="{$class}">
{$this->name}
</a>
</li>
HTML;
<li class="nav-item">
<a href="{$this->target}" class="{$class}">
{$this->name}
</a>
</li>
HTML;
}


Expand All @@ -41,7 +41,7 @@ public function getTarget(): string
}


public function setTarget(string $target): static
public function setTarget(string $target,): static
{
$this->target = $target;

Expand All @@ -55,7 +55,7 @@ public function getName(): string
}


public function setName(string $name): static
public function setName(string $name,): static
{
$this->name = $name;

Expand All @@ -77,26 +77,26 @@ public function clearActiveRoutes(): static
}


public function setActiveRoutes(array $activeRoutes): static
public function setActiveRoutes(array $activeRoutes,): static
{
return $this
->clearActiveRoutes()
->addActiveRoutes($activeRoutes)
->addActiveRoutes($activeRoutes,)
;;
}


public function addActiveRoutes(array $routes): static
public function addActiveRoutes(array $routes,): static
{
foreach ($routes as $route) {
$this->addActiveRoute($route);
$this->addActiveRoute($route,);
}

return $this;
}


public function addActiveRoute(string $route): static
public function addActiveRoute(string $route,): static
{
$this->activeRoutes[] = $route;

Expand All @@ -110,7 +110,7 @@ public function getCurrentRoute(): string
}


public function setCurrentRoute(string $currentRoute): static
public function setCurrentRoute(string $currentRoute,): static
{
$this->currentRoute = $currentRoute;

Expand All @@ -124,7 +124,7 @@ public function getCurrentRoutePattern(): string
}


public function setCurrentRoutePattern(string $currentRoutePattern): static
public function setCurrentRoutePattern(string $currentRoutePattern,): static
{
$this->currentRoutePattern = $currentRoutePattern;

Expand Down

0 comments on commit 587224e

Please sign in to comment.