Skip to content

Commit 8d1e26f

Browse files
committed
Formatting, empty() check to satisfy PHP_CodeSniffer and PHPStan
1 parent 169fb07 commit 8d1e26f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/MarkupAssertionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private function flattenAttributeArray(array $attributes)
249249

250250
array_walk($attributes, function (&$value, $key) {
251251
// Boolean attributes.
252-
if (null === $value) {
252+
if (empty($value)) {
253253
$value = sprintf('[%s]', $key);
254254
} else {
255255
$value = sprintf('[%s="%s"]', $key, htmlspecialchars($value));

tests/MarkupAssertionsTraitTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public function assertContainsSelector_should_pick_up_multiple_instances(): void
4444
* @testdox assertNotContainsSelector() should verify that the given selector does not exist
4545
* @dataProvider provideSelectorVariants
4646
*/
47-
public function assertNotContainsSelector_should_verify_that_the_given_selector_does_not_exist(string $selector): void
48-
{
47+
public function assertNotContainsSelector_should_verify_that_the_given_selector_does_not_exist(
48+
string $selector
49+
): void {
4950
$this->assertNotContainsSelector(
5051
$selector,
5152
'<h1 id="page-title" class="foo bar">This element has little to do with the link.</h1>'
@@ -270,8 +271,11 @@ public function flattenAttributeArray_should_throw_a_RiskyTestError_if_given_an_
270271
* @testdox getInnerHtmlOfMatchedElements() should retrieve the inner HTML
271272
* @dataProvider provideInnerHtml
272273
*/
273-
public function getInnerHtmlOfMatchedElements_should_retrieve_the_inner_HTML(string $markup, string $selector, string $expected): void
274-
{
274+
public function getInnerHtmlOfMatchedElements_should_retrieve_the_inner_HTML(
275+
string $markup,
276+
string $selector,
277+
string $expected
278+
): void {
275279
$method = new \ReflectionMethod($this, 'getInnerHtmlOfMatchedElements');
276280
$method->setAccessible(true);
277281

0 commit comments

Comments
 (0)