Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4e3e462

Browse filesBrowse files
authored
Fix negative count (#171)
1 parent 10da74a commit 4e3e462
Copy full SHA for 4e3e462

File tree

Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎src/WithChildren.php‎

Copy file name to clipboardExpand all lines: src/WithChildren.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function isMixedShape(): bool
3535
return false;
3636
}
3737

38+
/** @phpstan-assert-if-true non-empty-list<\PhpStubs\WordPress\Core\WordPressArg> $this->children */
3839
public function hasChildren(): bool
3940
{
4041
return count($this->children) > 0;
Collapse file

‎src/WordPressTag.php‎

Copy file name to clipboardExpand all lines: src/WordPressTag.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ public function format(): array
5959
$this->type
6060
);
6161
} else {
62-
if (count($this->children) <= 0 || count($this->children[0]->children) <= 0) {
62+
if (! $this->hasChildren() || ! $this->children[0]->hasChildren()) {
6363
$strings[] = sprintf(
6464
'%s array<int|string, %s>%s',
6565
$this->tag,
6666
$this->type,
6767
$name
6868
);
69+
6970
return $strings;
7071
}
7172

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.