[TOOLS] Raise PHPStan level to 5 and fix associated error, fixing some bugs in the process

This commit is contained in:
2022-10-19 22:38:49 +01:00
parent edeee49af9
commit fed2242a56
16 changed files with 139 additions and 108 deletions

View File

@@ -41,7 +41,7 @@ class HTMLTest extends WebTestCase
static::assertSame('<a><p>foo</p><br></a>', HTML::html(['a' => ['p' => 'foo', 'br' => 'empty']]));
static::assertSame("<div>\n <a><p>foo</p><br></a>\n</div>", HTML::html(['div' => ['a' => ['p' => 'foo', 'br' => 'empty']]]));
static::assertSame('<div><a><p>foo</p><br></a></div>', HTML::html(['div' => ['a' => ['p' => 'foo', 'br' => 'empty']]], options: ['indent' => false]));
static::assertThrows(TypeError::class, fn () => HTML::html(1));
static::assertThrows(TypeError::class, fn () => HTML::html(1)); // @phpstan-ignore-line
static::assertSame('<a href="test">foo</a>', HTML::tag('a', ['href' => 'test'], content: 'foo', options: ['empty' => false]));
static::assertSame('<br>', HTML::tag('br', attrs: null, content: null, options: ['empty' => true]));
}