Skip to content

Commit 8d0d780

Browse files
authored
fix(view): fix falsy boolean evaluation on comments (#1289)
1 parent a3afdc7 commit 8d0d780

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/view/src/Parser/TempestViewLexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private function lexPhp(): Token
157157
{
158158
$buffer = '';
159159

160-
while ($this->seek(2) !== '?>' && $this->current) {
160+
while ($this->seek(2) !== '?>' && $this->current !== null) {
161161
$buffer .= $this->consume();
162162
}
163163

@@ -177,7 +177,7 @@ private function lexComment(): Token
177177
{
178178
$buffer = '';
179179

180-
while ($this->seek(3) !== '-->' && $this->current) {
180+
while ($this->seek(3) !== '-->' && $this->current !== null) {
181181
$buffer .= $this->consume();
182182
}
183183

tests/Integration/Container/Commands/ContainerShowCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public function test_with_another_container(): void
2323
{
2424
$this->container->singleton(
2525
Container::class,
26-
new class(clone $this->container) implements Container {
26+
new readonly class(clone $this->container) implements Container {
2727
public function __construct(
28-
private readonly Container $container,
28+
private Container $container,
2929
) {}
3030

3131
public function register(string $className, callable $definition): self

0 commit comments

Comments
 (0)