diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:56:27 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:56:27 +0100 |
| commit | f8a1163dd190ecd2db88513a2dbb6138d67573f9 (patch) | |
| tree | b10049a919bd69f82244dc82b2ca38b507e2c191 | |
| parent | ff94347235de0c063f19521bbb35a6725a687a8e (diff) | |
| download | protector-f8a1163dd190ecd2db88513a2dbb6138d67573f9.tar.gz protector-f8a1163dd190ecd2db88513a2dbb6138d67573f9.tar.bz2 protector-f8a1163dd190ecd2db88513a2dbb6138d67573f9.zip | |
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rwxr-xr-x | admin/schema_inc.php | 2 | ||||
| -rwxr-xr-x | includes/bit_setup_inc.php | 4 | ||||
| -rwxr-xr-x | includes/classes/LibertyProtector.php | 30 | ||||
| -rwxr-xr-x | liberty_plugins/mime.flatdefault.php | 11 |
4 files changed, 24 insertions, 23 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 206e98a..2e2ace8 100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -29,7 +29,7 @@ $gBitInstaller->registerPackageInfo( PROTECTOR_PKG_NAME, [ // ### Sequences //$sequences = [ -// 'protector_security_id_seq' => [ 'start' => 1 ] +// 'protector_security_id_seq' => [ 'start' => 1 ] //]; //$gBitInstaller->registerSchemaSequences( PROTECTOR_PKG_NAME, $sequences ); diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index f7c7051..bc69316 100755 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -12,9 +12,9 @@ $pRegisterHash = [ define( 'PROTECTOR_PKG_NAME', $pRegisterHash['package_name'] ); define( 'PROTECTOR_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' ); define( 'PROTECTOR_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' ); -define( 'PROTECTOR_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); +define( 'PROTECTOR_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); define( 'PROTECTOR_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/'); -define( 'PROTECTOR_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); +define( 'PROTECTOR_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); $gBitSystem->registerPackage( $pRegisterHash ); diff --git a/includes/classes/LibertyProtector.php b/includes/classes/LibertyProtector.php index de19e00..823f375 100755 --- a/includes/classes/LibertyProtector.php +++ b/includes/classes/LibertyProtector.php @@ -20,19 +20,19 @@ namespace Bitweaver\Liberty; class LibertyProtector extends LibertyBase { /** - * During initialisation, be sure to call our base constructors + * During initialisation, be sure to call our base constructors **/ public function __construct( $pContentId=0 ) { $this->mContentId = $pContentId ; parent::__construct(); } - /** - * Update the liberty_content_role_map table with corrected role_id(s). - * - * In -1 for anonymouse is not stored, switching content to anonymouse will clear array - * - * @param object $pParamHash + /** + * Update the liberty_content_role_map table with corrected role_id(s). + * + * In -1 for anonymouse is not stored, switching content to anonymouse will clear array + * + * @param object $pParamHash */ public function storeProtection( &$pParamHash ) { global $gBitSystem; @@ -51,10 +51,10 @@ class LibertyProtector extends LibertyBase { return \count( $this->mErrors ) == 0; } - /** - * Delete entry(ies) from liberty_content_role_map table with content_id. - * - * @var object $pContent + /** + * Delete entry(ies) from liberty_content_role_map table with content_id. + * + * @var object $pContent */ public function expunge(): bool { if( \Bitweaver\BitBase::verifyId( $this->mContentId ) ) { @@ -63,10 +63,10 @@ class LibertyProtector extends LibertyBase { return true; } - /** - * @param integer $ContentId + /** + * @param integer $ContentId * @return array liberty_content_role_map for selected content_id - * Ret -1 for anonymouse if alternatives are not stored + * Ret -1 for anonymouse if alternatives are not stored **/ public function getProtectionList( $ContentId = 0 ) { global $gBitSystem; @@ -222,7 +222,7 @@ function protector_content_edit( $pContent, $pFunctionParam ) { if ( isset( $pContent->mInfo['parent_id'] ) ) { $serviceHash['protector']['role'] = $gProtector->getProtectionList( $pContent->mInfo['parent_id'] ); } - } + } if ( isset( $serviceHash['protector']['role'] ) ) { $prot = array_keys( $serviceHash['protector']['role'] ); } $serviceHash['protector']['role_id'] = empty( $prot[0] ) ? -1 : $prot[0]; $gBitSmarty->assign( 'serviceHash', $serviceHash ); diff --git a/liberty_plugins/mime.flatdefault.php b/liberty_plugins/mime.flatdefault.php index 1a416cf..466f9ae 100755 --- a/liberty_plugins/mime.flatdefault.php +++ b/liberty_plugins/mime.flatdefault.php @@ -19,6 +19,7 @@ * setup */ namespace Bitweaver\Liberty; + use Bitweaver\BitBase; use Bitweaver\KernelTools; @@ -189,7 +190,7 @@ if( !function_exists( '\Bitweaver\Liberty\mime_default_update' )) { $gBitSystem->mDb->associateUpdate( BIT_DB_PREFIX."liberty_attachments", [ 'attachment_plugin_guid' => $pStoreRow['attachment_plugin_guid'] ], - [ 'attachment_id' => $pStoreRow['attachment_id'] ] + [ 'attachment_id' => $pStoreRow['attachment_id'] ], ); } } @@ -270,7 +271,7 @@ if( !function_exists( '\Bitweaver\Liberty\mime_default_load' )) { $row['name'] = $storageName; $row['type'] = $row['mime_type']; $storageBranch = liberty_mime_get_storage_branch( [ 'attachment_id' => $row['attachment_id'] ] ).$storageName; - // this will fetch the correct thumbnails + // this will fetch the correct thumbnails $thumbHash['source_file'] = STORAGE_PKG_PATH.$storageBranch; $row['source_file'] = STORAGE_PKG_PATH.$storageBranch; $canThumbFunc = liberty_get_function( 'can_thumbnail' ); @@ -434,7 +435,7 @@ if( !function_exists( '\Bitweaver\Liberty\liberty_mime_get_storage_branch' )) { // *PRIVATE FUNCTION. GO AWAY! DO NOT CALL DIRECTLY!!! global $gBitSystem; $pathParts = []; - + if( $pAttachmentId = BitBase::getParameter( $pParamHash, 'attachment_id' ) ) { $pathParts[] = 'attachments'; $pathParts[] = (int)($pAttachmentId % 1000); @@ -447,8 +448,8 @@ if( !function_exists( '\Bitweaver\Liberty\liberty_mime_get_storage_branch' )) { if( $pPackage = BitBase::getParameter( $pParamHash, 'package' ) ) { $pathParts[] = $pPackage; } - $fullPath = implode( '/', $pathParts ).'/'; - if( BitBase::getParameter( $pParamHash, 'create_dir', true ) ){ + $fullPath = implode( '/', $pathParts ).'/'; + if( BitBase::getParameter( $pParamHash, 'create_dir', true ) ){ if( !file_exists( STORAGE_PKG_PATH.$fullPath ) ) { KernelTools::mkdir_p( STORAGE_PKG_PATH.$fullPath ); } |
