fix: noverify --fix

This commit is contained in:
origami11@yandex.ru 2024-06-14 14:12:02 +03:00
parent 5aff28d2b8
commit 117640a755
44 changed files with 174 additions and 174 deletions

View file

@ -96,7 +96,7 @@ class Mail
$file = fopen($filename, "rb");
if (is_resource($file)) {
$data = fread($file, filesize($filename));
$this->attachment [] = ($name) ? array($data, $name) : array($data, basename($filename));
$this->attachment [] = ($name) ? [$data, $name] : [$data, basename($filename)];
}
}
}
@ -113,7 +113,7 @@ class Mail
{
assert(is_string($name));
$this->attachment [] = array($data, $name);
$this->attachment [] = [$data, $name];
}
function quote($var, $val)
@ -125,12 +125,12 @@ class Mail
* Общий формат тегов MIME
* @see http://tools.ietf.org/html/rfc2045
*/
function mimeTag($name, $value, array $args = array())
function mimeTag($name, $value, array $args = [])
{
assert (is_string($name));
assert (is_string($value));
return $name . ": " . $value . implode("", array_map(array($this, 'quote'), array_keys($args), array_values($args))) . PHP_EOL;
return $name . ": " . $value . implode("", array_map([$this, 'quote'], array_keys($args), array_values($args))) . PHP_EOL;
}
/**
@ -148,7 +148,7 @@ class Mail
function getMessage()
{
$message = "--".$this->uniqid . PHP_EOL;
$message .= $this->mimeTag("Content-Type", $this->type, array ('charset' => $this->encoding));
$message .= $this->mimeTag("Content-Type", $this->type, ['charset' => $this->encoding]);
$message .= $this->mimeTag("Content-Transfer-Encoding", "8bit");
$message .= PHP_EOL . $this->content . PHP_EOL . PHP_EOL;
@ -159,9 +159,9 @@ class Mail
foreach ($this->attachment as $value) {
list($data, $name) = $value;
$message .= "--" . $this->uniqid . PHP_EOL;
$message .= $this->mimeTag("Content-Type", "application/octet-stream", array ('name' => basename($name)));
$message .= $this->mimeTag("Content-Type", "application/octet-stream", ['name' => basename($name)]);
$message .= $this->mimeTag("Content-Transfer-Encoding", "base64");
$message .= $this->mimeTag("Content-Disposition", "attachment", array ('filename' => basename($name)));
$message .= $this->mimeTag("Content-Disposition", "attachment", ['filename' => basename($name)]);
$message .= PHP_EOL . chunk_split(base64_encode($data)) . PHP_EOL;
}
@ -180,7 +180,7 @@ class Mail
if (is_string($this->_notify)) {
$head .= $this->mimeTag("Disposition-Notification-To", "\"" . $this->_notify . "\" <" . $this->_from . ">");
}
$head .= $this->mimeTag("Content-Type", "multipart/mixed", array ("boundary" => $this->uniqid));
$head .= $this->mimeTag("Content-Type", "multipart/mixed", ["boundary" => $this->uniqid]);
if ($this->copy) {
$head .= $this->mimeTag("BCC", $this->copy);
}
@ -218,6 +218,6 @@ class Mail
foreach ($this->attachment as $key => &$value) {
unset($this->attachment[$key]);
}
$this->attachment = array();
$this->attachment = [];
}
}