jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/359427 )

Change subject: Various unsorted code style fixes
......................................................................


Various unsorted code style fixes

There is a lot to fix here, but I stopped for now to not end with a
giant patch that can not be reviewed.

Change-Id: Ic59090b78d97b4b5d677d505f97d4bf01746d5be
---
M EducationProgram.hooks.php
M includes/ArticleAdder.php
M includes/ArticleStore.php
M includes/CourseUndeletionHelper.php
M includes/DYKBox.php
M includes/DiffTable.php
M includes/ErrorPageErrorWithSelflink.php
M includes/Events/EditEventCreator.php
M includes/Events/Event.php
M includes/Events/EventStore.php
M includes/Events/Timeline.php
M includes/Events/TimelineGroup.php
M includes/Extension.php
M includes/FailForm.php
M includes/LogFormatter.php
M includes/Menu.php
M includes/ORMResult.php
M includes/OrgDeletionHelper.php
M includes/RevisionDiff.php
M includes/Settings.php
M includes/UPCUserCourseFinder.php
M includes/UserMergeArticleReviewersJob.php
M includes/UserRolesMessage.php
M includes/actions/AddArticleAction.php
M includes/actions/AddReviewerAction.php
M includes/actions/CompareAction.php
M includes/actions/DeleteAction.php
M includes/actions/DeleteOrgAction.php
M includes/actions/EditAction.php
M includes/actions/EditCourseAction.php
M includes/actions/EditOrgAction.php
M includes/actions/HistoryAction.php
M includes/actions/RemoveArticleAction.php
M includes/actions/RemoveReviewerAction.php
M includes/actions/RemoveStudentAction.php
M includes/actions/UndeleteAction.php
M includes/actions/ViewAction.php
M includes/actions/ViewCourseAction.php
M includes/actions/ViewOrgAction.php
M includes/api/ApiAddStudents.php
M includes/api/ApiDeleteEducation.php
M includes/api/ApiEnlist.php
M includes/api/ApiListStudents.php
M includes/notifications/CampusAddNotification.php
M includes/notifications/CourseTalkNotification.php
M includes/notifications/InstructorAddNotification.php
M includes/notifications/NotificationsManager.php
M includes/notifications/OnlineAddNotification.php
M includes/notifications/PresentationModel/CourseTalk.php
M includes/notifications/RoleAddNotification.php
M includes/notifications/StudentAddNotification.php
M includes/pagers/ArticleTable.php
M includes/pagers/CAPager.php
M includes/pagers/CoursePager.php
M includes/pagers/EPPager.php
M includes/pagers/OAPager.php
M includes/pagers/OrgPager.php
M includes/pagers/RevisionPager.php
M includes/pagers/StudentActivityPager.php
M includes/pagers/StudentPager.php
M includes/pages/EducationPage.php
M includes/rows/Course.php
M includes/rows/EPArticle.php
M includes/rows/IORMRow.php
M includes/rows/ORMRow.php
M includes/rows/Org.php
M includes/rows/PageObject.php
M includes/rows/RevisionedObject.php
M includes/specials/SpecialCAProfile.php
M includes/specials/SpecialCAs.php
M includes/specials/SpecialCourses.php
M includes/specials/SpecialDisenroll.php
M includes/specials/SpecialEducationProgram.php
M includes/specials/SpecialEnroll.php
M includes/specials/SpecialInstitutions.php
M includes/specials/SpecialManageCourses.php
M includes/specials/SpecialMyCourses.php
M includes/specials/SpecialOAProfile.php
M includes/specials/SpecialOAs.php
M includes/specials/SpecialStudentActivity.php
M includes/specials/SpecialStudents.php
M includes/tables/Courses.php
M includes/tables/IORMTable.php
M includes/tables/ORMTable.php
M includes/tables/Orgs.php
M maintenance/fixInvalidStudent.php
M resources/ep.tagsinput/ep.tagsinput.css
M tests/phpunit/rows/CourseTest.php
M tests/phpunit/rows/OrgTest.php
M tests/phpunit/rows/PageObjectTest.php
M tests/phpunit/tables/OrgsTest.php
91 files changed, 218 insertions(+), 330 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/EducationProgram.hooks.php b/EducationProgram.hooks.php
index c9da531..b864e5a 100755
--- a/EducationProgram.hooks.php
+++ b/EducationProgram.hooks.php
@@ -3,6 +3,7 @@
 namespace EducationProgram;
 
 use DatabaseUpdater;
+use EchoEvent;
 use RecursiveDirectoryIterator;
 use RecursiveIteratorIterator;
 use SplFileInfo;
@@ -265,8 +266,8 @@
                $textParts = \SpecialPageFactory::resolveAlias( 
$sktemplate->getTitle()->getText() );
 
                if ( in_array( $textParts[0], [ 'Enroll', 'Disenroll' ] )
-                       && !is_null( $textParts[1] ) && trim( $textParts[1] ) 
!== '' ) {
-
+                       && !is_null( $textParts[1] ) && trim( $textParts[1] ) 
!== ''
+               ) {
                        // Remove the token from the title if needed.
                        if ( !$sktemplate->getRequest()->getCheck( 'wptoken' ) 
) {
                                $textParts[1] = explode( '/', $textParts[1] );
@@ -319,7 +320,6 @@
                        $page = EducationPage::factory( $title );
 
                        if ( $user->isAllowed( $page->getLimitedEditRight() ) ) 
{
-
                                $links['views']['edit'] = [
                                        'class' => $type === 'edit' ? 
'selected' : false,
                                        'text' => $sktemplate->msg( $exists ? 
'ep-tab-edit' : 'ep-tab-create' )->text(),
@@ -529,9 +529,11 @@
         *
         * @return boolean
         */
-       public static function onBeforeCreateEchoEvent( array &$notifications,
-                       array &$notificationCategories, array &$icons ) {
-
+       public static function onBeforeCreateEchoEvent(
+               array &$notifications,
+               array &$notificationCategories,
+               array &$icons
+       ) {
                Extension::globalInstance()->getNotificationsManager()->
                        setUpTypesAndCategories(
                        $notifications, $notificationCategories, $icons );
@@ -547,14 +549,15 @@
         *
         * @since 0.4 alpha
         *
-        * @param $event \EchoEvent
+        * @param $event EchoEvent
         * @param $users array
         *
         * @return boolean
         */
        public static function onEchoGetDefaultNotifiedUsers(
-                       \EchoEvent $event, array &$users ) {
-
+               EchoEvent $event,
+               array &$users
+       ) {
                Extension::globalInstance()->getNotificationsManager()->
                        getUsersNotified( $event, $users );
 
@@ -565,16 +568,25 @@
         * Check for changes to course talk pages, possibly trigger a 
notification.
         * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete
         */
-       public static function onPageContentSaveComplete( $article, $user, 
$content,
-                       $summary, $isMinor, $isWatch, $section, $flags, 
$revision, $status,
-                       $baseRevId ) {
-
+       public static function onPageContentSaveComplete(
+               $article,
+               $user,
+               $content,
+               $summary,
+               $isMinor,
+               $isWatch,
+               $section,
+               $flags,
+               $revision,
+               $status,
+               $baseRevId
+       ) {
                $title = $article->getTitle();
 
                // check if the page saved was a course in the EP talk namespace
-               if ( ( $title->getNamespace() === EP_NS_TALK ) &&
-                       ( Utils::isCourse( $title ) ) ) {
-
+               if ( $title->getNamespace() === EP_NS_TALK
+                       && Utils::isCourse( $title )
+               ) {
                        // Send an event to the notifications manager. Note 
that there are
                        // additional checks that will be peformed further 
along before a
                        // notification is actually sent.
@@ -599,8 +611,8 @@
         * @since 0.5 alpha
         */
        public static function onSetupAfterCache() {
-
                global $wgAutoloadClasses;
+
                if ( !array_key_exists( 'CountryNames', $wgAutoloadClasses ) ) 
{ // No version constant to check against :/
                           die( '<strong>Error:</strong> Education Program 
depends on the <a href="https://www.mediawiki.org/wiki/Extension:CLDR";>CLDR</a> 
extension.' );
                }
@@ -617,7 +629,6 @@
         * @since 0.5.0 alpha
         */
        public static function onUserMergeAccountFields( array &$fields ) {
-
                // Omitting the ep_users_per_course table, since that will be 
updated
                // automatically by Course::save(), called from 
onMergeAccountFromTo().
 
@@ -663,7 +674,6 @@
         * @since 0.5.0 alpha
         */
        public static function onMergeAccountFromTo( &$oldUser, $newUser ) {
-
                $oldId = $oldUser->getId();
                $newId = $newUser->getId();
 
@@ -687,7 +697,6 @@
                // A function to usermerge in an array of ids. Returns true if 
there
                // were changes.
                $mergeUserIds = function( &$ids ) use ( $oldId, $newId ) {
-
                        $i = array_search( $oldId, $ids );
 
                        if ( $i !== false ) {
@@ -700,7 +709,6 @@
                };
 
                foreach ( $courseIds as $courseId ) {
-
                        // Fetch the course
                        $course = Courses::singleton()->selectRow(
                                        null, [ 'id' => $courseId ] );
@@ -712,7 +720,6 @@
 
                        // Go through the role fields, update the user id, 
de-dupe and save
                        foreach ( $roleFields as $roleField ) {
-
                                $ids = $course->getField( $roleField );
 
                                if ( $mergeUserIds( $ids ) ) {
diff --git a/includes/ArticleAdder.php b/includes/ArticleAdder.php
index dbc4cda..522b119 100644
--- a/includes/ArticleAdder.php
+++ b/includes/ArticleAdder.php
@@ -39,8 +39,6 @@
        protected $articleStore;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param ArticleStore $articleStore
diff --git a/includes/ArticleStore.php b/includes/ArticleStore.php
index ec55c7e..b579acd 100644
--- a/includes/ArticleStore.php
+++ b/includes/ArticleStore.php
@@ -48,8 +48,6 @@
        protected $readConnectionId;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param string $tableName
diff --git a/includes/CourseUndeletionHelper.php 
b/includes/CourseUndeletionHelper.php
index 9d20278..a10e048 100644
--- a/includes/CourseUndeletionHelper.php
+++ b/includes/CourseUndeletionHelper.php
@@ -2,6 +2,8 @@
 
 namespace EducationProgram;
 
+use IContextSource;
+
 /**
  * Helps to check that a course can be undeleted, and to create an appropriate
  * message if it can't be.
@@ -18,7 +20,7 @@
  * @licence GNU GPL v2+
  * @author Andrew Green < agr...@wikimedia.org >
  */
-       class CourseUndeletionHelper {
+class CourseUndeletionHelper {
 
        /**
         * @since 0.4 alpha
@@ -59,14 +61,16 @@
         * @param EPRevision $revision the latest revision of the course that 
may or
         *   may not be undeleted
         *
-        * @param \IContextSource $context the current context
+        * @param IContextSource $context the current context
         *
         * @param EducationPage $educationPage the EducationPage object for the
         *   course that may or may not be undeleted
         */
-       public function __construct( EPRevision $revision,
-               \IContextSource $context, EducationPage $educationPage ) {
-
+       public function __construct(
+               EPRevision $revision,
+               IContextSource $context,
+               EducationPage $educationPage
+       ) {
                $this->revision = $revision;
                $this->context = $context;
                $this->educationPage = $educationPage;
@@ -78,11 +82,8 @@
         * @return boolean
         */
        public function checkRestrictions() {
-
                // Is the user allowed to edit this page?
-               if ( !$this->context->getUser()->isAllowed(
-                       $this->educationPage->getEditRight() ) ) {
-
+               if ( !$this->context->getUser()->isAllowed( 
$this->educationPage->getEditRight() ) ) {
                        $this->undeletionCheck = CourseUndelCheck::NO_RIGHTS;
                        return false;
                }
@@ -140,7 +141,6 @@
 
                                // Check that we actually got a revision.
                                if ( $deletedOrgRev !== false ) {
-
                                        // Get an object for the deleted org 
and get some info.
                                        $deletedOrg = 
$deletedOrgRev->getObject();
                                        $deletedOrgTitle = 
$deletedOrg->getTitle();
@@ -174,7 +174,8 @@
                                break;
                }
        }
-       }
+
+}
 
 /**
  * Constants for possible results of check for restrictions.
diff --git a/includes/DYKBox.php b/includes/DYKBox.php
index f31834f..8f00360 100644
--- a/includes/DYKBox.php
+++ b/includes/DYKBox.php
@@ -25,8 +25,6 @@
        protected $specificCategory;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param string $mainCategory
diff --git a/includes/DiffTable.php b/includes/DiffTable.php
index c4fa9cd..47a1b68 100644
--- a/includes/DiffTable.php
+++ b/includes/DiffTable.php
@@ -40,8 +40,6 @@
        protected $secondRevisionType = 'new';
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param IContextSource $context
@@ -120,10 +118,8 @@
         * @param string $secondRevisionType
         */
        public function setRevisionTypes( $firstRevisionType, 
$secondRevisionType ) {
-
                $this->firstRevisionType = $firstRevisionType;
                $this->secondRevisionType = $secondRevisionType;
-
        }
 
 }
diff --git a/includes/ErrorPageErrorWithSelflink.php 
b/includes/ErrorPageErrorWithSelflink.php
index 0b9f18d..41a6634 100644
--- a/includes/ErrorPageErrorWithSelflink.php
+++ b/includes/ErrorPageErrorWithSelflink.php
@@ -12,7 +12,6 @@
  *
  * @licence GNU GPL v2+
  * @author Andrew Green andrew.green...@gmail.com
- *
  */
 class ErrorPageErrorWithSelflink extends \ErrorPageError {
 
diff --git a/includes/Events/EditEventCreator.php 
b/includes/Events/EditEventCreator.php
index edcdd45..d8c4bee 100644
--- a/includes/Events/EditEventCreator.php
+++ b/includes/Events/EditEventCreator.php
@@ -60,8 +60,6 @@
        private $userCourseFinder;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param DatabaseBase $db
diff --git a/includes/Events/Event.php b/includes/Events/Event.php
index 40df0d6..8ac414b 100644
--- a/includes/Events/Event.php
+++ b/includes/Events/Event.php
@@ -39,8 +39,6 @@
        private $info;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param int|null $eventId
diff --git a/includes/Events/EventStore.php b/includes/Events/EventStore.php
index bb70653..e5eb075 100644
--- a/includes/Events/EventStore.php
+++ b/includes/Events/EventStore.php
@@ -53,8 +53,6 @@
        private $readConnectionId;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param string $tableName
diff --git a/includes/Events/Timeline.php b/includes/Events/Timeline.php
index eff19f0..b3cf627 100644
--- a/includes/Events/Timeline.php
+++ b/includes/Events/Timeline.php
@@ -53,8 +53,6 @@
        protected $language;
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param OutputPage $outputPage
diff --git a/includes/Events/TimelineGroup.php 
b/includes/Events/TimelineGroup.php
index 1b7b304..b2569c7 100644
--- a/includes/Events/TimelineGroup.php
+++ b/includes/Events/TimelineGroup.php
@@ -11,7 +11,6 @@
 use OutputPage;
 use User;
 use Title;
-use EducationProgram\Events\Event;
 
 /**
  * Class for displaying a group of Education Program events in a timeline.
@@ -296,6 +295,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class EditGroup extends TimelineGroup {
+
        /**
         * Builds and returns the HTML for a single of the event segments.
         *
diff --git a/includes/Extension.php b/includes/Extension.php
index a7d47f5..a7b6697 100644
--- a/includes/Extension.php
+++ b/includes/Extension.php
@@ -114,7 +114,6 @@
         */
        public function getNotificationsManager() {
                if ( $this->notificationsMgr === null ) {
-
                        $this->notificationsMgr = new NotificationsManager();
 
                        $this->notificationsMgr->registerType( 
'EducationProgram\CourseTalkNotification' );
diff --git a/includes/FailForm.php b/includes/FailForm.php
index 50800e0..eb63702 100644
--- a/includes/FailForm.php
+++ b/includes/FailForm.php
@@ -45,7 +45,6 @@
         * @return String wrapped HTML.
         */
        function wrapForm( $html ) {
-
                // Include a <fieldset> wrapper for style, if requested.
                if ( $this->mWrapperLegend !== false ) {
                        $html = Xml::fieldset( $this->mWrapperLegend, $html );
diff --git a/includes/LogFormatter.php b/includes/LogFormatter.php
index 569bc08..ee11cdd 100644
--- a/includes/LogFormatter.php
+++ b/includes/LogFormatter.php
@@ -45,9 +45,9 @@
                if ( !$this->plaintext ) {
                        $link = Linker::link( $title, htmlspecialchars( $text 
), [], $parameters );
                } else {
-
                        $link = '[[' . $title->getPrefixedText() . '|' . $text 
. ']]';
                }
+
                return $link;
        }
 
diff --git a/includes/Menu.php b/includes/Menu.php
index ec0f5c2..5a8712b 100644
--- a/includes/Menu.php
+++ b/includes/Menu.php
@@ -30,8 +30,6 @@
        protected $itemFunction = null;
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param IContextSource $context
diff --git a/includes/ORMResult.php b/includes/ORMResult.php
index 0cb3a5f..ca1d9ab 100644
--- a/includes/ORMResult.php
+++ b/includes/ORMResult.php
@@ -33,6 +33,7 @@
  */
 
 class ORMResult implements ORMIterator {
+
        /**
         * @var \ResultWrapper
         */
diff --git a/includes/OrgDeletionHelper.php b/includes/OrgDeletionHelper.php
index 8736b10..292dfbd 100644
--- a/includes/OrgDeletionHelper.php
+++ b/includes/OrgDeletionHelper.php
@@ -60,7 +60,6 @@
         */
        public function checkRestrictions() {
                if ( $this->deletionCheck === OrgDelCheck::NOT_CHECKED ) {
-
                        // Is the user allowed to edit this page?
                        if ( !$this->context->getUser()->isAllowed( 'ep-org' ) 
) {
                                $this->deletionCheck = OrgDelCheck::NO_RIGHTS;
@@ -68,7 +67,6 @@
                        // Does the org have courses?
                        } elseif ( $this->org->getField( 'course_count' ) > 0 ) 
{
                                $this->deletionCheck = OrgDelCheck::HAS_COURSES;
-
                        } else {
                                $this->deletionCheck = OrgDelCheck::CAN_DELETE;
                        }
@@ -94,7 +92,6 @@
         * deleted.
         */
        public function getCantDeleteMsg() {
-
                $msgInfo = $this->getCantDeleteMsgKeyAndParams( true );
 
                return $this->context->msg( $msgInfo['key'], $msgInfo['params'] 
);
@@ -133,16 +130,13 @@
 
                        case OrgDelCheck::HAS_COURSES:
                                if ( $plain ) {
-
                                        return [
                                                'key' => 
'ep-delete-org-has-courses-plain',
                                                'params' => [
                                                        $this->org->getField( 
'name' )
                                                ]
                                        ];
-
                                } else {
-
                                        return [
                                                'key' => 
'ep-delete-org-has-courses',
                                                'params' => [
diff --git a/includes/RevisionDiff.php b/includes/RevisionDiff.php
index b31cb97..d53b478 100644
--- a/includes/RevisionDiff.php
+++ b/includes/RevisionDiff.php
@@ -33,15 +33,16 @@
        public static function newFromCompareRevision(
                RevisionedObject $targetObject,
                EPRevision $revision,
-               array $fields = null ) {
-
+               array $fields = null
+       ) {
                $sourceObject = $revision->getObject();
                $fields = is_null( $fields ) ? $sourceObject->getFieldNames() : 
$fields;
 
                $changedFields = RevisionDiff::compareFields(
                        $sourceObject,
                        $targetObject,
-                       $fields );
+                       $fields
+               );
 
                return new self( $changedFields );
        }
@@ -49,8 +50,8 @@
        public static function newFromRestoreRevision(
                RevisionedObject $sourceObject,
                EPRevision $revision,
-               array $fields = null ) {
-
+               array $fields = null
+       ) {
                $targetObject = $revision->getObject();
                $fields = is_null( $fields ) ? $targetObject->getFieldNames() : 
$fields;
 
@@ -65,8 +66,8 @@
        public static function newFromUndoRevision(
                RevisionedObject $currentObject,
                EPRevision $revision,
-               array $fields = null ) {
-
+               array $fields = null
+       ) {
                $changedFields = [];
 
                $targetObject = $revision->getPreviousRevision()->getObject();
@@ -80,15 +81,15 @@
                                $sourceHasField = $sourceObject->hasField( 
$fieldName );
                                $targetHasField = $targetObject->hasField( 
$fieldName );
 
-                               if ( $currentObject->getField( $fieldName, null 
) ===
-                                       $sourceObject->getField( $fieldName, 
null )
+                               if ( $currentObject->getField( $fieldName ) ===
+                                       $sourceObject->getField( $fieldName )
                                        &&
                                        ( ( $sourceHasField xor $targetHasField 
)
                                                ||
-                                               $sourceObject->getField( 
$fieldName, null ) !==
-                                               $targetObject->getField( 
$fieldName, null )
-                                       ) ) {
-
+                                               $sourceObject->getField( 
$fieldName ) !==
+                                               $targetObject->getField( 
$fieldName )
+                                       )
+                               ) {
                                        $changedFields[$fieldName] = [];
 
                                        if ( $sourceHasField ) {
@@ -147,8 +148,8 @@
        protected static function compareFields(
                RevisionedObject $sourceObject,
                RevisionedObject $targetObject,
-               $fields ) {
-
+               $fields
+       ) {
                $changedFields = [];
 
                foreach ( $fields as $fieldName ) {
@@ -156,9 +157,8 @@
                        $targetHasField = $targetObject->hasField( $fieldName );
 
                        if ( ( $sourceHasField xor $targetHasField )
-                               || $sourceObject->getField( $fieldName, null ) 
!==
-                               $targetObject->getField( $fieldName, null ) ) {
-
+                               || $sourceObject->getField( $fieldName ) !== 
$targetObject->getField( $fieldName )
+                       ) {
                                $changedFields[$fieldName] = [];
 
                                if ( $sourceHasField ) {
diff --git a/includes/Settings.php b/includes/Settings.php
index 0fabe3d..399234f 100644
--- a/includes/Settings.php
+++ b/includes/Settings.php
@@ -38,8 +38,6 @@
        protected $settings;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param array $settings
diff --git a/includes/UPCUserCourseFinder.php b/includes/UPCUserCourseFinder.php
index a8a9de0..fe79a99 100644
--- a/includes/UPCUserCourseFinder.php
+++ b/includes/UPCUserCourseFinder.php
@@ -44,8 +44,6 @@
        private $db;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param DatabaseBase $db
diff --git a/includes/UserMergeArticleReviewersJob.php 
b/includes/UserMergeArticleReviewersJob.php
index fb4ba90..b69d5dd 100644
--- a/includes/UserMergeArticleReviewersJob.php
+++ b/includes/UserMergeArticleReviewersJob.php
@@ -48,7 +48,6 @@
         * @see Job::run()
         */
        public function run() {
-
                $dbw = wfGetDB( DB_MASTER );
                $oldId = $this->params['oldUserId'];
                $newId = $this->params['newUserId'];
@@ -66,7 +65,6 @@
                );
 
                foreach ( $articleRows as $articleRow ) {
-
                        $reviewerIds = unserialize( 
$articleRow->article_reviewers );
 
                        if ( $this->mergeIds( $reviewerIds, $oldId, $newId ) ) {
diff --git a/includes/UserRolesMessage.php b/includes/UserRolesMessage.php
index e5a6e50..6813257 100644
--- a/includes/UserRolesMessage.php
+++ b/includes/UserRolesMessage.php
@@ -93,7 +93,6 @@
         * userHasRoles() or output().
         */
        public function prepare() {
-
                // classes of table objects, ordered by priority, for describing
                // a user's partcipation in the corrsponding roles
                $orderedTableClasses = [
@@ -188,14 +187,12 @@
                $mainRoleCoursesCount = count( $mainRoleCourses );
 
                if ( $mainRoleCoursesCount <= $maxCourses ) {
-
                        // create the main message with the list of courses
 
                        // make an array of wikitext links to courses and their 
talk pages
                        $courseLinks = [];
 
                        foreach ( $mainRoleCourses as $course ) {
-
                                $title = $course->getTitle();
 
                                $msg = $this->out->msg(
@@ -215,9 +212,7 @@
                                $this->out->getLanguage()->listToText( 
$courseLinks ),
                                $mainRoleCoursesCount
                        )->parse();
-
                } else {
-
                        // create the main message with only the number of 
courses
 
                        $mainMessageParams = [
@@ -237,7 +232,6 @@
                // If there were any additional roles, we'll summarize them with
                // a phrase like, "She is also an instructor."
                if ( count( $this->rolesAndCourses ) > 1 ) {
-
                        // Make an array of remaining rolenames.
 
                        // Set up some local vars to use in the following 
closure, since
@@ -247,13 +241,11 @@
 
                        $remainingRolenames = array_map(
                                function( $roleAndCourse ) use ( 
$messageKeysForRoles, $out ) {
-
-                                       $msgKey =
-                                               
$messageKeysForRoles[$roleAndCourse['role']]['rolename'];
-
+                                       $msgKey = 
$messageKeysForRoles[$roleAndCourse['role']]['rolename'];
                                        return $out->msg( $msgKey )->plain();
                                },
-                               array_slice( $this->rolesAndCourses, 1 ) );
+                               array_slice( $this->rolesAndCourses, 1 )
+                       );
 
                        $remainingRolenamesList =
                                $this->out->getLanguage()->listToText( 
$remainingRolenames );
diff --git a/includes/actions/AddArticleAction.php 
b/includes/actions/AddArticleAction.php
index d4e35f0..a8b100e 100644
--- a/includes/actions/AddArticleAction.php
+++ b/includes/actions/AddArticleAction.php
@@ -44,7 +44,6 @@
                // If no article was found, test whether the user inputted a 
URL instead
                // of an article name, and ensure the URL is from this domain.
                if ( is_null( $title ) || !$title->isKnown() ) {
-
                        if ( strpos( $wgServer, "http://"; ) !== false ) {
                                $serverWithoutProtocol = substr( $wgServer, 
strlen( "http://"; ) );
                        } elseif ( strpos( $wgServer, "https://"; ) !== false ) {
@@ -66,7 +65,6 @@
 
                // TODO: some kind of warning when entering invalid title
                if ( $user->matchEditToken( $req->getText( 'token' ), $salt ) 
&& !is_null( $title ) ) {
-
                        // TODO: migrate into ArticleAdder
                        $course = Courses::singleton()->selectRow(
                                [ 'students', 'name' ],
diff --git a/includes/actions/AddReviewerAction.php 
b/includes/actions/AddReviewerAction.php
index 52a6e4a..eed6105 100644
--- a/includes/actions/AddReviewerAction.php
+++ b/includes/actions/AddReviewerAction.php
@@ -33,7 +33,6 @@
                $salt = 'addreviewer' . $req->getInt( 'article-id' );
 
                if ( $user->matchEditToken( $req->getText( 'token' ), $salt ) ) 
{
-
                        // TODO: create dedicated ReviewerAdder use case
 
                        $articleStore = 
Extension::globalInstance()->newArticleStore();
diff --git a/includes/actions/CompareAction.php 
b/includes/actions/CompareAction.php
index e6b8d5a..626bf3b 100644
--- a/includes/actions/CompareAction.php
+++ b/includes/actions/CompareAction.php
@@ -42,12 +42,10 @@
                $object = $this->page->getTable()->getFromTitle( 
$this->getTitle() );
                $req = $this->getRequest();
 
-               if ( $object !== false && $req->getCheck( 'revid' ) ){
-
+               if ( $object !== false && $req->getCheck( 'revid' ) ) {
                        $revision = Revisions::singleton()->selectRow( null, [ 
'id' => $req->getInt( 'revid' ) ] );
 
                        if ( $revision !== false ) {
-
                                // Check whether user has full course edit 
rights.
                                // If not, hide the enrollment token from the 
diff.
                                if ( $this->getUser()->isAllowed( 
$this->page->getEditRight() ) ) {
diff --git a/includes/actions/DeleteAction.php 
b/includes/actions/DeleteAction.php
index ecaa102..18dde12 100644
--- a/includes/actions/DeleteAction.php
+++ b/includes/actions/DeleteAction.php
@@ -17,6 +17,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class DeleteAction extends Action {
+
        /**
         * @see Action::getName()
         */
@@ -62,8 +63,9 @@
 
                        // If there are no problems, proceed to delete or show 
the form
                        if ( $canDelete ) {
-
-                               if ( $req->wasPosted() && 
$this->getUser()->matchEditToken( $req->getText( 'deleteToken' ), 
$this->getSalt() ) ) {
+                               if ( $req->wasPosted()
+                                       && $this->getUser()->matchEditToken( 
$req->getText( 'deleteToken' ), $this->getSalt() )
+                               ) {
                                        $success = $this->doDelete( $object );
 
                                        if ( $success ) {
@@ -107,7 +109,6 @@
         *   deleted.
         *
         * @return boolean
-        *
         */
        protected function checkAndHandleRestrictions( $pageObj ) {
                return true;
diff --git a/includes/actions/DeleteOrgAction.php 
b/includes/actions/DeleteOrgAction.php
index 302941f..8c5f20b 100644
--- a/includes/actions/DeleteOrgAction.php
+++ b/includes/actions/DeleteOrgAction.php
@@ -27,7 +27,6 @@
         * @param Org $org The Org to be deleted.
         *
         * @return boolean
-        *
         */
        protected function checkAndHandleRestrictions( $org ) {
                $deletionHelper = new OrgDeletionHelper( $org, $this->context );
diff --git a/includes/actions/EditAction.php b/includes/actions/EditAction.php
index 6789f37..38e6fa7 100644
--- a/includes/actions/EditAction.php
+++ b/includes/actions/EditAction.php
@@ -44,8 +44,6 @@
        protected $table;
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param Page $page
@@ -125,14 +123,11 @@
                        $out->redirect( $this->getTitle()->getLocalURL() );
                } else {
                        if ( $object === false ) {
-
                                // Note: this fragment of code is only executed 
by
                                // EditOrgAction, that is, when the user tries 
to edit an
                                // institution. The conditions for displaying 
an undeletion
                                // link for courses are checked in 
EditCourseAction::onView().
-                               if ( $this->getUser()
-                                       ->isAllowed( 
$this->page->getEditRight() ) ) {
-
+                               if ( $this->getUser()->isAllowed( 
$this->page->getEditRight() ) ) {
                                        $this->displayUndeletionLink();
                                }
 
@@ -490,7 +485,6 @@
         * @param array $fields
         */
        protected function handleKnownFields( array &$fields ) {
-
        }
 
        /**
diff --git a/includes/actions/EditCourseAction.php 
b/includes/actions/EditCourseAction.php
index 6f91555..97e5a85 100644
--- a/includes/actions/EditCourseAction.php
+++ b/includes/actions/EditCourseAction.php
@@ -17,9 +17,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class EditCourseAction extends EditAction {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param Page $page
@@ -79,7 +78,6 @@
                $identifier = Courses::normalizeTitle( 
$this->getTitle()->getText() );
 
                if ( !$this->isNewPost() && !$this->table->hasIdentifier( 
$identifier ) ) {
-
                        // Get the most recent revision here, so we can check 
that the
                        // institution hasn't been deleted before displaying 
undelete
                        // info.
@@ -92,7 +90,6 @@
 
                        // Make sure there are indeed previous revisions to 
undelete
                        if ( $latestRevision !== false ) {
-
                                // use CourseUndeletionHelper to check 
restrictions on
                                // undeletion and display a message if we can't 
undelete.
                                $undeletionHelper = new CourseUndeletionHelper(
@@ -193,9 +190,7 @@
                ];
 
                // Only show remaining controls if the user has sufficient 
rights.
-               if ( $this->getUser()->isAllowed(
-                       $this->getManagementRestriction() ) ) {
-
+               if ( $this->getUser()->isAllowed( 
$this->getManagementRestriction() ) ) {
                        $fields['token'] = [
                                'type' => 'text',
                                'label-message' => 'ep-course-edit-token',
@@ -384,7 +379,6 @@
         * @param array $fields
         */
        protected function handleKnownFields( array &$fields ) {
-
                // Set fields that are needed, but immutable
                $title = $this->getTitle();
                $fields['title'] = $title;
@@ -399,9 +393,7 @@
                unset ( $fields['field'], $fields['level'] );
 
                // Prevent unauthorized users from changing certain fields
-               if ( !$this->getUser()->isAllowed(
-                       $this->getManagementRestriction() ) ) {
-
+               if ( !$this->getUser()->isAllowed( 
$this->getManagementRestriction() ) ) {
                        unset( $fields['token'], $fields['start'], 
$fields['end'],
                                $fields['lang'] );
                }
diff --git a/includes/actions/EditOrgAction.php 
b/includes/actions/EditOrgAction.php
index b5cd7b5..f4e2e7d 100644
--- a/includes/actions/EditOrgAction.php
+++ b/includes/actions/EditOrgAction.php
@@ -17,9 +17,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class EditOrgAction extends EditAction {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param Page $page
diff --git a/includes/actions/HistoryAction.php 
b/includes/actions/HistoryAction.php
index 2aac72c..c3c1159 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -102,7 +102,7 @@
                                        false,
                                        [ 'id' => 'mw-history-search' ]
                                ) .
-                               Html::hidden( 'title', 
$this->getTitle()->getPrefixedDBKey() ) . "\n" .
+                               Html::hidden( 'title', 
$this->getTitle()->getPrefixedDBkey() ) . "\n" .
                                Html::hidden( 'action', 'history' ) . "\n" .
                                Xml::dateMenu( $year, $month ) . '&#160;' .
                                ( $tagSelector ? ( implode( '&#160;', 
$tagSelector ) . '&#160;' ) : '' ) .
diff --git a/includes/actions/RemoveArticleAction.php 
b/includes/actions/RemoveArticleAction.php
index 4bcff23..83d2767 100644
--- a/includes/actions/RemoveArticleAction.php
+++ b/includes/actions/RemoveArticleAction.php
@@ -27,10 +27,10 @@
         */
        public function onView() {
                $req = $this->getRequest();
+               $salt = 'remarticle' . $req->getInt( 'article-id' );
                $user = $this->getUser();
 
-               if ( $user->matchEditToken( $req->getText( 'token' ), 
'remarticle' . $req->getInt( 'article-id' ) ) ) {
-
+               if ( $user->matchEditToken( $req->getText( 'token' ), $salt ) ) 
{
                        // TODO: create dedicated ArticleRemover use case
 
                        $articleStore = 
Extension::globalInstance()->newArticleStore();
@@ -39,8 +39,8 @@
 
                        if ( $article !== false
                                && $article->userCanRemove( $this->getUser() )
-                               && $articleStore->deleteArticle( 
$article->getId() ) ) {
-
+                               && $articleStore->deleteArticle( 
$article->getId() )
+                       ) {
                                $article->logRemoval( $this->getUser() );
                        }
                }
diff --git a/includes/actions/RemoveReviewerAction.php 
b/includes/actions/RemoveReviewerAction.php
index 0bbf1a9..78e8ddb 100644
--- a/includes/actions/RemoveReviewerAction.php
+++ b/includes/actions/RemoveReviewerAction.php
@@ -33,8 +33,8 @@
                $salt = $userIdToRemove . 'remreviewer' . $req->getInt( 
'article-id' );
 
                if ( $user->matchEditToken( $req->getText( 'token' ), $salt )
-                       && ( $user->getId() === $userIdToRemove || 
$user->isAllowed( 'ep-remreviewer' ) ) ) {
-
+                       && ( $user->getId() === $userIdToRemove || 
$user->isAllowed( 'ep-remreviewer' ) )
+               ) {
                        // TODO: create dedicated ReviewerRemover use case
 
                        $articleStore = 
Extension::globalInstance()->newArticleStore();
diff --git a/includes/actions/RemoveStudentAction.php 
b/includes/actions/RemoveStudentAction.php
index ecf2fab..04ae361 100644
--- a/includes/actions/RemoveStudentAction.php
+++ b/includes/actions/RemoveStudentAction.php
@@ -26,7 +26,6 @@
         * @see FormlessAction::onView()
         */
        public function onView() {
-
                $req = $this->getRequest();
 
                $api = new \ApiMain( new \DerivativeRequest(
diff --git a/includes/actions/UndeleteAction.php 
b/includes/actions/UndeleteAction.php
index 30a0620..4273b4b 100644
--- a/includes/actions/UndeleteAction.php
+++ b/includes/actions/UndeleteAction.php
@@ -116,28 +116,25 @@
         * @param EPRevision $revision The latest revision of the object to 
undelete
         *
         * @return boolean
-        *
         */
        protected function checkAndHandleRestrictions( $revision ) {
-
                // only worrying about restrictions for courses, specifically
                // checking that the associated institution is not also deleted
-               if ( get_class( $this->page ) === 'EducationProgram\CoursePage' 
) {
-
+               if ( $this->page instanceof CoursePage ) {
                        $undeletionHelper = new CourseUndeletionHelper(
-                                       $revision, $this->context, $this->page 
);
+                               $revision,
+                               $this->context,
+                               $this->page
+                       );
 
-                       if ( $undeletionHelper->checkRestrictions() ) {
-                               return true;
-                       } else {
+                       if ( !$undeletionHelper->checkRestrictions() ) {
                                $undeletionHelper->outputCantUndeleteMsg();
                                return false;
                        }
+               }
 
                // institutions are always good
-               } else {
-                       return true;
-               }
+               return true;
        }
 
        /**
@@ -233,4 +230,5 @@
                        $this->getTitle()->getText()
                )->text();
        }
+
 }
diff --git a/includes/actions/ViewAction.php b/includes/actions/ViewAction.php
index fa130aa..3ec1cc7 100644
--- a/includes/actions/ViewAction.php
+++ b/includes/actions/ViewAction.php
@@ -33,8 +33,6 @@
        protected $object = null;
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param Page $page
diff --git a/includes/actions/ViewCourseAction.php 
b/includes/actions/ViewCourseAction.php
index 9358c62..eae0112 100644
--- a/includes/actions/ViewCourseAction.php
+++ b/includes/actions/ViewCourseAction.php
@@ -22,8 +22,6 @@
 class ViewCourseAction extends ViewAction {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param Page $page
@@ -153,10 +151,9 @@
 
                $user = $this->getUser();
 
-               if ( $user->isAllowed( 'ep-addstudent' ) || 
RoleObject::isInRoleObjArray(
-                       $user->getId(),
-                       $course->getAllNonStudentRoleObjs() ) ) {
-
+               if ( $user->isAllowed( 'ep-addstudent' )
+                       || RoleObject::isInRoleObjArray( $user->getId(), 
$course->getAllNonStudentRoleObjs() )
+               ) {
                        $html .= $this->getAddStudentsControls( $course );
                }
 
@@ -298,7 +295,6 @@
        }
 
        protected function getAddStudentsControls( $course ) {
-
                // add the required client-side module
                $this->getOutput()->addModules( 'ep.addstudents' );
 
@@ -307,14 +303,12 @@
                // expanded. Otherwise, they start out collapsed.
                $queryVals = 
$this->getContext()->getRequest()->getQueryValues();
 
-               if ( isset ( $queryVals['studentsadded'] ) ||
-                       isset ( $queryVals['alreadyenrolled'] ) ) {
-
+               if ( isset( $queryVals['studentsadded'] )
+                       || isset( $queryVals['alreadyenrolled'] )
+               ) {
                        $collapsedClassStr = '';
                        $expandMsg = $this->msg( 'collapsible-collapse' 
)->text();
-
                } else {
-
                        $collapsedClassStr = ' mw-collapsed';
                        $expandMsg = $this->msg( 'collapsible-expand' )->text();
                }
diff --git a/includes/actions/ViewOrgAction.php 
b/includes/actions/ViewOrgAction.php
index 7e4c7b0..0458847 100644
--- a/includes/actions/ViewOrgAction.php
+++ b/includes/actions/ViewOrgAction.php
@@ -18,9 +18,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class ViewOrgAction extends ViewAction {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         *
         * @param Page $page
diff --git a/includes/api/ApiAddStudents.php b/includes/api/ApiAddStudents.php
index 28e43da..e5fa337 100644
--- a/includes/api/ApiAddStudents.php
+++ b/includes/api/ApiAddStudents.php
@@ -37,10 +37,9 @@
                $user = $this->getUser();
 
                // check that the user can do this
-               if ( !$user->isAllowed( 'ep-addstudent' ) && 
!RoleObject::isInRoleObjArray(
-                               $user->getId(),
-                               $course->getAllNonStudentRoleObjs() ) ) {
-
+               if ( !$user->isAllowed( 'ep-addstudent' )
+                       && !RoleObject::isInRoleObjArray( $user->getId(), 
$course->getAllNonStudentRoleObjs() )
+               ) {
                        if ( is_callable( [ $this, 'checkUserRightsAny' ] ) ) {
                                $this->checkUserRightsAny( 'ep-addstudent' );
                        } else {
@@ -81,8 +80,7 @@
 
                // if there are invalid user names, don't add any users, but do 
send a
                // result with these validation results
-               if ( count( $invalidUserNames ) > 0 ) {
-
+               if ( $invalidUserNames !== [] ) {
                        $r->addValue( null, 'success', false );
                        $r->addValue( null, 'usersAddedCount', 0 );
 
@@ -92,7 +90,6 @@
 
                // otherwise add the users
                } else {
-
                        $revAction = new RevisionAction();
                        $revAction->setUser( $user );
                        $addedUserIds = [];
@@ -103,17 +100,13 @@
                        // We have to test for actual faleshood, not falsiness, 
since
                        // we might get 0 if no users were added due to all of 
them
                        // already being enrolled.
-                       if ( $enlistmentResult === false ||
-                               $enlistmentResult != count( $addedUserIds ) ) {
-
+                       if ( $enlistmentResult === false || $enlistmentResult 
!= count( $addedUserIds ) ) {
                                if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
                                        $this->dieWithError( 
'apierror-unknownerror-nocode', 'internal-error' );
                                } else {
                                        $this->dieUsage( 'Somthing bad 
happened.', 'internal-error' );
                                }
-
                        } else {
-
                                $r->addValue( null, 'success', true );
 
                                // Don't worry about not sending the following 
data if
@@ -147,7 +140,6 @@
                                                User::newFromId( 
$alreadyEnrolledIds[0] )
                                                ->getOption( 'gender' ) );
                                }
-
                        }
                }
        }
@@ -220,4 +212,5 @@
                                => 'apihelp-addstudents-example-1',
                ];
        }
+
 }
diff --git a/includes/api/ApiDeleteEducation.php 
b/includes/api/ApiDeleteEducation.php
index c150f68..f44712b 100644
--- a/includes/api/ApiDeleteEducation.php
+++ b/includes/api/ApiDeleteEducation.php
@@ -61,9 +61,7 @@
 
                // If we're deleting institutions, we'll do some extra checks
                if ( $params['type'] === 'org' ) {
-
                        foreach ( $params['ids'] as $id ) {
-
                                $org = Orgs::singleton()
                                        ->selectRow( null, [ 'id' => $id ] );
 
diff --git a/includes/api/ApiEnlist.php b/includes/api/ApiEnlist.php
index 053a447..ea7e34c 100644
--- a/includes/api/ApiEnlist.php
+++ b/includes/api/ApiEnlist.php
@@ -17,6 +17,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class ApiEnlist extends ApiBase {
+
        public function execute() {
                $params = $this->extractRequestParams();
 
diff --git a/includes/api/ApiListStudents.php b/includes/api/ApiListStudents.php
index 1b0eea6..5c71b3d 100644
--- a/includes/api/ApiListStudents.php
+++ b/includes/api/ApiListStudents.php
@@ -19,7 +19,6 @@
 class ApiListStudents extends ApiBase {
 
        public function execute() {
-
                // This creates an array of all the submitted parameters of the 
API call.
                $params = $this->extractRequestParams();
 
@@ -44,7 +43,6 @@
                // Now go through each of the submitted course IDs,
                // and add all the student users from that course.
                foreach ( $courseIds as $courseId ) {
-
                        // Get the course, or die if the course id is invalid.
                        $course = Courses::singleton()->selectRow(
                                null, [ 'id' => $courseId ] );
@@ -77,7 +75,6 @@
                        // If the 'group' parameter is given, get details for
                        // students from this course to the list and display 
them.
                        if ( $params['group'] ) {
-
                                $this->outputCourseProperties(
                                        $courseId,
                                        $course,
@@ -88,7 +85,6 @@
                                // If 'csv' parameter is given,
                                // format and display the results as CSV for 
each course.
                                if ( $params['csv'] ) {
-
                                        $this->outputCSVofStudentProperties(
                                                $courseStudents,
                                                $propName,
@@ -135,12 +131,10 @@
                                                $courseIndex,
                                                $articleStore
                                        );
-
                                }
 
-                       $courseIndex++;
+                               $courseIndex++;
                        }
-
                }
 
                // If not grouping by course, format and display the results 
after students
@@ -160,7 +154,6 @@
                                        null,
                                        $articleStore
                                );
-
                        } else {
                                $this->outputListOfStudentProperties(
                                        $allStudents,
@@ -171,7 +164,6 @@
                                        $articleStore
                                );
                        }
-
                } else {
                        // Replace all the instances of $courseIndex in the 
results.
                        if ( defined( 'ApiResult::META_CONTENT' ) ) {
@@ -194,7 +186,6 @@
         * @return array of user objects
         */
        protected function getParticipantsAsUsers( Course $course, $courseRole 
) {
-
                if ( $courseRole == 'instructor' ) {
                        $participants = $course->getInstructors();
                } elseif ( $courseRole == 'online_volunteer' ) {
@@ -249,7 +240,6 @@
                $courseIndex = null,
                $articleStore
        ) {
-
                $studentProps = [];
 
                foreach ( $studentsList as $student ) {
@@ -277,7 +267,6 @@
                                $articleStore
                        );
                }
-
        }
 
        /**
@@ -296,7 +285,6 @@
                $courseIndex,
                $courseRole
        ) {
-
                // Determine the plural of the role name.
                $courseRolePlural = $courseRole . 's';
 
@@ -307,7 +295,6 @@
                $participantIndex = 0;
 
                foreach ( $participantList as $participant ) {
-
                        // Add username to the result.
                        $results->addValue(
                                $this->userPath( $courseIndex, 
$courseRolePlural, $participantIndex ),
@@ -360,11 +347,10 @@
                $courseIndex = null,
                $articleStore
        ) {
-
                // Add the properties for each student to the result.
                $studentIndex = 0;
-               foreach ( $studentsList as $student ) {
 
+               foreach ( $studentsList as $student ) {
                        // Add username to the result.
                        $results->addValue(
                                $this->userPath( $courseIndex, 'students', 
$studentIndex ),
@@ -421,7 +407,6 @@
                                                        $articleReviewer
                                                );
                                                $reviewerIndex++;
-
                                        }
 
                                        // Index the reviewers for the article.
@@ -433,8 +418,8 @@
                                                        'reviewer'
                                                );
                                        }
-                                       $articleIndex++;
 
+                                       $articleIndex++;
                                }
 
                                // Index the articles for the student.
@@ -452,7 +437,6 @@
                        }
 
                        $studentIndex++;
-
                }
 
                // Index the students.
@@ -486,7 +470,6 @@
                $courseIndex = null,
                $articleStore
        ) {
-
                $articleNames = $this->getArticleNames( $courseIds, 
$studentsList, $articleStore );
 
                if ( $articleNames ) {
@@ -510,7 +493,6 @@
                                'articles'
                        );
                }
-
        }
 
        /**
@@ -522,8 +504,11 @@
         * @param \ApiResult $results
         */
        protected function outputCourseProperties(
-               $courseId, $course, $courseIndex, $results ) {
-
+               $courseId,
+               $course,
+               $courseIndex,
+               $results
+       ) {
                // Use an unambiguous name for the course that
                // includes the institution, title, term and ID.
 
@@ -556,7 +541,6 @@
                        'end',
                        $enddate
                );
-
        }
 
        /**
@@ -569,7 +553,6 @@
         * @return array
         */
        protected function getArticleNames( $courseIds, $students, 
$articleStore ) {
-
                // Turn array of student objects into array of corresponding 
user IDs.
                foreach ( $students as $student ) {
                        $studentIds[] = $student->getId();
@@ -596,7 +579,6 @@
         * @return array
         */
        protected function getEPArticles( $courseId, $student, $articleStore ) {
-
                $studentId = $student->getId();
 
                // These are EPArticle objects, not conventional articles.
@@ -612,7 +594,6 @@
         * @return array
         */
        protected function getArticleReviewerIds( EPArticle $epArticle ) {
-
                $reviewerIds = $epArticle->getReviewers();
 
                return $reviewerIds;
@@ -750,4 +731,5 @@
                                => 'apihelp-liststudents-example-3',
                ];
        }
+
 }
diff --git a/includes/notifications/CampusAddNotification.php 
b/includes/notifications/CampusAddNotification.php
index 8ca6f51..b0f9adb 100644
--- a/includes/notifications/CampusAddNotification.php
+++ b/includes/notifications/CampusAddNotification.php
@@ -15,6 +15,7 @@
  */
 
 class CampusAddNotification extends RoleAddNotification {
+
        const KEY = 'ep-campus-add-notification';
 
        /**
@@ -24,4 +25,5 @@
        public function getKey() {
                return CampusAddNotification::KEY;
        }
+
 }
diff --git a/includes/notifications/CourseTalkNotification.php 
b/includes/notifications/CourseTalkNotification.php
index eb5e436..76bd03d 100644
--- a/includes/notifications/CourseTalkNotification.php
+++ b/includes/notifications/CourseTalkNotification.php
@@ -50,7 +50,6 @@
         * @see EducationProgram.INotificationType::getUsersNotified()
         */
        public function getUsersNotified( \EchoEvent $event, array &$users ) {
-
                // We assume that title is an EP course talk page title.
                $course = Extension::globalInstance()->newCourseStore()
                        ->getCourseByTitle( $event->getTitle()->getText() );
@@ -78,7 +77,6 @@
         * @see EducationProgram.INotificationType::trigger()
         */
        public function trigger( $params ) {
-
                $title = $params['course-talk-title'];
 
                // Don't send notifications for sub-talk-pages or if if the 
course
diff --git a/includes/notifications/InstructorAddNotification.php 
b/includes/notifications/InstructorAddNotification.php
index 061dc8e..11268d0 100644
--- a/includes/notifications/InstructorAddNotification.php
+++ b/includes/notifications/InstructorAddNotification.php
@@ -15,6 +15,7 @@
  */
 
 class InstructorAddNotification extends RoleAddNotification {
+
        const KEY = 'ep-instructor-add-notification';
 
        /**
@@ -24,4 +25,5 @@
        public function getKey() {
                return InstructorAddNotification::KEY;
        }
+
 }
diff --git a/includes/notifications/NotificationsManager.php 
b/includes/notifications/NotificationsManager.php
index d38eca3..4c8cc92 100644
--- a/includes/notifications/NotificationsManager.php
+++ b/includes/notifications/NotificationsManager.php
@@ -33,7 +33,7 @@
         *
         * @since 0.4 alpha
         *
-        * @var array
+        * @var INotificationType[]
         */
        private $typesByKey = [];
 
@@ -57,6 +57,7 @@
         *   EducationProgram/INotificationType
         */
        public function registerType( $typeName ) {
+               /** @var INotificationType $type */
                $type = new $typeName();
                $this->typesByKey[$type->getKey()] = $type;
        }
@@ -73,16 +74,17 @@
         * @param array $notificationCategories
         * @param array $icons
         */
-       public function setUpTypesAndCategories( array &$notifications,
-                       array &$notificationCategories, array &$icons ) {
-
+       public function setUpTypesAndCategories(
+               array &$notifications,
+               array &$notificationCategories,
+               array &$icons
+       ) {
                // register the category
                $notificationCategories[NotificationsManager::CATEGORY] = [
                        'tooltip' => 'ep-echo-pref-tooltip',
                ];
 
                foreach ( $this->typesByKey as $typeKey => $type ) {
-
                        $params = $type->getParameters();
 
                        // tell Echo about the notification type
@@ -114,7 +116,6 @@
         * @param $users array
         */
        public function getUsersNotified( \EchoEvent $event, array &$users ) {
-
                $key = $event->getType();
 
                if ( isset( $this->typesByKey[$key] ) ) {
@@ -131,7 +132,6 @@
         *   (not the same as the parameters for EchoEvent::create()).
         */
        public function trigger( $key, array $parameters ) {
-
                if ( !isset( $this->typesByKey[$key] ) ) {
                        throw new \InvalidArgumentException(
                                'No notification type for key ' . $key );
diff --git a/includes/notifications/OnlineAddNotification.php 
b/includes/notifications/OnlineAddNotification.php
index ace581f..f4a5ff9 100644
--- a/includes/notifications/OnlineAddNotification.php
+++ b/includes/notifications/OnlineAddNotification.php
@@ -15,6 +15,7 @@
  */
 
 class OnlineAddNotification extends RoleAddNotification {
+
        const KEY = 'ep-online-add-notification';
 
        /**
@@ -24,4 +25,5 @@
        public function getKey() {
                return OnlineAddNotification::KEY;
        }
+
 }
diff --git a/includes/notifications/PresentationModel/CourseTalk.php 
b/includes/notifications/PresentationModel/CourseTalk.php
index 0bfcbf3..ae501b6 100644
--- a/includes/notifications/PresentationModel/CourseTalk.php
+++ b/includes/notifications/PresentationModel/CourseTalk.php
@@ -3,6 +3,7 @@
 namespace EducationProgram\PresentationModel;
 
 class CourseTalk extends RoleAdd {
+
        /**
         * {@inheritdoc}
         */
diff --git a/includes/notifications/RoleAddNotification.php 
b/includes/notifications/RoleAddNotification.php
index 6b31872..fb56201 100644
--- a/includes/notifications/RoleAddNotification.php
+++ b/includes/notifications/RoleAddNotification.php
@@ -43,7 +43,6 @@
         * @see EducationProgram.INotificationType::getUsersNotified()
         */
        public function getUsersNotified( \EchoEvent $event, array &$users ) {
-
                // Notify the user(s) added to a course
                $usersToAddIds = $event->getExtraParam( 'users' );
 
diff --git a/includes/notifications/StudentAddNotification.php 
b/includes/notifications/StudentAddNotification.php
index 5945b1b..f5eb2d2 100644
--- a/includes/notifications/StudentAddNotification.php
+++ b/includes/notifications/StudentAddNotification.php
@@ -15,6 +15,7 @@
  */
 
 class StudentAddNotification extends RoleAddNotification {
+
        const KEY = 'ep-student-add-notification';
 
        /**
@@ -24,4 +25,5 @@
        public function getKey() {
                return StudentAddNotification::KEY;
        }
+
 }
diff --git a/includes/pagers/ArticleTable.php b/includes/pagers/ArticleTable.php
index 03df3cf..0493ede 100644
--- a/includes/pagers/ArticleTable.php
+++ b/includes/pagers/ArticleTable.php
@@ -73,8 +73,6 @@
        protected $showStudents = true;
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         * @param int[]|int $courseIds
@@ -82,8 +80,13 @@
         * @param Course $course The course object or these articles. Should be 
sent
         *   when the table is for only one course.
         */
-       public function __construct( IContextSource $context, array $conds = [],
-                       $courseIds, array $userIds = null, $course = null ) {
+       public function __construct(
+               IContextSource $context,
+               array $conds = [],
+               $courseIds,
+               array $userIds = null,
+               $course = null
+       ) {
                $this->mDefaultDirection = true;
                $this->courseIds = (array)$courseIds;
                $this->userIds = $userIds;
@@ -169,16 +172,15 @@
                        // an instructor, an online ambassador or a campus 
ambassador
                        // for this course.
                        ( !is_null( $this->course ) && ( 
RoleObject::isInRoleObjArray(
-                               $userId, 
$this->course->getAllNonStudentRoleObjs() ) ) ) ) ) {
-
-                               $showArticleAddition = true;
+                               $userId, 
$this->course->getAllNonStudentRoleObjs() ) ) ) )
+               ) {
+                       $showArticleAddition = true;
                }
 
                // initial calculation for row count
                $rowCount = array_reduce(
                        $articles,
                        function( /* integer */ $sum, EPArticle $article ) use 
( $user ) {
-
                                // At least one row per article the student has 
to review;
                                // for articles that have more than one 
reviewer, provide extra rows for them.
                                $reviewersCount = count( 
$article->getReviewers() );
@@ -308,9 +310,7 @@
 
                $html = Linker::userLink( $userId, $user->getName(), $realName 
);
 
-               if ( $this->getUser()->isAllowed( 'ep-remstudent' )
-                       && $this->isForOneCourse() ) {
-
+               if ( $this->getUser()->isAllowed( 'ep-remstudent' ) && 
$this->isForOneCourse() ) {
                        $html .= Utils::getToolLinks(
                                $userId,
                                $user->getName(),
diff --git a/includes/pagers/CAPager.php b/includes/pagers/CAPager.php
index 456aef1..9aa20f2 100644
--- a/includes/pagers/CAPager.php
+++ b/includes/pagers/CAPager.php
@@ -17,8 +17,6 @@
 class CAPager extends OAPager {
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         */
diff --git a/includes/pagers/CoursePager.php b/includes/pagers/CoursePager.php
index ff36018..14b8ef5 100644
--- a/includes/pagers/CoursePager.php
+++ b/includes/pagers/CoursePager.php
@@ -15,6 +15,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class CoursePager extends EPPager {
+
        /**
         * When in read only mode, the pager should not show any course editing 
controls.
         *
@@ -33,8 +34,6 @@
        protected $orgNames;
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         * @param boolean $readOnlyMode
@@ -268,8 +267,8 @@
                if ( !$this->readOnlyMode
                        && $this->getUser()->isAllowed( 'ep-course' )
                        && $this->getUser()->isAllowed( 'ep-bulkdelcourses' )
-                       && $this->getUser()->getOption( 'ep_bulkdelcourses' ) ) 
{
-
+                       && $this->getUser()->getOption( 'ep_bulkdelcourses' )
+               ) {
                        $actions[$this->msg( 'ep-pager-delete-selected' 
)->text()] = [
                                'class' => 'ep-pager-delete-selected',
                                'data-type' => 
ApiDeleteEducation::getTypeForClassName( get_class( $this->table ) )
diff --git a/includes/pagers/EPPager.php b/includes/pagers/EPPager.php
index 4a38a1f..bd150a4 100644
--- a/includes/pagers/EPPager.php
+++ b/includes/pagers/EPPager.php
@@ -54,8 +54,6 @@
        protected $enableFilter = true;
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         * @param IORMTable $table
diff --git a/includes/pagers/OAPager.php b/includes/pagers/OAPager.php
index 103ad83..8134265 100644
--- a/includes/pagers/OAPager.php
+++ b/includes/pagers/OAPager.php
@@ -25,8 +25,6 @@
        protected $currentObject;
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         * @param IORMTable|null $table
diff --git a/includes/pagers/OrgPager.php b/includes/pagers/OrgPager.php
index 652bc6a..8b85414 100644
--- a/includes/pagers/OrgPager.php
+++ b/includes/pagers/OrgPager.php
@@ -65,8 +65,6 @@
        }
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         */
@@ -210,7 +208,6 @@
 
                        // Check restrictions before adding deletion link
                        if ( $this->currentDelHelper->checkRestrictions() ) {
-
                                $links[] = $this->getDeletionLink(
                                        
ApiDeleteEducation::getTypeForClassName( get_class( $this->table ) ),
                                        $item->getId(),
@@ -230,8 +227,8 @@
 
                if ( $this->getUser()->isAllowed( 'ep-org' )
                        && $this->getUser()->isAllowed( 'ep-bulkdelorgs' )
-                       && $this->getUser()->getOption( 'ep_bulkdelorgs' ) ) {
-
+                       && $this->getUser()->getOption( 'ep_bulkdelorgs' )
+               ) {
                        $actions[$this->msg( 'ep-pager-delete-selected' 
)->text()] = [
                                'class' => 'ep-pager-delete-selected',
                                'data-type' => 
ApiDeleteEducation::getTypeForClassName( get_class( $this->table ) )
diff --git a/includes/pagers/RevisionPager.php 
b/includes/pagers/RevisionPager.php
index 686e3c9..6217542 100644
--- a/includes/pagers/RevisionPager.php
+++ b/includes/pagers/RevisionPager.php
@@ -33,8 +33,6 @@
        protected $rowNr = 0;
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param PageTable $table
         * @param array $conds
@@ -135,7 +133,6 @@
                                        [ 'revid' => $revision->getId() ]
                                );
                        }
-
                }
 
                // Any user can do the compare action.
@@ -204,4 +201,5 @@
        function getIndexField() {
                return Revisions::singleton()->getPrefixedField( 'time' );
        }
+
 }
diff --git a/includes/pagers/StudentActivityPager.php 
b/includes/pagers/StudentActivityPager.php
index 5e985e8..3d64470 100644
--- a/includes/pagers/StudentActivityPager.php
+++ b/includes/pagers/StudentActivityPager.php
@@ -16,6 +16,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class StudentActivityPager extends EPPager {
+
        /**
         * List of user ids mapped to user names and real names, set in 
doBatchLookups.
         * The real names will just hold the user name when no real name is set.
@@ -54,8 +55,6 @@
        protected $orgData = [];
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         */
diff --git a/includes/pagers/StudentPager.php b/includes/pagers/StudentPager.php
index 4e33544..10c97d8 100644
--- a/includes/pagers/StudentPager.php
+++ b/includes/pagers/StudentPager.php
@@ -36,8 +36,6 @@
        protected $courseTitles = [];
 
        /**
-        * Constructor.
-        *
         * @param IContextSource $context
         * @param array $conds
         */
diff --git a/includes/pages/EducationPage.php b/includes/pages/EducationPage.php
index d6f73b9..3c077bc 100644
--- a/includes/pages/EducationPage.php
+++ b/includes/pages/EducationPage.php
@@ -75,7 +75,6 @@
        }
 
        public function view() {
-
        }
 
        public function getPage() {
diff --git a/includes/rows/Course.php b/includes/rows/Course.php
index 11d2224..cf15a58 100644
--- a/includes/rows/Course.php
+++ b/includes/rows/Course.php
@@ -18,6 +18,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class Course extends PageObject {
+
        /**
         * Field for caching the linked org.
         *
@@ -141,7 +142,6 @@
                $success = parent::insert( $functionName, $options );
 
                if ( $success && $this->updateSummaries ) {
-
                        // these are the only org summary fields that could 
need updating
                        $this->updateOrgSummaryFields( null,
                                        [ 'course_count', 'last_active_date' ] 
);
@@ -168,7 +168,6 @@
         * @see RevisionedObject::onUpdated()
         */
        protected function onUpdated( RevisionedObject $originalCourse ) {
-
                // add and remove rows from ep_users_per_course as needed
                $newUserIdsAndRoles = [];
                $dbm = wfGetDB( DB_MASTER );
@@ -204,13 +203,11 @@
 
                // update summary data for this course's institution
                if ( $this->updateSummaries ) {
-
                        $this->updateOrgSummaryFields( 
$originalCourse->getField( 'org_id' ) );
 
-                       if ( $this->hasField( 'org_id' ) &&
-                               $originalCourse->getField( 'org_id' ) !==
-                               $this->getField( 'org_id' ) ) {
-
+                       if ( $this->hasField( 'org_id' )
+                               && $originalCourse->getField( 'org_id' ) !== 
$this->getField( 'org_id' )
+                       ) {
                                $this->updateOrgSummaryFields();
                        }
                }
@@ -222,7 +219,6 @@
         * @see EducationProgram\RevisionedObject::onUndeleted()
         */
        protected function onUndeleted() {
-
                // re-create rows to ep_users_per_course table
                $this->upcAdd();
 
@@ -277,15 +273,16 @@
         *   role.
         */
        protected function upcAdd( $userIdsAndRoles=null ) {
-
                // if no param, build the data from this course's user fields
                if ( is_null( $userIdsAndRoles ) ) {
-
                        $userIdsAndRoles = [];
 
-                       foreach ( [ 'online_ambs', 'campus_ambs', 'students',
-                                'instructors' ] as $usersField ) {
-
+                       foreach ( [
+                               'online_ambs',
+                               'campus_ambs',
+                               'students',
+                               'instructors',
+                       ] as $usersField ) {
                                $addedIds = $this->getField( $usersField );
 
                                foreach ( $addedIds as $addedId ) {
@@ -337,7 +334,6 @@
         * @see ORMRow::save()
         */
        public function save( $functionName = null ) {
-
                // Check if we're attempting to create a course that already 
exists.
                // This can happen if the user clicks the "Submit" button of the
                // second form for course creation more than once.
@@ -345,7 +341,6 @@
                        $title = $this->getField( 'title' );
 
                        if ( $this->table->has( [ 'title' => $title ] ) ) {
-
                                $pageTitle = $this->getTitle(); // title of the 
Wiki page
                                throw new ErrorPageErrorWithSelflink( 
'ep-err-course-exists-title',
                                                'ep-err-course-exists-text', 
$pageTitle, $title );
@@ -726,8 +721,13 @@
         *
         * @return integer|bool false The amount of enlisted users or false on 
failiure
         */
-       public function enlistUsers( $newUserIds, $role, $save = true,
-                       RevisionAction $revAction = null, &$addedUserIds = null 
) {
+       public function enlistUsers(
+               $newUserIds,
+               $role,
+               $save = true,
+               RevisionAction $revAction = null,
+               &$addedUserIds = null
+       ) {
                $roleMap = [
                        'student' => 'students',
                        'campus' => 'campus_ambs',
@@ -753,13 +753,11 @@
                        }
 
                        if ( $success ) {
-
                                // If we are enrolling students, then add them 
to the Students
                                // table. There are tables for other roles, but 
of them, only
                                // the tables for volunteers are used, and it's 
not necessary
                                // for those tables to be filled automatically.
                                if ( $role === 'student' ) {
-
                                        foreach ( $usersToAddIds as $userId ) {
                                                $student = 
Student::newFromUserId( $userId, true, 'id' );
                                                $student->onEnrolled( 
$this->getId(), $role );
@@ -863,9 +861,11 @@
        /**
         * @see RevisionedObject::getCompareDiff()
         */
-       public function getCompareDiff( EPRevision $revision, array $fields = 
null,
-               $hidePriviledgedFields = false ) {
-
+       public function getCompareDiff(
+               EPRevision $revision,
+               array $fields = null,
+               $hidePriviledgedFields = false
+       ) {
                $fields = is_null( $fields ) ? 
$this->table->getRevertibleFields() : $fields;
 
                // Check whether to hide 'token' field, which is the only info 
in
@@ -983,4 +983,5 @@
        protected function getTypeId() {
                return $this->table->getRevisionedObjectTypeId();
        }
+
 }
diff --git a/includes/rows/EPArticle.php b/includes/rows/EPArticle.php
index 4160fcd..cf1cbbe 100644
--- a/includes/rows/EPArticle.php
+++ b/includes/rows/EPArticle.php
@@ -104,8 +104,6 @@
        protected $reviewers;
 
        /**
-        * Constructor.
-        *
         * @since 0.3
         *
         * @param int|null $id
diff --git a/includes/rows/IORMRow.php b/includes/rows/IORMRow.php
index 039172c..d0d1b05 100644
--- a/includes/rows/IORMRow.php
+++ b/includes/rows/IORMRow.php
@@ -1,4 +1,5 @@
 <?php
+
 namespace EducationProgram;
 
 /**
diff --git a/includes/rows/ORMRow.php b/includes/rows/ORMRow.php
index 1ccf23f..5f4a444 100644
--- a/includes/rows/ORMRow.php
+++ b/includes/rows/ORMRow.php
@@ -1,4 +1,5 @@
 <?php
+
 namespace EducationProgram;
 
 /**
@@ -34,6 +35,7 @@
  */
 
 class ORMRow implements IORMRow {
+
        /**
         * The fields of the object.
         * field name (w/o prefix) => value
@@ -74,8 +76,6 @@
        protected $table;
 
        /**
-        * Constructor.
-        *
         * @since 1.20
         *
         * @param IORMTable|null $table Deprecated since 1.22
diff --git a/includes/rows/Org.php b/includes/rows/Org.php
index e5f7b5a..22bfbab 100644
--- a/includes/rows/Org.php
+++ b/includes/rows/Org.php
@@ -17,6 +17,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class Org extends PageObject {
+
        /**
         * Cached array of the linked Course objects.
         *
@@ -38,10 +39,10 @@
                $fields = [];
 
                // load all these fields at once
-               if ( in_array( 'course_count', $summaryFields ) ||
-                       in_array( 'courses', $summaryFields ) ||
-                       in_array( 'last_active_date', $summaryFields ) ) {
-
+               if ( in_array( 'course_count', $summaryFields )
+                       || in_array( 'courses', $summaryFields )
+                       || in_array( 'last_active_date', $summaryFields )
+               ) {
                        $courseInfo = Courses::singleton()->selectFields(
                                [ 'id', 'end' ],
                                [ 'org_id' => $this->getId() ],
@@ -52,7 +53,6 @@
                        $lastActiveDate = '19700101000000'; // typical MW 
timestamp default
 
                        foreach ( $courseInfo as $courseFields ) {
-
                                $courses[] = $courseFields['id'];
 
                                if ( $courseFields['end'] > $lastActiveDate ) {
@@ -166,7 +166,6 @@
                        $name = $this->getField( 'name' );
 
                        if ( $this->table->has( [ 'name' => $name ] ) ) {
-
                                $pageTitle = $this->getTitle(); // title of the 
Wiki page
                                throw new ErrorPageErrorWithSelflink( 
'ep-err-org-exists-title',
                                                'ep-err-org-exists-text', 
$pageTitle, $name );
diff --git a/includes/rows/PageObject.php b/includes/rows/PageObject.php
index a7cba1e..c457ca1 100644
--- a/includes/rows/PageObject.php
+++ b/includes/rows/PageObject.php
@@ -16,6 +16,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 abstract class PageObject extends RevisionedObject {
+
        /**
         * @see ORMRow::$table
         * @var PageTable
diff --git a/includes/rows/RevisionedObject.php 
b/includes/rows/RevisionedObject.php
index 1c9ddb9..37c9ede 100644
--- a/includes/rows/RevisionedObject.php
+++ b/includes/rows/RevisionedObject.php
@@ -13,6 +13,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 abstract class RevisionedObject extends ORMRow {
+
        /**
         * If the object should log changes.
         * Can be changed via disableLogging and enableLogging.
@@ -436,9 +437,11 @@
         *
         * @return RevisionDiff
         */
-       public function getCompareDiff( EPRevision $revision, array $fields = 
null,
-               $hidePriviledgedFields = false ) {
-
+       public function getCompareDiff(
+               EPRevision $revision,
+               array $fields = null,
+               $hidePriviledgedFields = false
+       ) {
                $fields = is_null( $fields ) ? 
$this->table->getRevertibleFields() : $fields;
 
                return RevisionDiff::newFromCompareRevision( $this, $revision, 
$fields );
diff --git a/includes/specials/SpecialCAProfile.php 
b/includes/specials/SpecialCAProfile.php
index ea75650..6844545 100644
--- a/includes/specials/SpecialCAProfile.php
+++ b/includes/specials/SpecialCAProfile.php
@@ -15,8 +15,6 @@
 class SpecialCAProfile extends SpecialAmbassadorProfile {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialCAs.php b/includes/specials/SpecialCAs.php
index 722b5b5..5483158 100644
--- a/includes/specials/SpecialCAs.php
+++ b/includes/specials/SpecialCAs.php
@@ -17,8 +17,6 @@
 class SpecialCAs extends VerySpecialPage {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialCourses.php 
b/includes/specials/SpecialCourses.php
index aea4a96..5408da3 100644
--- a/includes/specials/SpecialCourses.php
+++ b/includes/specials/SpecialCourses.php
@@ -16,8 +16,6 @@
 class SpecialCourses extends VerySpecialPage {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialDisenroll.php 
b/includes/specials/SpecialDisenroll.php
index 2dfbe2f..9f042bd 100644
--- a/includes/specials/SpecialDisenroll.php
+++ b/includes/specials/SpecialDisenroll.php
@@ -17,9 +17,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class SpecialDisenroll extends VerySpecialPage {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
@@ -48,7 +47,6 @@
                        } else {
                                if ( Student::newFromUser( $this->getUser() 
)->hasCourse( [ 'id' => $course->getId() ] ) ) {
                                        $this->executeEnrolled( $course );
-
                                } else {
                                        $this->showWarning( $this->msg( 
'ep-disenroll-not-enrolled' ) );
                                }
@@ -203,4 +201,5 @@
        protected function getGroupName() {
                return 'education';
        }
+
 }
diff --git a/includes/specials/SpecialEducationProgram.php 
b/includes/specials/SpecialEducationProgram.php
index 14ddeab..709ac6c 100644
--- a/includes/specials/SpecialEducationProgram.php
+++ b/includes/specials/SpecialEducationProgram.php
@@ -15,9 +15,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class SpecialEducationProgram extends VerySpecialPage {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialEnroll.php 
b/includes/specials/SpecialEnroll.php
index c35e71e..0837829 100644
--- a/includes/specials/SpecialEnroll.php
+++ b/includes/specials/SpecialEnroll.php
@@ -18,6 +18,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class SpecialEnroll extends VerySpecialPage {
+
        /**
         * @since 0.1
         * @var Course
@@ -31,8 +32,6 @@
        protected $token = false;
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialInstitutions.php 
b/includes/specials/SpecialInstitutions.php
index b9d90ac..8f1cbdd 100644
--- a/includes/specials/SpecialInstitutions.php
+++ b/includes/specials/SpecialInstitutions.php
@@ -16,8 +16,6 @@
 class SpecialInstitutions extends VerySpecialPage {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialManageCourses.php 
b/includes/specials/SpecialManageCourses.php
index 7d94996..b71e754 100644
--- a/includes/specials/SpecialManageCourses.php
+++ b/includes/specials/SpecialManageCourses.php
@@ -16,9 +16,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class SpecialManageCourses extends VerySpecialPage {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialMyCourses.php 
b/includes/specials/SpecialMyCourses.php
index dc83f4c..2f9c87e 100644
--- a/includes/specials/SpecialMyCourses.php
+++ b/includes/specials/SpecialMyCourses.php
@@ -28,8 +28,6 @@
        protected $courses;
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialOAProfile.php 
b/includes/specials/SpecialOAProfile.php
index 72c5a52..a986826 100644
--- a/includes/specials/SpecialOAProfile.php
+++ b/includes/specials/SpecialOAProfile.php
@@ -15,8 +15,6 @@
 class SpecialOAProfile extends SpecialAmbassadorProfile {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialOAs.php b/includes/specials/SpecialOAs.php
index 330fdeb..d1b23fd 100644
--- a/includes/specials/SpecialOAs.php
+++ b/includes/specials/SpecialOAs.php
@@ -15,8 +15,6 @@
 class SpecialOAs extends VerySpecialPage {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialStudentActivity.php 
b/includes/specials/SpecialStudentActivity.php
index c22ab46..33db693 100644
--- a/includes/specials/SpecialStudentActivity.php
+++ b/includes/specials/SpecialStudentActivity.php
@@ -13,9 +13,8 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
 class SpecialStudentActivity extends VerySpecialPage {
+
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/specials/SpecialStudents.php 
b/includes/specials/SpecialStudents.php
index 64817d3..46869b4 100644
--- a/includes/specials/SpecialStudents.php
+++ b/includes/specials/SpecialStudents.php
@@ -15,8 +15,6 @@
 class SpecialStudents extends VerySpecialPage {
 
        /**
-        * Constructor.
-        *
         * @since 0.1
         */
        public function __construct() {
diff --git a/includes/tables/Courses.php b/includes/tables/Courses.php
index 07aeb9e..df31899 100644
--- a/includes/tables/Courses.php
+++ b/includes/tables/Courses.php
@@ -262,8 +262,13 @@
         *
         * @return ORMResult
         */
-       public function getCoursesForUsers( $userIds = [], $roleIds = [],
-                                                                               
array $conditions = [], $fields = null, array $options = [] ) {
+       public function getCoursesForUsers(
+               $userIds = [],
+               $roleIds = [],
+               array $conditions = [],
+               $fields = null,
+               array $options = []
+       ) {
                $conditions = $this->getPrefixedValues( $conditions );
 
                if ( $userIds !== [] ) {
diff --git a/includes/tables/IORMTable.php b/includes/tables/IORMTable.php
index 2cf3daf..930594c 100644
--- a/includes/tables/IORMTable.php
+++ b/includes/tables/IORMTable.php
@@ -1,4 +1,5 @@
 <?php
+
 namespace EducationProgram;
 
 /**
diff --git a/includes/tables/ORMTable.php b/includes/tables/ORMTable.php
index 1b6ade7..73bbdbe 100644
--- a/includes/tables/ORMTable.php
+++ b/includes/tables/ORMTable.php
@@ -88,8 +88,6 @@
        protected $readDb = DB_SLAVE;
 
        /**
-        * Constructor.
-        *
         * @since 1.21
         *
         * @param string $tableName
@@ -419,8 +417,12 @@
         *
         * @return mixed|array|bool False on failure
         */
-       public function selectFieldsRow( $fields = null, array $conditions = [],
-               array $options = [], $collapse = true, $functionName = null
+       public function selectFieldsRow(
+               $fields = null,
+               array $conditions = [],
+               array $options = [],
+               $collapse = true,
+               $functionName = null
        ) {
                $options['LIMIT'] = 1;
 
diff --git a/includes/tables/Orgs.php b/includes/tables/Orgs.php
index 42666f1..47f21c5 100644
--- a/includes/tables/Orgs.php
+++ b/includes/tables/Orgs.php
@@ -176,7 +176,6 @@
         * @see ORMTable::updateSummaryFields()
         */
        public function updateSummaryFields( $summaryFields = null, array 
$conditions = [] ) {
-
                // We know that updating summary fields will involve reading 
data about
                // courses. If $read_master_for_summraies is set, make sure that
                // the Courses table is reading from master. (The superclass 
will
@@ -184,7 +183,6 @@
                // summaries.)
 
                if ( $this->read_master_for_summaries ) {
-
                        $courses = Courses::singleton();
                        $origReadDB = $courses->getReadDb();
                        $courses->setReadDb( DB_MASTER );
@@ -192,9 +190,9 @@
                        parent::updateSummaryFields( $summaryFields, 
$conditions );
 
                        $courses->setReadDb( $origReadDB );
-
                } else {
                        parent::updateSummaryFields( $summaryFields, 
$conditions );
                }
        }
+
 }
diff --git a/maintenance/fixInvalidStudent.php 
b/maintenance/fixInvalidStudent.php
index 8f26e1a..0aa2d1e 100644
--- a/maintenance/fixInvalidStudent.php
+++ b/maintenance/fixInvalidStudent.php
@@ -37,14 +37,13 @@
        private $dryRun = false;
 
        public function __construct() {
-
                parent::__construct();
+
                $this->addOption( 'courseId', 'ID of the course to repair', 
false, true );
                $this->addOption( 'dryRun', 'Go through the moves but don\'t 
really do anything', false );
        }
 
        public function execute() {
-
                if ( $this->getOption( 'dryRun' ) ) {
                        $this->dryRun = true;
                        $this->output( "Dry run. No changes will be made to the 
DB.\n" );
@@ -101,7 +100,6 @@
                }
 
                if ( !$this->dryRun ) {
-
                        $course->setField( 'students', $students );
                        $course->disableLogging();
 
diff --git a/resources/ep.tagsinput/ep.tagsinput.css 
b/resources/ep.tagsinput/ep.tagsinput.css
index e2c91bf..a9a87e1 100644
--- a/resources/ep.tagsinput/ep.tagsinput.css
+++ b/resources/ep.tagsinput/ep.tagsinput.css
@@ -9,7 +9,6 @@
  *
  * Included in the the Education Program MediaWiki extension.
  * @see https://www.mediawiki.org/wiki/Extension:Education_Program
- *
  */
 .ep-tagsinput {
        background-color: #fff;
diff --git a/tests/phpunit/rows/CourseTest.php 
b/tests/phpunit/rows/CourseTest.php
index 8bc498b..d8ee00a 100644
--- a/tests/phpunit/rows/CourseTest.php
+++ b/tests/phpunit/rows/CourseTest.php
@@ -91,8 +91,9 @@
         * @expectedException \EducationProgram\ErrorPageErrorWithSelflink
         */
        public function testSameTitleRaisesException(
-                       Course $course, Course $duplicateCourse ) {
-
+               Course $course,
+               Course $duplicateCourse
+       ) {
                // Verify that the courses have the same title.
                $this->assertEquals( $course->getField( 'title' ),
                        $duplicateCourse->getField( 'title' ) );
@@ -103,4 +104,5 @@
                // Save the duplicate course. This should throw the exception.
                $duplicateCourse->save();
        }
+
 }
diff --git a/tests/phpunit/rows/OrgTest.php b/tests/phpunit/rows/OrgTest.php
index c0df76a..0e97226 100644
--- a/tests/phpunit/rows/OrgTest.php
+++ b/tests/phpunit/rows/OrgTest.php
@@ -1,4 +1,5 @@
 <?php
+
 namespace EducationProgram\Tests\Rows;
 
 require_once __DIR__ . '/PageObjectTest.php';
@@ -102,8 +103,9 @@
         * @expectedException \EducationProgram\ErrorPageErrorWithSelflink
         */
        public function testSameNameRaisesException(
-                       Org $org, Org $duplicateOrg ) {
-
+               Org $org,
+               Org $duplicateOrg
+       ) {
                // Verify that the orgs have the same name.
                $this->assertEquals( $org->getField( 'name' ),
                        $duplicateOrg->getField( 'name' ) );
@@ -114,4 +116,5 @@
                // Save the duplicate org. This should throw the exception.
                $duplicateOrg->save();
        }
+
 }
diff --git a/tests/phpunit/rows/PageObjectTest.php 
b/tests/phpunit/rows/PageObjectTest.php
index 83f359c..40515d9 100644
--- a/tests/phpunit/rows/PageObjectTest.php
+++ b/tests/phpunit/rows/PageObjectTest.php
@@ -5,6 +5,7 @@
 use EducationProgram\Tests\ORMRowTest;
 
 abstract class PageObjectTest extends ORMRowTest {
+
        /**
         * Provides pairs of duplicate instances for testing the addition of an
         * instance with the same name/title as one that already exists.
diff --git a/tests/phpunit/tables/OrgsTest.php 
b/tests/phpunit/tables/OrgsTest.php
index 2e7bd23..e9c5733 100644
--- a/tests/phpunit/tables/OrgsTest.php
+++ b/tests/phpunit/tables/OrgsTest.php
@@ -66,7 +66,6 @@
 
                        $this->assertEquals( $data[$field], $change->getField( 
$field ) );
                }
-
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/359427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic59090b78d97b4b5d677d505f97d4bf01746d5be
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to