Skip to content

Commit

Permalink
Fixed property comment and CS
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmayer committed Jan 6, 2017
1 parent 8a1cf1b commit 3cb3583
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions administrator/components/com_finder/helpers/indexer/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ class FinderIndexerHelper
* @since 2.5
*/
public static $stemmer;

/**
* A state flag, in order to not constantly check if the stemmer is an instance of FinderIndexerStemmer
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected static $stemmerOK;

/**
Expand Down Expand Up @@ -220,20 +227,26 @@ public static function stem($token, $lang)
$token = trim($token, '\'');

// Trim everything after any apostrophe in the token.
if ($res = explode('\'', $token)) {
if ($res = explode('\'', $token))
{
$token = $res[0];
}

if (static::$stemmerOK === true) {
if (static::$stemmerOK === true)
{
return static::$stemmer->stem($token, $lang);
} else {
}
else
{
// Stem the token if we have a valid stemmer to use.
if (static::$stemmer instanceof FinderIndexerStemmer) {
if (static::$stemmer instanceof FinderIndexerStemmer)
{
static::$stemmerOK = true;

return static::$stemmer->stem($token, $lang);
}
}

return $token;
}

Expand Down

0 comments on commit 3cb3583

Please sign in to comment.