summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2026-04-16 12:00:51 +0100
committerlsces <lester@lsces.co.uk>2026-04-16 12:00:51 +0100
commitb4b0a0e8bbf28b4508c23a5263feda1f9fe5d12f (patch)
tree0d234c8c8ff8aee63a54beb94c87f0e06089ef5a /includes
parent9a7d792185757ee2af3101742d86e6e9d92b957b (diff)
downloadliberty-b4b0a0e8bbf28b4508c23a5263feda1f9fe5d12f.tar.gz
liberty-b4b0a0e8bbf28b4508c23a5263feda1f9fe5d12f.tar.bz2
liberty-b4b0a0e8bbf28b4508c23a5263feda1f9fe5d12f.zip
Style tidies for PHP8.4
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/classes/LibertyContent.php17
-rwxr-xr-xincludes/classes/LibertyMime.php16
2 files changed, 16 insertions, 17 deletions
diff --git a/includes/classes/LibertyContent.php b/includes/classes/LibertyContent.php
index 82d4ac8..922cf3c 100755
--- a/includes/classes/LibertyContent.php
+++ b/includes/classes/LibertyContent.php
@@ -730,7 +730,7 @@ class LibertyContent extends LibertyBase implements BitCacheable {
* Removes a specific version of a page
*
* @param int $pVersion Version number to roll back to
- * @param string $Comment Comment text to be added to the action log
+ * @param string $pComment Comment text to be added to the action log
* @return bool true if completed successfully
*/
public function expungeVersion( int $pVersion = 0, $pComment = '' ): bool {
@@ -2240,13 +2240,13 @@ class LibertyContent extends LibertyBase implements BitCacheable {
* @param array different possibilities depending on derived class
* @return string Formated URL address to display the page.
*/
- public function getPreviewUrl( $pContentId = null, $pMixed = null ) {
+ public static function getPreviewUrl( $pContentId = 0, $pMixed = null ) {
if( BitBase::verifyId( $pContentId ) ) {
$ret = LIBERTY_PKG_URL.'preview.php?content_id='.$pContentId;
} elseif( BitBase::verifyId( $pMixed['content_id'] ) ) {
$ret = LIBERTY_PKG_URL.'preview.php?content_id='.$pMixed['content_id'];
- } elseif( $this->isValid() ) {
- $ret = LIBERTY_PKG_URL.'preview.php?content_id='.$this->mContentId;
+// } elseif( $this->isValid() ) {
+// $ret = LIBERTY_PKG_URL.'preview.php?content_id='.$this->mContentId;
} else {
$ret = '#';
}
@@ -3318,7 +3318,6 @@ class LibertyContent extends LibertyBase implements BitCacheable {
/**
* Delete liberty cache
*
- * @param array $pContentId
* @access public
* @return bool true on success, false on failure
*/
@@ -3382,7 +3381,7 @@ class LibertyContent extends LibertyBase implements BitCacheable {
public static function storeActionLogFromHash( $pParamHash = null ): void {
global $gBitSystem;
- if( $gBitSystem->isFeatureActive( 'liberty_action_log' ) && $this->verifyActionLog( $pParamHash ) ) {
+ if( $gBitSystem->isFeatureActive( 'liberty_action_log' ) && $gBitSystem->verifyActionLog( $pParamHash ) ) {
$gBitSystem->mDb->associateInsert( BIT_DB_PREFIX."liberty_action_log", $pParamHash['action_log_store'] );
}
}
@@ -3433,7 +3432,7 @@ class LibertyContent extends LibertyBase implements BitCacheable {
* @param array $pParamHash
* @return bool true on success, false on failure
*/
- public function verifyActionLog( &$pParamHash ) {
+ public static function verifyActionLog( &$pParamHash ) {
global $gBitUser, $gBitSystem;
// we will set $ret false if there is a problem along the way
@@ -3472,8 +3471,8 @@ class LibertyContent extends LibertyBase implements BitCacheable {
// the log message
$log_message = '';
- if( empty( $pParamHash['action_log']['log_message'] ) && !empty( $this ) && !empty( $this->mLogs ) ) {
- foreach( $this->mLogs as $key => $msg ) {
+ if( empty( $pParamHash['action_log']['log_message'] ) && !empty( $gBitSystem ) && !empty( $gBitSystem->mLogs ) ) {
+ foreach( $gBitSystem->mLogs as $key => $msg ) {
$log_message .= "$msg";
}
} elseif( !empty( $pParamHash['action_log']['log_message'] ) ) {
diff --git a/includes/classes/LibertyMime.php b/includes/classes/LibertyMime.php
index 3c187d2..30fe4d5 100755
--- a/includes/classes/LibertyMime.php
+++ b/includes/classes/LibertyMime.php
@@ -264,13 +264,13 @@ class LibertyMime extends LibertyContent {
* getThumbnailUrl will fetch the primary thumbnail for a given content. If nothing has been set, it will fetch the last thumbnail it can find.
*
* @param string $pSize
- * @param array $pInfoHash
+ * @param array $mInfo
* @access public
* @return bool true on success, false on failure - $this->mErrors will contain reason for failure
*/
public function getThumbnailUrl( string $pSize = 'small', ?array $mInfo = null, ?int $pSecondaryId = null, ?int $pDefault = null ): string|null {
$ret = null;
- if( !empty( $pInfoHash ) ) {
+ if( !empty( $mInfo ) ) {
// do some stuff if we are given a hash of stuff
} elseif( $this->isValid() && !empty( $this->mStorage ) ) {
foreach( array_keys( $this->mStorage ) as $attachmentId ) {
@@ -283,7 +283,7 @@ class LibertyMime extends LibertyContent {
}
}
if( $pDefault && empty( $ret ) ) {
- $ret = parent::getThumbnailUrl( $pSize, $pInfoHash, $pSecondaryId );
+ $ret = parent::getThumbnailUrl( $pSize, $mInfo, $pSecondaryId );
}
return $ret;
}
@@ -893,15 +893,15 @@ class LibertyMime extends LibertyContent {
global $gBitSystem;
$ret = false;
if( BitBase::verifyId( $pAttachmentId ) && !empty( $pType ) && !empty( $pParamHash )) {
- if( is_array( $pParamHash )) {
+ if( \is_array( $pParamHash )) {
foreach( $pParamHash as $key => $data ) {
- if( !is_array( $data )) {
+ if( !\is_array( $data )) {
// store the data in the meta table
- $meta = array(
+ $meta = [
'attachment_id' => $pAttachmentId,
'meta_type_id' => LibertyMime::storeMetaId( $pType, 'type' ),
'meta_title_id' => LibertyMime::storeMetaId( $key, 'title' ),
- );
+ ];
// remove this entry from the database if it already exists
$gBitSystem->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_attachment_meta_data` WHERE `attachment_id` = ? AND `meta_type_id` = ? AND `meta_title_id` = ?", $meta );
@@ -1082,7 +1082,7 @@ class LibertyMime extends LibertyContent {
/**
* mime_get_storage_sub_dir_name get a filename based on the uploaded file
*
- * @param array $pFileHash File information provided in $_FILES
+ * @param array pFileHash File information provided in $_FILES
* @access public
* @return string appropriate sub dir name
*/