Version 5.0.0 beta 4

This commit is contained in:
Neo committed 2025-12-19 16:57:00 -08:00
1 parent e86153356a
commit 2f24f9de48
276 files changed
+8614 -6044

No files matched your search

@@ -17,7 +17,7 @@ use Exception;
use InvalidArgumentException;
use IPS\convert\App;
use IPS\convert\Software;
use IPS\convert\Software\Core\Vbulletin;
use IPS\convert\Software\Core\Vbulletin as VBulletinSoftware;
use IPS\File;
use IPS\gallery\Album;
use IPS\gallery\Image;
@@ -44,12 +44,12 @@ class Vbulletin extends Software
/**
* @brief vBulletin 4 Stores all attachments under one table - this will store the content type for the forums app.
*/
protected static $imageContentType = NULL;
protected static mixed $imageContentType = NULL;
/**
* @brief The schematic for vB3 and vB4 is similar enough that we can make specific concessions in a sinle converter for either version.
*/
protected static $isLegacy = NULL;
protected static ?bool $isLegacy = NULL;
/**
* Constructor
@@ -59,9 +59,9 @@ class Vbulletin extends Software
* @return void
* @throws InvalidArgumentException
*/
public function __construct( App $app, $needDB=TRUE )
public function __construct( App $app, bool $needDB=TRUE )
{
$return = parent::__construct( $app, $needDB );
parent::__construct( $app, $needDB );
/* Is this vB3 or vB4? */
if ( $needDB )
@@ -91,16 +91,14 @@ class Vbulletin extends Software
}
catch( Exception $e ) {}
}
return $return;
}
/**
* Software Name
*
* @return string
* @return string
*/
public static function softwareName()
public static function softwareName(): string
{
/* Child classes must override this method */
return "vBulletin Gallery (3.8.x/4.x)";
@@ -109,9 +107,9 @@ class Vbulletin extends Software
/**
* Software Key
*
* @return string
* @return string
*/
public static function softwareKey()
public static function softwareKey(): string
{
/* Child classes must override this method */
return "vbulletin";
@@ -120,14 +118,14 @@ class Vbulletin extends Software
/**
* Content we can convert from this software.
*
* @return array
* @return array|null
*/
public static function canConvert()
public static function canConvert(): ?array
{
$imageWhere = NULL;
$imageTable = 'picture';
if ( static::$isLegacy == FALSE )
if ( !static::$isLegacy )
{
$imageWhere = array( "contenttypeid=?", static::$imageContentType );
$imageTable = 'attachment';
@@ -152,9 +150,9 @@ class Vbulletin extends Software
/**
* Requires Parent
*
* @return boolean
* @return boolean
*/
public static function requiresParent()
public static function requiresParent(): bool
{
return TRUE;
}
@@ -162,9 +160,9 @@ class Vbulletin extends Software
/**
* Possible Parent Conversions
*
* @return array
* @return array|null
*/
public static function parents()
public static function parents(): ?array
{
return array( 'core' => array( 'vbulletin' ) );
}
@@ -172,9 +170,9 @@ class Vbulletin extends Software
/**
* Finish - Adds everything it needs to the queues and clears data store
*
* @return array Messages to display
* @return array Messages to display
*/
public function finish()
public function finish(): array
{
/* Content Rebuilds */
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
@@ -194,23 +192,23 @@ class Vbulletin extends Software
/**
* Pre-process content for the Invision Community text parser
*
* @param string The post
* @param string|null Content Classname passed by post-conversion rebuild
* @param int|null Content ID passed by post-conversion rebuild
* @param string $post post
* @param string|null $className Classname passed by post-conversion rebuild
* @param int|null $contentId ID passed by post-conversion rebuild
* @return string The converted post
*/
public static function fixPostData( string $post, ?string $className=null, ?int $contentId=null ): string
{
return Vbulletin::fixPostData( $post, $className, $contentId );
return VBulletinSoftware::fixPostData( $post, $className, $contentId );
}
/**
* Get More Information
*
* @param string $method Conversion method
* @return array
* @param string $method Conversion method
* @return array|null
*/
public function getMoreInfo( $method )
public function getMoreInfo( string $method ): ?array
{
$return = array();
switch( $method )
@@ -241,9 +239,9 @@ class Vbulletin extends Software
/**
* List of conversion methods that require additional information
*
* @return array
* @return array
*/
public static function checkConf()
public static function checkConf(): array
{
return array( 'convertGalleryImages' );
}
@@ -253,7 +251,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertGalleryAlbums()
public function convertGalleryAlbums() : void
{
$libraryClass = $this->getLibrary();
@@ -296,7 +294,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertGalleryImages()
public function convertGalleryImages() : void
{
$libraryClass = $this->getLibrary();
@@ -396,7 +394,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertGalleryComments()
public function convertGalleryComments() : void
{
$libraryClass = $this->getLibrary();
@@ -460,9 +458,9 @@ class Vbulletin extends Software
/**
* Check if we can redirect the legacy URLs from this software to the new locations
*
* @return NULL|Url
* @return Url|NULL
*/
public function checkRedirects()
public function checkRedirects(): ?Url
{
$url = Request::i()->url();