Skip to content

Commit

Permalink
doc(search): add missing PHP doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
micgro42 committed Mar 27, 2018
1 parent 7fa270b commit be76738
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions inc/Ui/Search.php
Expand Up @@ -91,6 +91,11 @@ protected function getSearchFormHTML($query)
return $searchForm->toHTML();
}

/**
* Add elements to adjust how the results are sorted
*
* @param Form $searchForm
*/
protected function addSortTool(Form $searchForm)
{
global $INPUT, $lang;
Expand Down Expand Up @@ -141,6 +146,13 @@ protected function addSortTool(Form $searchForm)

}

/**
* Check if the query is simple enough to modify its namespace limitations without breaking the rest of the query
*
* @param array $parsedQuery
*
* @return bool
*/
protected function isNamespaceAssistanceAvailable(array $parsedQuery) {
if (preg_match('/[\(\)\|]/', $parsedQuery['query']) === 1) {
return false;
Expand All @@ -149,6 +161,13 @@ protected function isNamespaceAssistanceAvailable(array $parsedQuery) {
return true;
}

/**
* Check if the query is simple enough to modify the fragment search behavior without breaking the rest of the query
*
* @param array $parsedQuery
*
* @return bool
*/
protected function isFragmentAssistanceAvailable(array $parsedQuery) {
if (preg_match('/[\(\)\|]/', $parsedQuery['query']) === 1) {
return false;
Expand Down Expand Up @@ -185,6 +204,11 @@ protected function addSearchAssistanceElements(Form $searchForm)
$searchForm->addTagClose('div');
}

/**
* Add the elements to adjust the fragment search behavior
*
* @param Form $searchForm
*/
protected function addFragmentBehaviorLinks(Form $searchForm)
{
if (!$this->isFragmentAssistanceAvailable($this->parsedQuery)) {
Expand Down

0 comments on commit be76738

Please sign in to comment.