More params and returns to PHP 7.3+

This commit is contained in:
djmaze 2020-03-16 13:08:53 +01:00
parent 3d246ae842
commit 26c38b3ec9
95 changed files with 1028 additions and 4865 deletions

View file

@ -40,10 +40,7 @@ class Attachment
$this->Clear();
}
/**
* @return \MailSo\Mail\Attachment
*/
public function Clear()
public function Clear() : self
{
$this->sFolder = '';
$this->iUid = 0;
@ -52,36 +49,22 @@ class Attachment
return $this;
}
/**
* @return string
*/
public function Folder()
public function Folder() : string
{
return $this->sFolder;
}
/**
* @return int
*/
public function Uid()
public function Uid() : int
{
return $this->iUid;
}
/**
* @return string
*/
public function MimeIndex()
public function MimeIndex() : string
{
return $this->oBodyStructure ? $this->oBodyStructure->PartID() : '';
}
/**
* @param bool $bCalculateOnEmpty = false
*
* @return string
*/
public function FileName($bCalculateOnEmpty = false)
public function FileName(bool $bCalculateOnEmpty = false) : string
{
$sFileName = '';
if ($this->oBodyStructure)
@ -108,128 +91,77 @@ class Attachment
return $sFileName;
}
/**
* @return string
*/
public function MimeType()
public function MimeType() : string
{
return $this->oBodyStructure ? $this->oBodyStructure->ContentType() : '';
}
/**
* @return string
*/
public function ContentTransferEncoding()
public function ContentTransferEncoding() : string
{
return $this->oBodyStructure ? $this->oBodyStructure->MailEncodingName() : '';
}
/**
* @return int
*/
public function EncodedSize()
public function EncodedSize() : int
{
return $this->oBodyStructure ? $this->oBodyStructure->Size() : 0;
}
/**
* @return int
*/
public function EstimatedSize()
public function EstimatedSize() : int
{
return $this->oBodyStructure ? $this->oBodyStructure->EstimatedSize() : 0;
}
/**
* @return string
*/
public function Cid()
public function Cid() : string
{
return $this->oBodyStructure ? $this->oBodyStructure->ContentID() : '';
}
/**
* @return string
*/
public function ContentLocation()
public function ContentLocation() : string
{
return $this->oBodyStructure ? $this->oBodyStructure->ContentLocation() : '';
}
/**
* @return bool
*/
public function IsInline()
public function IsInline() : bool
{
return $this->oBodyStructure ? $this->oBodyStructure->IsInline() : false;
}
/**
* @return bool
*/
public function IsImage()
public function IsImage() : bool
{
return $this->oBodyStructure ? $this->oBodyStructure->IsImage() : false;
}
/**
* @return bool
*/
public function IsArchive()
public function IsArchive() : bool
{
return $this->oBodyStructure ? $this->oBodyStructure->IsArchive() : false;
}
/**
* @return bool
*/
public function IsPdf()
public function IsPdf() : bool
{
return $this->oBodyStructure ? $this->oBodyStructure->IsPdf() : false;
}
/**
* @return bool
*/
public function IsDoc()
public function IsDoc() : bool
{
return $this->oBodyStructure ? $this->oBodyStructure->IsDoc() : false;
}
/**
* @return bool
*/
public function IsPgpSignature()
public function IsPgpSignature() : bool
{
return $this->oBodyStructure ? $this->oBodyStructure->IsPgpSignature() : false;
}
/**
* @return \MailSo\Mail\Attachment
*/
public static function NewInstance()
public static function NewInstance() : self
{
return new self();
}
/**
* @param string $sFolder
* @param int $iUid
* @param \MailSo\Imap\BodyStructure $oBodyStructure
* @return \MailSo\Mail\Attachment
*/
public static function NewBodyStructureInstance($sFolder, $iUid, $oBodyStructure)
public static function NewBodyStructureInstance(string $sFolder, int $iUid, \MailSo\Imap\BodyStructure $oBodyStructure) : self
{
return self::NewInstance()->InitByBodyStructure($sFolder, $iUid, $oBodyStructure);
}
/**
* @param string $sFolder
* @param int $iUid
* @param \MailSo\Imap\BodyStructure $oBodyStructure
* @return \MailSo\Mail\Attachment
*/
public function InitByBodyStructure($sFolder, $iUid, $oBodyStructure)
public function InitByBodyStructure(string $sFolder, int $iUid, \MailSo\Imap\BodyStructure $oBodyStructure) : self
{
$this->sFolder = $sFolder;
$this->iUid = $iUid;