Merge "Migration of browsertests* Jenkins jobs to selenium* jobs"
[lhc/web/wiklou.git] / includes / title / TitleValue.php
index c8ebc2a..c23d698 100644 (file)
@@ -21,6 +21,7 @@
  * @license GPL 2+
  * @author Daniel Kinzler
  */
+use MediaWiki\Linker\LinkTarget;
 use Wikimedia\Assert\Assert;
 
 /**
@@ -95,6 +96,14 @@ class TitleValue implements LinkTarget {
                return $this->fragment;
        }
 
+       /**
+        * @since 1.27
+        * @return bool
+        */
+       public function hasFragment() {
+               return $this->fragment !== '';
+       }
+
        /**
         * Returns the title's DB key, as supplied to the constructor,
         * without namespace prefix or fragment.
@@ -123,11 +132,12 @@ class TitleValue implements LinkTarget {
        /**
         * Creates a new TitleValue for a different fragment of the same page.
         *
+        * @since 1.27
         * @param string $fragment The fragment name, or "" for the entire page.
         *
         * @return TitleValue
         */
-       public function createFragmentTitle( $fragment ) {
+       public function createFragmentTarget( $fragment ) {
                return new TitleValue( $this->namespace, $this->dbkey, $fragment );
        }