SF.net SVN: phpwiki:[11049] trunk/themes

vargenau--- via phpwiki-checkins <[email protected]> Fri, 14 Jul 2023 09:44:40 +0000
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 11049
          http://sourceforge.net/p/phpwiki/code/11049
Author:   vargenau
Date:     2023-07-14 09:44:40 +0000 (Fri, 14 Jul 2023)
Log Message:
-----------
themes: PHP 7: add types for function arguments and return

Modified Paths:
--------------
    trunk/themes/Hawaiian/themeinfo.php
    trunk/themes/Sidebar/themeinfo.php
    trunk/themes/blog/jscalendar/calendar.php
    trunk/themes/blog/themeinfo.php

Modified: trunk/themes/Hawaiian/themeinfo.php
===================================================================
--- trunk/themes/Hawaiian/themeinfo.php	2023-07-14 09:19:32 UTC (rev 11048)
+++ trunk/themes/Hawaiian/themeinfo.php	2023-07-14 09:44:40 UTC (rev 11049)
@@ -38,7 +38,7 @@
 
 class WikiTheme_Hawaiian extends WikiTheme
 {
-    public function getCSS()
+    public function getCSS(): string
     {
         // FIXME: this is a hack which will not be needed once
         //        we have dynamic CSS.

Modified: trunk/themes/Sidebar/themeinfo.php
===================================================================
--- trunk/themes/Sidebar/themeinfo.php	2023-07-14 09:19:32 UTC (rev 11048)
+++ trunk/themes/Sidebar/themeinfo.php	2023-07-14 09:44:40 UTC (rev 11049)
@@ -105,7 +105,7 @@
      *   if (!$WikiTheme->CbUpload($request, $file_dir . $userfile_name))
      *      unlink($file_dir . $userfile_name);
      */
-    public function CbUpload(&$request, $pathname)
+    public function CbUpload(&$request, $pathname): bool
     {
         $cmdline = CLAMDSCAN_PATH . " --nosummary --move=" . CLAMDSCAN_VIRUS;
         $report = `$cmdline "$pathname"`;

Modified: trunk/themes/blog/jscalendar/calendar.php
===================================================================
--- trunk/themes/blog/jscalendar/calendar.php	2023-07-14 09:19:32 UTC (rev 11048)
+++ trunk/themes/blog/jscalendar/calendar.php	2023-07-14 09:44:40 UTC (rev 11049)
@@ -16,11 +16,11 @@
 {
     public $calendar_lib_path;
 
-    public $calendar_file;
-    public $calendar_lang_file;
-    public $calendar_setup_file;
-    public $calendar_theme_file;
-    public $calendar_options;
+    public string $calendar_file;
+    public string $calendar_lang_file;
+    public string $calendar_setup_file;
+    public string $calendar_theme_file;
+    public array $calendar_options;
 
     public function __construct(
         $calendar_lib_path = '/calendar/',
@@ -53,7 +53,7 @@
         echo $this->get_load_files_code();
     }
 
-    public function get_load_files_code()
+    public function get_load_files_code(): string
     {
         $code  = ('<link rel="stylesheet" type="text/css" media="all" href="' .
                    $this->calendar_lib_path . $this->calendar_theme_file .
@@ -70,7 +70,7 @@
         return $code;
     }
 
-    public function _make_calendar($other_options = array())
+    public function _make_calendar($other_options = array()): string
     {
         $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
         $code  = ('<script type="text/javascript">Calendar.setup({' .
@@ -101,21 +101,21 @@
 
     /// PRIVATE SECTION
 
-    public function _field_id($id)
+    public function _field_id($id): string
     {
         return 'f-calendar-field-' . $id;
     }
-    public function _trigger_id($id)
+    public function _trigger_id($id): string
     {
         return 'f-calendar-trigger-' . $id;
     }
-    public function _gen_id()
+    public function _gen_id(): int
     {
         static $id = 0;
         return ++$id;
     }
 
-    public function _make_js_hash($array)
+    public function _make_js_hash($array): string
     {
         $jstr = '';
         reset($array);
@@ -133,7 +133,7 @@
         return $jstr;
     }
 
-    public function _make_html_attr($array)
+    public function _make_html_attr($array): string
     {
         $attrstr = '';
         reset($array);

Modified: trunk/themes/blog/themeinfo.php
===================================================================
--- trunk/themes/blog/themeinfo.php	2023-07-14 09:19:32 UTC (rev 11048)
+++ trunk/themes/blog/themeinfo.php	2023-07-14 09:44:40 UTC (rev 11049)
@@ -86,7 +86,7 @@
             'title' => _("Click to hide/show")));
     }
 
-    protected function _labelForAction($action)
+    protected function _labelForAction($action): string
     {
         switch ($action) {
             case 'edit':

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.