Version 5.0.0 beta 4
This commit is contained in:
1 parent
e86153356a
commit
2f24f9de48
276 files changed
+8614
-6044
No files matched your search
@@ -51,9 +51,9 @@ class Mybb extends Software
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "MyBB 1.8.x";
|
||||
@@ -62,9 +62,9 @@ class Mybb extends Software
|
||||
/**
|
||||
* Software Key
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "mybb";
|
||||
@@ -73,9 +73,9 @@ class Mybb extends Software
|
||||
/**
|
||||
* Content we can convert from this software.
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public static function canConvert()
|
||||
public static function canConvert(): ?array
|
||||
{
|
||||
return array(
|
||||
'convertBanfilters' => array(
|
||||
@@ -132,9 +132,9 @@ class Mybb extends Software
|
||||
/**
|
||||
* Can we convert passwords from this software.
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function loginEnabled()
|
||||
public static function loginEnabled(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -142,9 +142,9 @@ class Mybb 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(
|
||||
'convertEmoticons',
|
||||
@@ -157,10 +157,10 @@ class Mybb extends Software
|
||||
/**
|
||||
* 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 )
|
||||
@@ -286,9 +286,9 @@ class Mybb 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
|
||||
{
|
||||
/* Search Index Rebuild */
|
||||
Index::i()->rebuild();
|
||||
@@ -318,9 +318,9 @@ class Mybb 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 The 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
|
||||
@@ -342,7 +342,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertAnnouncements()
|
||||
public function convertAnnouncements() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -369,7 +369,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertBanfilters()
|
||||
public function convertBanfilters() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -408,7 +408,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertEmoticons()
|
||||
public function convertEmoticons() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -448,7 +448,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertWarnActions()
|
||||
public function convertWarnActions() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -475,7 +475,6 @@ class Mybb extends Software
|
||||
}
|
||||
else
|
||||
{
|
||||
$suspend_unit = 'h';
|
||||
$suspend = floor( $action['length'] / 3600 );
|
||||
}
|
||||
break;
|
||||
@@ -489,7 +488,6 @@ class Mybb extends Software
|
||||
}
|
||||
else
|
||||
{
|
||||
$rpa_unit = 'h';
|
||||
$rpa = floor( $action['length'] / 3600 );
|
||||
}
|
||||
break;
|
||||
@@ -503,7 +501,6 @@ class Mybb extends Software
|
||||
}
|
||||
else
|
||||
{
|
||||
$mq_unit = 'h';
|
||||
$mq = floor( $action['length'] / 3600 );
|
||||
}
|
||||
break;
|
||||
@@ -529,7 +526,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertWarnReasons()
|
||||
public function convertWarnReasons() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -553,7 +550,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertProfileFields()
|
||||
public function convertProfileFields() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -597,31 +594,28 @@ class Mybb extends Software
|
||||
* @param string $type MyBB Type
|
||||
* @return string IPS Type
|
||||
*/
|
||||
protected function _fieldMap( $type )
|
||||
protected function _fieldMap( string $type ) : string
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case 'text':
|
||||
return 'Text';
|
||||
break;
|
||||
|
||||
case 'textarea':
|
||||
return "TextArea";
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
case 'multiselect':
|
||||
return 'Select';
|
||||
break;
|
||||
|
||||
case 'checkbox':
|
||||
return 'CheckboxSet';
|
||||
break;
|
||||
|
||||
case 'radio':
|
||||
return 'Radio';
|
||||
break;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -629,7 +623,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGroups()
|
||||
public function convertGroups() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -656,7 +650,6 @@ class Mybb extends Software
|
||||
/* Bubble up */
|
||||
throw new UnderflowException;
|
||||
}
|
||||
$promotion_unit = 0;
|
||||
$promotion_data = array( $promotion['newusergroup'], $promotion['posts'] );
|
||||
break;
|
||||
|
||||
@@ -665,7 +658,6 @@ class Mybb extends Software
|
||||
{
|
||||
throw new UnderflowException;
|
||||
}
|
||||
$promotion_unit = 0;
|
||||
$promotion_data = array( $promotion['newusergroup'], $promotion['registered'] );
|
||||
break;
|
||||
}
|
||||
@@ -674,8 +666,8 @@ class Mybb extends Software
|
||||
|
||||
/* Username Styles */
|
||||
$style = explode( '{username}', $row['namestyle'] );
|
||||
$prefix = isset( $style[0] ) ? $style[0] : '';
|
||||
$suffix = isset( $style[1] ) ? $style[1] : '';
|
||||
$prefix = $style[0] ?? '';
|
||||
$suffix = $style[1] ?? '';
|
||||
|
||||
$info = array(
|
||||
'g_id' => $row['gid'],
|
||||
@@ -729,7 +721,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertMembers()
|
||||
public function convertMembers() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -982,7 +974,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertPrivateMessages()
|
||||
public function convertPrivateMessages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -1025,7 +1017,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertPrivateMessageReplies()
|
||||
public function convertPrivateMessageReplies() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -1051,7 +1043,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertProfanityFilters()
|
||||
public function convertProfanityFilters() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -1074,7 +1066,7 @@ class Mybb extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertQuestionAndAnswers()
|
||||
public function convertQuestionAndAnswers() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -1094,9 +1086,9 @@ class Mybb 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
|
||||
{
|
||||
/* If we can't access profiles, don't bother trying to redirect */
|
||||
if( !Member::loggedIn()->canAccessModule( Module::get( 'core', 'members' ) ) )
|
||||
@@ -1129,7 +1121,7 @@ class Mybb extends Software
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public static function login( $member, $password )
|
||||
public static function login( Member $member, string $password ) : bool
|
||||
{
|
||||
if ( Login::compareHashes( $member->conv_password, md5( md5( $member->misc ) . md5( $password ) ) ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user