Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/98171


Change subject: Cleanup in Change classes
......................................................................

Cleanup in Change classes

Change-Id: Id16fd7525c10715bf543e3194d431105b25cdc46
---
M lib/includes/changes/Change.php
M lib/includes/changes/ChangeRow.php
M lib/includes/changes/DiffChange.php
M lib/includes/changes/EntityChange.php
M lib/includes/changes/ItemChange.php
5 files changed, 21 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/71/98171/1

diff --git a/lib/includes/changes/Change.php b/lib/includes/changes/Change.php
index 19f4757..95aab8a 100644
--- a/lib/includes/changes/Change.php
+++ b/lib/includes/changes/Change.php
@@ -5,21 +5,6 @@
 /**
  * Interface for objects representing changes.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
  * @since 0.1
  *
  * @file
diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index de5c067..c6f498c 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -1,25 +1,14 @@
 <?php
 
 namespace Wikibase;
-use \ORMRow, \User;
+
+use IORMTable;
+use MWException;
+use ORMRow;
+use User;
 
 /**
  * Class representing a single change (ie a row in the wb_changes).
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
  *
  * @since 0.1
  *
@@ -89,15 +78,11 @@
        }
 
        /**
-        * Constructor.
-        *
-        * @since 1.20
-        *
-        * @param \IORMTable $table
+        * @param IORMTable $table
         * @param array|null $fields
         * @param boolean $loadDefaults
         */
-       public function __construct( \IORMTable $table, $fields = null, 
$loadDefaults = false ) {
+       public function __construct( IORMTable $table, $fields = null, 
$loadDefaults = false ) {
                parent::__construct( $table, $fields, $loadDefaults );
 
                $this->postConstruct();
@@ -178,7 +163,7 @@
         *
         * @return array
         */
-       public function getFields( ) {
+       public function getFields() {
                $fields = parent::getFields();
 
                if ( isset( $fields['info'] ) && is_string( $fields['info'] ) ) 
{
@@ -248,7 +233,7 @@
         *
         * @param array $info
         *
-        * @throws \MWException
+        * @throws MWException
         * @return string
         */
        public function serializeInfo( array $info ) {
@@ -260,7 +245,7 @@
                                        $info,
                                        function ( $v ) {
                                                if ( is_object( $v ) ) {
-                                                       throw new \MWException( 
"Refusing to serialize PHP object of type "
+                                                       throw new MWException( 
"Refusing to serialize PHP object of type "
                                                                . get_class( $v 
) );
                                                }
                                        }
diff --git a/lib/includes/changes/DiffChange.php 
b/lib/includes/changes/DiffChange.php
index b550ef8..2bf1082 100644
--- a/lib/includes/changes/DiffChange.php
+++ b/lib/includes/changes/DiffChange.php
@@ -7,21 +7,6 @@
 /**
  * Class for changes that can be represented as a Diff.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
  * @since 0.1
  *
  * @file
diff --git a/lib/includes/changes/EntityChange.php 
b/lib/includes/changes/EntityChange.php
index e311658..a3f17ad 100644
--- a/lib/includes/changes/EntityChange.php
+++ b/lib/includes/changes/EntityChange.php
@@ -2,23 +2,11 @@
 
 namespace Wikibase;
 
+use MWException;
+use RecentChange;
+
 /**
  * Represents a change for an entity; to be extended by various change subtypes
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
  *
  * @since 0.3
  *
@@ -55,7 +43,7 @@
         * @param string $name
         * @param mixed $value
         *
-        * @throws \MWException
+        * @throws MWException
         */
        public function setField( $name, $value ) {
                if ( $name === 'object_id' && is_string( $value ) ) {
@@ -233,9 +221,9 @@
        /**
         * @since 0.3
         *
-        * @param \RecentChange $rc
+        * @param RecentChange $rc
         */
-       public function setMetadataFromRC( \RecentChange $rc ) {
+       public function setMetadataFromRC( RecentChange $rc ) {
                $this->setMetadata( array(
                        'user_text' => $rc->getAttribute( 'rc_user_text' ),
                        'bot' => $rc->getAttribute( 'rc_bot' ),
@@ -249,9 +237,9 @@
        /**
         * @since 0.3
         *
-        * @param \User $user
+        * @param User $user
         */
-       public function setMetadataFromUser( \User $user ) {
+       public function setMetadataFromUser( User $user ) {
                $this->setMetadata( array(
                        'user_text' => $user->getName(),
                        'page_id' => 0,
@@ -311,11 +299,11 @@
         * @param array|null  $fields additional fields to set
         *
         * @return EntityChange
-        * @throws \MWException
+        * @throws MWException
         */
        public static function newFromUpdate( $action, Entity $oldEntity = 
null, Entity $newEntity = null, array $fields = null ) {
                if ( $oldEntity === null && $newEntity === null ) {
-                       throw new \MWException( 'Either $oldEntity or 
$newEntity must be give.' );
+                       throw new MWException( 'Either $oldEntity or $newEntity 
must be give.' );
                }
 
                if ( $oldEntity === null ) {
@@ -325,7 +313,7 @@
                        $newEntity = EntityFactory::singleton()->newEmpty( 
$oldEntity->getType() );
                        $theEntity = $oldEntity;
                } elseif ( $oldEntity->getType() !== $newEntity->getType() ) {
-                       throw new \MWException( 'Entity type mismatch' );
+                       throw new MWException( 'Entity type mismatch' );
                } else {
                        $theEntity = $newEntity;
                }
diff --git a/lib/includes/changes/ItemChange.php 
b/lib/includes/changes/ItemChange.php
index cb4bf6c..e3a2d0e 100644
--- a/lib/includes/changes/ItemChange.php
+++ b/lib/includes/changes/ItemChange.php
@@ -5,21 +5,6 @@
 use Diff\Diff;
 
 /**
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
  * @since 0.3
  *
  * @file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id16fd7525c10715bf543e3194d431105b25cdc46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <aude.w...@gmail.com>

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

Reply via email to