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

@ -23,12 +23,6 @@ class File extends \MailSo\Log\Driver
*/
private $sLoggerFileName;
/**
* @access protected
*
* @param string $sLoggerFileName
* @param string $sNewLine = "\r\n"
*/
protected function __construct($sLoggerFileName, $sNewLine = "\r\n")
{
parent::__construct();
@ -37,49 +31,27 @@ class File extends \MailSo\Log\Driver
$this->sNewLine = $sNewLine;
}
/**
* @param string $sLoggerFileName
*/
public function SetLoggerFileName($sLoggerFileName)
public function SetLoggerFileName(string $sLoggerFileName)
{
$this->sLoggerFileName = $sLoggerFileName;
}
/**
* @param string $sLoggerFileName
* @param string $sNewLine = "\r\n"
*
* @return \MailSo\Log\Drivers\File
*/
public static function NewInstance($sLoggerFileName, $sNewLine = "\r\n")
public static function NewInstance(string $sLoggerFileName, string $sNewLine = "\r\n") : \MailSo\Log\Drivers\File
{
return new self($sLoggerFileName, $sNewLine);
}
/**
* @param string|array $mDesc
*
* @return bool
*/
protected function writeImplementation($mDesc)
protected function writeImplementation($mDesc) : bool
{
return $this->writeToLogFile($mDesc);
}
/**
* @return bool
*/
protected function clearImplementation()
protected function clearImplementation() : bool
{
return \unlink($this->sLoggerFileName);
}
/**
* @param string|array $mDesc
*
* @return bool
*/
private function writeToLogFile($mDesc)
private function writeToLogFile($mDesc) : bool
{
if (\is_array($mDesc))
{