Skip to content

Commit

Permalink
Fix 8.1 deprecation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bcordis committed Jan 17, 2025
1 parent 097d733 commit f65f226
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 53 deletions.
2 changes: 1 addition & 1 deletion admin/src/Extension/ProclaimComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function boot(ContainerInterface $container)
* @param string $section The section to get the mapping for
* @param object $item The item
*
* @return string|null The new section
* @return ?string The new section
*
* @throws Exception
* @since 4.0.0
Expand Down
44 changes: 23 additions & 21 deletions admin/src/Model/CwmtemplateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
// phpcs:enable PSR1.Files.SideEffects

use CWM\Component\Proclaim\Administrator\Table\CwmtemplateTable;
use Exception;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Table\Table;

/**
Expand All @@ -38,7 +40,7 @@ class CwmtemplateModel extends AdminModel
*
* @return boolean True on success, False on error.
*
* @throws \Exception
* @throws Exception
* @since 12.2
*/
public function save($data)
Expand Down Expand Up @@ -67,7 +69,7 @@ public function save($data)
*
* @return boolean
*
* @throws \Exception
* @throws Exception
* @since 7.0
*/
public function copy($cid)
Expand All @@ -93,15 +95,15 @@ public function copy($cid)
/**
* Method to change the published state of one or more records.
*
* @param array $pks A list of the primary keys to change.
* @param integer $value The value of the published state.
* @param array $pks A list of the primary keys to change.
* @param int $value The value of the published state.
*
* @return boolean True on success.
* @return bool True on success.
*
* @throws \Exception
* @throws Exception
* @since 12.2
*/
public function publish(&$pks, $value = 1)
public function publish(&$pks, $value = 1): bool
{
foreach ($pks as $i => $pk) {
if ($pk == 1 && $value != 1) {
Expand All @@ -116,15 +118,15 @@ public function publish(&$pks, $value = 1)
/**
* Get the form data
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
* @param array $data Data for the form.
* @param bool $loadData True if the form is to load its own data (default case), false if not.
*
* @return mixed A JForm object on success, false on failure
*
* @throws \Exception
* @throws Exception
* @since 7.0
*/
public function getForm($data = array(), $loadData = true)
public function getForm($data = array(), $loadData = true): mixed
{
// Get the form.
$form = $this->loadForm(
Expand All @@ -139,13 +141,13 @@ public function getForm($data = array(), $loadData = true)
/**
* Method to check out a row for editing.
*
* @param integer $pk The numeric id of the primary key.
* @param int $pk The numeric id of the primary key.
*
* @return integer|null False on failure or error, true otherwise.
* @return ?int False on failure or error, true otherwise.
*
* @since 11.1
*/
public function checkout($pk = null)
public function checkout($pk = null): ?int
{
return $pk;
}
Expand All @@ -159,7 +161,7 @@ public function checkout($pk = null)
*
* @return Table A Table object
*
* @throws \Exception
* @throws Exception
* @since 3.0
*/
public function getTable($name = 'Cwmtemplate', $prefix = '', $options = array()): Table
Expand All @@ -170,12 +172,12 @@ public function getTable($name = 'Cwmtemplate', $prefix = '', $options = array()
/**
* Load Form Date
*
* @return array The default data is an empty array.
* @return array|CMSObject The default data is an empty array.
*
* @throws \Exception
* @throws Exception
* @since 7.0
*/
protected function loadFormData()
protected function loadFormData(): array|CMSObject
{
$data = Factory::getApplication()->getUserState('com_proclaim.edit.template.data', array());

Expand All @@ -189,14 +191,14 @@ protected function loadFormData()
/**
* Custom clean the cache of COM_Proclaim and Proclaim modules
*
* @param string $group The cache group
* @param integer $client_id The ID of the client
* @param string $group The cache group
* @param int $client_id The ID of the client
*
* @return void
*
* @since 1.6
*/
protected function cleanCache($group = null, $client_id = 0)
protected function cleanCache($group = null, $client_id = 0): void
{
parent::cleanCache('com_proclaim');
parent::cleanCache('mod_proclaim');
Expand Down
12 changes: 6 additions & 6 deletions site/src/Helper/Cwmimages.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static function getStudiesImageFolder(): string
/**
* Get Series Thumbnail
*
* @param string|null $image Image file
* @param ?string $image Image file
*
* @return object
* @example {
Expand Down Expand Up @@ -195,8 +195,8 @@ private static function getSeriesImageFolder(): string
/**
* Get Teacher Thumbnail
*
* @param string|null $image1 ?
* @param string|null $image2 ?
* @param ?string $image1 ?
* @param ?string $image2 ?
*
* @return object
* @example {
Expand Down Expand Up @@ -338,9 +338,9 @@ public static function getShowHide(): object
}

/**
* @param string|null $image1
* @param string|null $image2
* @param string $folder
* @param ?string $image1
* @param ?string $image2
* @param string $folder
*
* @return object
*
Expand Down
4 changes: 2 additions & 2 deletions site/src/Helper/Cwmlisting.php
Original file line number Diff line number Diff line change
Expand Up @@ -1848,12 +1848,12 @@ public function getFluidCustom(string $custom, object $item, Registry $params, $
* @param \stdClass $template Template Data
* @param String $type Type of element
*
* @return mixed|null|string
* @return mixed
*
* @throws \Exception
* @since 7.0
*/
public function getElement(string $custom, object $row, Registry $params, $template, string $type)
public function getElement(string $custom, object $row, Registry $params, $template, string $type): mixed
{
$element = null;

Expand Down
6 changes: 3 additions & 3 deletions site/src/Helper/Cwmmedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static function isExternal(string $url): bool
* @param Registry $params Params
* @param CwmtemplateTable|Object $template Template Table
*
* @return string|null
* @return string
*
* @throws Exception
* @since 9.0.0
Expand Down Expand Up @@ -204,7 +204,7 @@ public function getFluidMedia(object $media, Registry $params, $template): ?stri
* @param Registry $params ?
* @param object $media Media Object
*
* @return string|null
* @return ?string
*
* @since 9.0.0
*/
Expand Down Expand Up @@ -955,7 +955,7 @@ public function getFluidDownloadLink(object $media, Registry $params, $template)
*
* @param Registry $download ?
*
* @return string|null
* @return ?string
*
* @since 9.0.0
*/
Expand Down
40 changes: 20 additions & 20 deletions site/src/Helper/CwmrouteHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ abstract class CwmrouteHelper
/**
* Get the sermon route.
*
* @param integer $id The route of the content item.
* @param string|int $language The language code.
* @param string|null $layout The layout value.
* @param integer $id The route of the content item.
* @param int|string $language The language code.
* @param ?string $layout The layout value.
*
* @return string The sermon route.
*
* @since 1.5
*/
public static function getMessageRoute(int $id, $language = '*', string $layout = null): string
public static function getMessageRoute(int $id, int|string $language = '*', ?string $layout = null): string
{
// Create the link
$link = 'index.php?option=com_proclaim&view=cwmsermon&id=' . $id;
Expand All @@ -53,15 +53,15 @@ public static function getMessageRoute(int $id, $language = '*', string $layout
/**
* Get the Series route.
*
* @param integer $seriesid The Series ID.
* @param string|int $language The language code.
* @param string|null $layout The layout value.
* @param integer $seriesid The Series ID.
* @param int|string $language The language code.
* @param ?string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getSeriesRoute(int $seriesid, $language = '*', string $layout = null): string
public static function getSeriesRoute(int $seriesid, int|string $language = '*', ?string $layout = null): string
{
if ($seriesid < 1) {
return '';
Expand All @@ -83,15 +83,15 @@ public static function getSeriesRoute(int $seriesid, $language = '*', string $la
/**
* Get the Series route.
*
* @param integer $seriesid The Series ID.
* @param string|int $language The language code.
* @param string|null $layout The layout value.
* @param integer $seriesid The Series ID.
* @param int|string $language The language code.
* @param ?string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getLocationsRoute(int $seriesid, $language = '*', string $layout = null): string
public static function getLocationsRoute(int $seriesid, int|string $language = '*', ?string $layout = null): string
{
if ($seriesid < 1) {
return '';
Expand All @@ -113,15 +113,15 @@ public static function getLocationsRoute(int $seriesid, $language = '*', string
/**
* Get the Teacher route.
*
* @param int $id ID of the Teacher record
* @param string|int $language The language code.
* @param string|null $layout The layout value.
* @param int $id ID of the Teacher record
* @param int|string $language The language code.
* @param ?string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getTeachersRoute(int $id, $language = '*', string $layout = null): string
public static function getTeachersRoute(int $id, int|string $language = '*', ?string $layout = null): string
{
if ($id < 1) {
return '';
Expand Down Expand Up @@ -157,15 +157,15 @@ public static function getFormRoute(int $id): string
/**
* Get the Teacher route.
*
* @param string $type Type of server offered
* @param string|int $language The language code.
* @param string|null $layout The layout value.
* @param string $type Type of server offered
* @param int|string $language The language code.
* @param ?string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getTypeRoute(string $type, $language = '*', string $layout = null): string
public static function getTypeRoute(string $type, int|string $language = '*', ?string $layout = null): string
{
if (!empty($type)) {
return '';
Expand Down

0 comments on commit f65f226

Please sign in to comment.