Solve PHP 8.1 issues:

* Implicit conversion from float to int loses precision
* JsonSerializable::jsonSerialize(): mixed
This commit is contained in:
the-djmaze 2022-05-02 00:02:24 +02:00
parent d997a2b679
commit e601604362
19 changed files with 19 additions and 3 deletions

View file

@ -74,6 +74,7 @@ abstract class Collection extends \ArrayObject implements \JsonSerializable
return $this;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$aNames = \explode('\\', \get_class($this));

View file

@ -40,6 +40,7 @@ class ACL implements \JsonSerializable
return \in_array($right, $this->rights);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->rights;

View file

@ -163,6 +163,7 @@ class Attachment implements \JsonSerializable
return $this;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -201,6 +201,7 @@ class Folder implements \JsonSerializable
return $this->oImapFolder->GetMetadata($sName);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
/*

View file

@ -625,6 +625,7 @@ class Message implements \JsonSerializable
return $oMessage;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -88,6 +88,7 @@ class MessageCollection extends \MailSo\Base\Collection
throw new \BadMethodCallException('disallowed');
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array_merge(parent::jsonSerialize(), array(

View file

@ -254,6 +254,7 @@ class Email implements \JsonSerializable
return \trim($sReturn);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -55,6 +55,7 @@ abstract class AbstractConfig implements \JsonSerializable
return \is_array($this->aData) && \count($this->aData);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->aData;

View file

@ -130,6 +130,7 @@ abstract class Account implements \JsonSerializable
$this->sProxyAuthPassword = $sProxyAuthPassword;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -400,6 +400,7 @@ class Domain implements \JsonSerializable
);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -161,6 +161,7 @@ class Identity implements \JsonSerializable
);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -151,6 +151,7 @@ class Property implements \JsonSerializable
return $this->sPlaceholder;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -15,6 +15,7 @@ class PropertyCollection extends \ArrayObject implements \JsonSerializable
$this->sLabel = $sLabel;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -588,6 +588,7 @@ class Contact implements \JsonSerializable
return true;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$properties = array();

View file

@ -146,6 +146,7 @@ class Property implements \JsonSerializable
}
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
// Simple hack

View file

@ -31,6 +31,7 @@ class Tag implements \JsonSerializable
$this->ReadOnly = false;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -204,6 +204,7 @@ class Filter implements \JsonSerializable
return !empty($this->aConditions);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -74,6 +74,7 @@ class FilterCondition implements \JsonSerializable
return $aResult;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return array(

View file

@ -654,10 +654,8 @@ abstract class QRUtil {
}
}
}
$ratio = \abs(100 * $darkCount / $moduleCount / $moduleCount - 50) / 5;
$lostPoint += $ratio * 10;
return $lostPoint;
return $lostPoint + \intval(\abs(100 * $darkCount / $moduleCount / $moduleCount - 50) * 10 / 5);
}
static function getBCHTypeInfo($data)