Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix PHP 8.1 return type deprecation notices. #197

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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