Skip to content

Commit 7ed381c

Browse files
author
Sebastian Helzle
authored
Fix access error in Maintainer
Since PHP 8.x I get the error `"$field must not be accessed before initialization"` when iterating the maintainers and accessing their properties. Not all 3 fields are always set.
1 parent 0c5c7e2 commit 7ed381c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Packagist/Api/Result/Package/Maintainer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
class Maintainer extends AbstractResult
1010
{
11-
protected string $name;
11+
protected string $name = '';
1212

13-
protected string $email;
13+
protected string $email = '';
1414

15-
protected string $homepage;
15+
protected string $homepage = '';
1616

1717
public function getName(): string
1818
{

0 commit comments

Comments
 (0)