Skip to content

Commit

Permalink
only mark cached components
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed May 10, 2024
1 parent 4ff79e1 commit 1639db9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/CachesValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,13 @@ public function getMarker(array $parameters = [], $close = false): string

public function markValue($value): string
{
if (config('permanent-cache.components.markers.enabled')) {
$value = $this->getMarker().$value.$this->getMarker(close: true);
if (
! config('permanent-cache.components.markers.enabled') ||
is_subclass_of($this, CachedComponent::class)
) {
return (string) $value;
}

return (string) $value;
return $this->getMarker().$value.$this->getMarker(close: true);
}
}

0 comments on commit 1639db9

Please sign in to comment.