Addshore has submitted this change and it was merged.

Change subject: Style fixes in EntityFactory, wrap long lines, add use 
declartion
......................................................................


Style fixes in EntityFactory, wrap long lines, add use declartion

Change-Id: I39bb5daf266e30538cb1bce7e288e919e6dacb9e
---
M lib/includes/EntityFactory.php
1 file changed, 8 insertions(+), 5 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Addshore: Looks good to me, approved



diff --git a/lib/includes/EntityFactory.php b/lib/includes/EntityFactory.php
index d7cd986..6b2f5fa 100644
--- a/lib/includes/EntityFactory.php
+++ b/lib/includes/EntityFactory.php
@@ -1,6 +1,8 @@
 <?php
 
 namespace Wikibase;
+
+use MWContentSerializationException;
 use MWException;
 
 /**
@@ -115,7 +117,7 @@
         * @since 0.3
         *
         * @throws MWException if the given entity type or serialization format 
is not known.
-        * @throws \MWContentSerializationException if the given blob was 
malformed.
+        * @throws MWContentSerializationException if the given blob was 
malformed.
         *
         * @return Entity The new Entity object.
         */
@@ -138,7 +140,7 @@
         * @return array The deserialized data structure
         *
         * @throws MWException if an unsupported format is requested
-        * @throws \MWContentSerializationException If serialization fails.
+        * @throws MWContentSerializationException If serialization fails.
         */
        public function unserializedData( $blob, $format = null ) {
                if ( is_null( $format ) ) {
@@ -153,12 +155,13 @@
                                $data = json_decode( $blob, true ); //FIXME: 
suppress notice on failed serialization!
                                break;
                        default:
-                               throw new MWException( "serialization format 
$format is not supported for Wikibase content model" );
+                               throw new MWException( "serialization format 
$format is not supported for '
+                                       . 'Wikibase content model" );
                                break;
                }
 
                if ( $data === false || $data === null ) {
-                       throw new \MWContentSerializationException( 'failed to 
deserialize' );
+                       throw new MWContentSerializationException( 'failed to 
deserialize' );
                }
 
                if ( is_object( $data ) ) {
@@ -167,7 +170,7 @@
                }
 
                if ( !is_array( $data ) ) {
-                       throw new \MWContentSerializationException( 'failed to 
deserialize: not an array.' );
+                       throw new MWContentSerializationException( 'failed to 
deserialize: not an array.' );
                }
 
                return $data;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I39bb5daf266e30538cb1bce7e288e919e6dacb9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to