Skip to content

Commit

Permalink
Merge pull request #197 from alexei-bykovski/fix-PHP-8.1-deprecation-…
Browse files Browse the repository at this point in the history
…notices

Fix PHP 8.1 return type deprecation notices.
  • Loading branch information
zbateson authored Sep 1, 2022
2 parents 11e39a5 + e8863de commit 318cd80
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Message/MessagePart.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,27 @@ public function __construct(PartStreamContainer $streamContainer, IMimePart $par
$this->observers = new SplObjectStorage();
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function attach(SplObserver $observer)
{
$this->observers->attach($observer);
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function detach(SplObserver $observer)
{
$this->observers->detach($observer);
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function notify()
{
Expand Down
12 changes: 12 additions & 0 deletions src/Message/PartChildrenContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,27 @@ public function remove(IMessagePart $part)
return null;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->children[$offset]);
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->offsetExists($offset) ? $this->children[$offset] : null;
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
Expand All @@ -158,6 +167,9 @@ public function offsetSet($offset, $value)
}
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Parser/Part/ParserPartStreamContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ public function getStream()
return parent::getStream();
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function update(SplSubject $subject)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Stream/MessagePartStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public function __destruct()
}
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function update(SplSubject $subject)
{
Expand Down

0 comments on commit 318cd80

Please sign in to comment.