mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 06:57:03 +03:00
Bugfixes and more conversions to PHP 7
This commit is contained in:
parent
2cada68f41
commit
3a7ec4ecb0
100 changed files with 238 additions and 992 deletions
|
|
@ -33,9 +33,8 @@ abstract class Collection
|
|||
/**
|
||||
* @param mixed $mItem
|
||||
* @param bool $bToTop = false
|
||||
* @return self
|
||||
*/
|
||||
public function Add($mItem, $bToTop = false)
|
||||
public function Add($mItem, $bToTop = false) : self
|
||||
{
|
||||
if ($bToTop)
|
||||
{
|
||||
|
|
@ -51,11 +50,9 @@ abstract class Collection
|
|||
|
||||
/**
|
||||
* @param array $aItems
|
||||
* @return self
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function AddArray($aItems)
|
||||
public function AddArray($aItems) : self
|
||||
{
|
||||
if (!\is_array($aItems))
|
||||
{
|
||||
|
|
@ -70,14 +67,9 @@ abstract class Collection
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public function Clear()
|
||||
public function Clear() : void
|
||||
{
|
||||
$this->aItems = array();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -88,10 +80,7 @@ abstract class Collection
|
|||
return $this->aItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function Count()
|
||||
public function Count() : int
|
||||
{
|
||||
return \count($this->aItems);
|
||||
}
|
||||
|
|
@ -144,9 +133,8 @@ abstract class Collection
|
|||
|
||||
/**
|
||||
* @param mixed $mCallback
|
||||
* @return void
|
||||
*/
|
||||
public function ForeachList($mCallback)
|
||||
public function ForeachList($mCallback) : void
|
||||
{
|
||||
if (\is_callable($mCallback))
|
||||
{
|
||||
|
|
@ -174,8 +162,6 @@ abstract class Collection
|
|||
|
||||
/**
|
||||
* @param array $aItems
|
||||
* @return self
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function SetAsArray($aItems)
|
||||
|
|
@ -186,7 +172,5 @@ abstract class Collection
|
|||
}
|
||||
|
||||
$this->aItems = $aItems;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,7 @@ namespace MailSo\Base\Exceptions;
|
|||
*/
|
||||
class Exception extends \Exception
|
||||
{
|
||||
/**
|
||||
* @param string $sMessage
|
||||
* @param int $iCode
|
||||
* @param \Exception|null $oPrevious
|
||||
*/
|
||||
public function __construct($sMessage = '', $iCode = 0, $oPrevious = null)
|
||||
public function __construct(string $sMessage = '', int $iCode = 0, \Throwable $oPrevious = null)
|
||||
{
|
||||
$sMessage = 0 === strlen($sMessage) ? str_replace('\\', '-', get_class($this)).' ('.
|
||||
basename($this->getFile()).' ~ '.$this->getLine().')' : $sMessage;
|
||||
|
|
|
|||
|
|
@ -744,10 +744,8 @@ class Http
|
|||
|
||||
/**
|
||||
* @param int $iStatus
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function StatusHeader($iStatus, $sCustomStatusText = '')
|
||||
public function StatusHeader($iStatus, $sCustomStatusText = '') : void
|
||||
{
|
||||
$iStatus = (int) $iStatus;
|
||||
if (99 < $iStatus)
|
||||
|
|
|
|||
|
|
@ -44,10 +44,8 @@ class Loader
|
|||
|
||||
/**
|
||||
* @staticvar bool $bIsInited
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function Init()
|
||||
public static function Init() : void
|
||||
{
|
||||
static $bIsInited = false;
|
||||
if (!$bIsInited)
|
||||
|
|
@ -64,10 +62,8 @@ class Loader
|
|||
/**
|
||||
* @param string $sName
|
||||
* @param int $iIncSize = 1
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function IncStatistic($sName, $iIncSize = 1)
|
||||
public static function IncStatistic($sName, $iIncSize = 1) : void
|
||||
{
|
||||
if (self::$StoreStatistic)
|
||||
{
|
||||
|
|
@ -79,10 +75,8 @@ class Loader
|
|||
/**
|
||||
* @param string $sName
|
||||
* @param mixed $mValue
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function SetStatistic($sName, $mValue)
|
||||
public static function SetStatistic($sName, $mValue) : void
|
||||
{
|
||||
if (self::$StoreStatistic)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,10 +31,8 @@ class ResourceRegistry
|
|||
|
||||
/**
|
||||
* @staticvar bool $bInited
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function regResourcesShutdownFunc()
|
||||
private static function regResourcesShutdownFunc() : void
|
||||
{
|
||||
static $bInited = false;
|
||||
if (!$bInited)
|
||||
|
|
@ -98,10 +96,8 @@ class ResourceRegistry
|
|||
|
||||
/**
|
||||
* @param resource $rResource
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function CloseMemoryResource(&$rResource)
|
||||
public static function CloseMemoryResource(&$rResource) : void
|
||||
{
|
||||
if (\is_resource($rResource))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue