Foxtrott has uploaded a new change for review.

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

Change subject: Some clean-up
......................................................................

Some clean-up

Change-Id: I9578e7780164271a53de116b0fcb1c2f87effe04
---
M src/BasicBackend.php
M tests/phpunit/Unit/BasicBackendTest.php
2 files changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/95/278695/1

diff --git a/src/BasicBackend.php b/src/BasicBackend.php
index 48be64b..082dba8 100644
--- a/src/BasicBackend.php
+++ b/src/BasicBackend.php
@@ -28,7 +28,6 @@
 namespace Lingo;
 
 use ApprovedRevs;
-use ContentHandler;
 use Hooks;
 use Parser;
 use ParserOptions;
@@ -230,7 +229,7 @@
                }
 
                // found a new term?
-               if ( count( $chunks ) >= 1 && strlen( $chunks[ 0 ] ) > 0 ) {
+               if ( strlen( trim( $chunks[ 0 ] ) ) > 1 ) {
                        $term = trim( substr( $chunks[ 0 ], 1 ) );
                }
        }
@@ -266,10 +265,10 @@
        /**
         * @codeCoverageIgnore
         * @param $dictionaryPage
-        * @return null|Title
+        * @return Title
         */
        protected function getTitleFromText( $dictionaryPage ) {
-               return Title::newFromText( $dictionaryPage );
+               return Title::newFromTextThrow( $dictionaryPage );
        }
 
        /**
diff --git a/tests/phpunit/Unit/BasicBackendTest.php 
b/tests/phpunit/Unit/BasicBackendTest.php
index 8f30098..f622880 100644
--- a/tests/phpunit/Unit/BasicBackendTest.php
+++ b/tests/phpunit/Unit/BasicBackendTest.php
@@ -270,7 +270,7 @@
                        array(
 <<<'TESTTEXT'
 ;CIP:Common image point
-;CMP:Common midpoint
+; CMP : Common midpoint
 
 ;DIMO
 ;DMO

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9578e7780164271a53de116b0fcb1c2f87effe04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>

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

Reply via email to