Skip to content

Commit

Permalink
make it compatible for phplower versions
Browse files Browse the repository at this point in the history
  • Loading branch information
WebMamba committed Mar 9, 2024
1 parent d24b20d commit 7ae03bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions extra/html-extra/CVA.php
Expand Up @@ -13,6 +13,11 @@

final class CVA
{
private $base;
private $variants;
private $compoundVariants;
private $defaultVariants;

/**
* @var string|list<string|null>|null
* @var array<string, array<string, string|list<string|null>>|null the array should have the following format [variantCategory => [variantName => classes]]
Expand All @@ -21,11 +26,15 @@ final class CVA
* @var array<string, string>|null
*/
public function __construct(
private string|array|null $base = null,
private ?array $variants = null,
private ?array $compoundVariants = null,
private ?array $defaultVariants = null,
$base = null,
$variants = null,
$compoundVariants = null,
$defaultVariants = null
) {
$this->base = $base;
$this->variants = $variants;
$this->compoundVariants = $compoundVariants;
$this->defaultVariants = $defaultVariants;
}

public function apply(array $recipes, string ...$classes): string
Expand Down
2 changes: 1 addition & 1 deletion extra/html-extra/HtmlExtension.php
Expand Up @@ -131,7 +131,7 @@ public function cva(array $cva): CVA
$cva['base'] ?? null,
$cva['variants'] ?? null,
$cva['compoundVariants'] ?? null,
$cva['defaultVariants'] ?? null,
$cva['defaultVariants'] ?? null
);
}
}

0 comments on commit 7ae03bd

Please sign in to comment.