CollaborationListContent.php
Two instances of this, but $context is never used
$context = wfEscapeWikiText( substr( $part, 30 ) ); if ( strlen( $context ) === 30 ) { $context .= '...'; }
Line 964, $column is undefinedsortUsersIntoColumns is $column actually an array? $column->items usage suggests it's not...Line 601 $itemTags; what is this to do?Line 28, typo "og" should be "of"Line 111-114 replace with return ( $value == 'members' || $value == 'normal' || $value == 'error' );Lines 724 and 725 are the same array key
private function matchesTag( array $tagSpecifier, array $itemTags ) { if ( !$tagSpecifier ) { return true; } $matchesAllGroups = true; foreach ( $tagSpecifier as $tagGroups ) { foreach ( $tagGroups as $tagAlt ) { $matchesOneAlternative = false; $itemTags; if ( in_array( $tagAlt, $itemTags ) ) { $matchesOneAlternative = true; break; } } if ( !$matchesOneAlternative ) { $matchesAllGroups = false; break; } } return $matchesAllGroups; }
matchesOneAlternative is questionably defined
CollaborationHubContent.php
Lines 857 and 858 are the same array key
ext.CollaborationKit.list.edit.js
cur = getCurrentJson - cur isn't used anywhere else. Is this assignment needed?
CollaborationHubContentEditor.php
foreach ( CollaborationHubContent::getThemeColours() as $colour ) { $colours['collaborationkit-' . $colour] = $colour; }
Possibly list all messages in full above for grep-ability?
SpecialCreateCollaborationHub.php
Does all the commented out code need to stay?
CollaborationHubContent.php
public function convertToHumanEditable() { $this->decode(); $output = $this->displayName; $output .= self::HUMAN_DESC_SPLIT; $output .= $this->introduction; $output .= self::HUMAN_DESC_SPLIT; $output .= $this->footer; $output .= self::HUMAN_DESC_SPLIT; $output .= $this->image; $output .= self::HUMAN_DESC_SPLIT; $output .= $this->themeColour; $output .= self::HUMAN_DESC_SPLIT; $output .= $this->getHumanEditableContent(); return $output; }
There seems to be a couple of similar implementations of the above?
CollaborationHubContentHandler.php
/** * @return CollaborationHubContent */ public function makeEmptyContent() { return new CollaborationHubContent( '{ "display_name": "", "introduction": "", "footer": "", "content": [] }' ); }
Can't decide if this should be a php array, and passed through json_encode or something for readability...
CollaborationListContent/CollaborationHubContent
Identical implementations of escapeForHumanEditable and unescapeForHumanEditable
General
JS files missing "use strict", I know it's not compulsory, but generally recommended...Various rather loooong lines. I notice Generic.Files.LineLength.TooLong disabled in phpcs.xml tooUsageException is deprecatedCommented out code blocks. Remove where appropriate. If using it to disable a feature, return a flag that disables it instead?