Skip to content

Commit

Permalink
Fix access error in Maintainer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sebobo authored Dec 8, 2022
1 parent 0c5c7e2 commit 7ed381c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Packagist/Api/Result/Package/Maintainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

class Maintainer extends AbstractResult
{
protected string $name;
protected string $name = '';

protected string $email;
protected string $email = '';

protected string $homepage;
protected string $homepage = '';

public function getName(): string
{
Expand Down

0 comments on commit 7ed381c

Please sign in to comment.