Code Duplication    Length = 9-9 lines in 2 locations

includes/PrefixSearch.php 1 location

@@ 76-84 (lines=9) @@
73
74
		// Is this a namespace prefix?
75
		$title = Title::newFromText( $search . 'Dummy' );
76
		if ( $title && $title->getText() == 'Dummy'
77
			&& $title->getNamespace() != NS_MAIN
78
			&& !$title->isExternal() )
79
		{
80
			$namespaces = [ $title->getNamespace() ];
81
			$search = '';
82
		} else {
83
			Hooks::run( 'PrefixSearchExtractNamespace', [ &$namespaces, &$search ] );
84
		}
85
86
		return $this->searchBackend( $namespaces, $search, $limit, $offset );
87
	}

includes/search/SearchEngine.php 1 location

@@ 404-412 (lines=9) @@
401
			}
402
		} else {
403
			$title = Title::newFromText( $search . 'Dummy' );
404
			if ( $title && $title->getText() == 'Dummy'
405
					&& $title->getNamespace() != NS_MAIN
406
					&& !$title->isExternal() )
407
			{
408
				$ns = [ $title->getNamespace() ];
409
				$search = '';
410
			} else {
411
				Hooks::run( 'PrefixSearchExtractNamespace', [ &$ns, &$search ] );
412
			}
413
		}
414
415
		$ns = array_map( function( $space ) {