Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vendeeglobe committed Jun 4, 2022
1 parent 97ee2e8 commit 3ddd9de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/class/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function __construct(&$engine)
// $email_from - place specific address into the 'From:' field
// $charset - send message in specific charset (w/o actual re-encoding)
// $xtra_headers - (array) insert additional mail headers
function send_mail($email_to, $name_to, $subject, $body, $email_from = '', $charset = '', $xtra_headers = [])
function send_mail($email_to, $name_to, $subject, $body, $email_from = '', $charset = '', $xtra_headers = []): void
{
if (!$this->engine->db->enable_email || ( !$email_to || !$subject || !$body) )
{
Expand All @@ -60,7 +60,7 @@ function send_mail($email_to, $name_to, $subject, $body, $email_from = '', $char
$this->php_mailer($email_to, $name_to, $email_from, $name_from, $subject, $body, $charset, $xtra_headers);
}

function php_mailer($email_to, $name_to, $email_from, $name_from, $subject, $body, $charset = '', $xtra_headers = '')
function php_mailer($email_to, $name_to, $email_from, $name_from, $subject, $body, $charset = '', $xtra_headers = ''): bool
{
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

Expand Down
12 changes: 6 additions & 6 deletions src/class/feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ function __construct(&$engine)
$this->charset = $this->engine->get_charset($this->lang);
}

function write_file($name, $body)
function write_file($name, $body): void
{
$file_name = Ut::join_path(XML_DIR, $name . '_' . preg_replace('/[^a-zA-Z\d]/', '', mb_strtolower($this->engine->db->site_name)) . '.xml');
@file_put_contents($file_name, $body);
@chmod($file_name, CHMOD_FILE);
}

function changes()
function changes(): void
{
$limit = 30;
$name = 'changes';
Expand Down Expand Up @@ -102,7 +102,7 @@ function changes()
$this->engine->canonical = false;
}

function feed($feed_cluster = '')
function feed($feed_cluster = ''): void
{
$limit = 10;
$name = 'news';
Expand Down Expand Up @@ -217,7 +217,7 @@ function feed($feed_cluster = '')
$this->engine->canonical = false;
}

function comments()
function comments(): void
{
$limit = 20;
$name = 'comments';
Expand Down Expand Up @@ -296,7 +296,7 @@ function comments()
}

// Sitemaps XML file: http://www.sitemaps.org
function site_map()
function site_map(): void
{
$prefix = $this->engine->db->table_prefix;

Expand Down Expand Up @@ -368,7 +368,7 @@ function site_map()
}

// OpenSearch XML description file
function open_search()
function open_search(): void
{
$this->engine->canonical = true;

Expand Down
2 changes: 1 addition & 1 deletion src/class/wacko.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ function get_user_language()
*
* @return string Message set
*/
function _t($name, $lang = ''): string|array
function _t($name, $lang = '')
{
if ($this->db->multilanguage)
{
Expand Down

0 comments on commit 3ddd9de

Please sign in to comment.