Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Sep 16, 2022
1 parent efa0666 commit 98ad003
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 11 deletions.
7 changes: 4 additions & 3 deletions composer.json
Expand Up @@ -27,9 +27,10 @@
}
],
"require": {
"php": ">=8.1",
"ext-json": "*",
"myclabs/deep-copy": "^1.9"
"php": ">=8.1",
"myclabs/deep-copy": "^1.9",
"spiral/core": "^3.0.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5.20",
Expand All @@ -51,7 +52,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
"dev-master": "3.0.x-dev"
}
},
"config": {
Expand Down
3 changes: 0 additions & 3 deletions src/Compiler/Renderer/HTMLRenderer.php
Expand Up @@ -31,9 +31,6 @@ public function render(Compiler $compiler, Compiler\Result $result, NodeInterfac
}
}

/**
* @psalm-suppress UndefinedClass
*/
private function tag(Compiler $compiler, Compiler\Result $result, Tag $node): void
{
$result->push(\sprintf('<%s', $node->name), $node->getContext());
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Block.php
Expand Up @@ -19,7 +19,7 @@ final class Block implements NodeInterface, AttributedInterface
use ContextTrait;
use AttributeTrait;

/** @var TNode[] */
/** @var list<TNode> */
public array $nodes = [];

public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/Node/HTML/Tag.php
Expand Up @@ -30,7 +30,7 @@ final class Tag implements NodeInterface, AttributedInterface
public array $attrs = [];

/**
* @var TNode[]
* @var list<TNode>
*/
public array $nodes = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Node/Template.php
Expand Up @@ -20,7 +20,7 @@ final class Template implements NodeInterface, AttributedInterface
use ContextTrait;

/**
* @param TNode[] $nodes
* @param list<TNode> $nodes
*/
public function __construct(
public array $nodes = []
Expand Down
4 changes: 2 additions & 2 deletions src/Transform/Import/Bundle.php
Expand Up @@ -20,8 +20,8 @@ final class Bundle implements ImportInterface
private ?Template $template = null;

public function __construct(
private readonly string $path,
private readonly ?string $prefix = null,
private string $path,
private ?string $prefix = null,
Context $context = null
) {
$this->context = $context;
Expand Down
23 changes: 23 additions & 0 deletions tests/Transform/MergerTest.php
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

namespace Spiral\Tests\Stempler\Transform;

use PHPUnit\Framework\TestCase;
use Spiral\Stempler\Node\HTML\Tag;
use Spiral\Stempler\Node\Template;
use Spiral\Stempler\Transform\Import\Bundle;
use Spiral\Stempler\Transform\Merger;

final class MergerTest extends TestCase
{
public function testMergeWithBundle(): void
{
$merger = new Merger();

$template = $merger->merge(new Template([new Bundle('/')]), new Tag());

$this->assertCount(1, $template->nodes);
}
}

0 comments on commit 98ad003

Please sign in to comment.