Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
260 changes: 0 additions & 260 deletions libraries/src/Language/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,46 +56,6 @@ class Language extends BaseLanguage
*/
protected $pluralSuffixesCallback = null;

/**
* Name of the ignoredSearchWordsCallback function for this language.
*
* @var callable
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
protected $ignoredSearchWordsCallback = null;

/**
* Name of the lowerLimitSearchWordCallback function for this language.
*
* @var callable
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
protected $lowerLimitSearchWordCallback = null;

/**
* Name of the upperLimitSearchWordCallback function for this language.
*
* @var callable
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
protected $upperLimitSearchWordCallback = null;

/**
* Name of the searchDisplayedCharactersNumberCallback function for this language.
*
* @var callable
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
protected $searchDisplayedCharactersNumberCallback = null;

/**
* Constructor activating the default information of the language.
*
Expand Down Expand Up @@ -173,22 +133,6 @@ public function __construct($lang = null, $debug = false)
if (method_exists($class, 'getPluralSuffixes')) {
$this->pluralSuffixesCallback = [$class, 'getPluralSuffixes'];
}

if (method_exists($class, 'getIgnoredSearchWords')) {
$this->ignoredSearchWordsCallback = [$class, 'getIgnoredSearchWords'];
}

if (method_exists($class, 'getLowerLimitSearchWord')) {
$this->lowerLimitSearchWordCallback = [$class, 'getLowerLimitSearchWord'];
}

if (method_exists($class, 'getUpperLimitSearchWord')) {
$this->upperLimitSearchWordCallback = [$class, 'getUpperLimitSearchWord'];
}

if (method_exists($class, 'getSearchDisplayedCharactersNumber')) {
$this->searchDisplayedCharactersNumberCallback = [$class, 'getSearchDisplayedCharactersNumber'];
}
}

$this->load();
Expand Down Expand Up @@ -399,210 +343,6 @@ public function setPluralSuffixesCallback(callable $function)
return $previous;
}

/**
* Returns an array of ignored search words
*
* @return array The array of ignored search words.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getIgnoredSearchWords()
{
if ($this->ignoredSearchWordsCallback !== null) {
return \call_user_func($this->ignoredSearchWordsCallback);
}

return [];
}

/**
* Getter for ignoredSearchWordsCallback function.
*
* @return callable Function name or the actual function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getIgnoredSearchWordsCallback()
{
return $this->ignoredSearchWordsCallback;
}

/**
* Setter for the ignoredSearchWordsCallback function
*
* @param callable $function Function name or actual function.
*
* @return callable The previous function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function setIgnoredSearchWordsCallback(callable $function)
{
$previous = $this->ignoredSearchWordsCallback;
$this->ignoredSearchWordsCallback = $function;

return $previous;
}

/**
* Returns a lower limit integer for length of search words
*
* @return integer The lower limit integer for length of search words (3 if no value was set for a specific language).
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getLowerLimitSearchWord()
{
if ($this->lowerLimitSearchWordCallback !== null) {
return \call_user_func($this->lowerLimitSearchWordCallback);
}

return 3;
}

/**
* Getter for lowerLimitSearchWordCallback function
*
* @return callable Function name or the actual function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getLowerLimitSearchWordCallback()
{
return $this->lowerLimitSearchWordCallback;
}

/**
* Setter for the lowerLimitSearchWordCallback function.
*
* @param callable $function Function name or actual function.
*
* @return callable The previous function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function setLowerLimitSearchWordCallback(callable $function)
{
$previous = $this->lowerLimitSearchWordCallback;
$this->lowerLimitSearchWordCallback = $function;

return $previous;
}

/**
* Returns an upper limit integer for length of search words
*
* @return integer The upper limit integer for length of search words (200 if no value was set or if default value is < 200).
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getUpperLimitSearchWord()
{
if ($this->upperLimitSearchWordCallback !== null && \call_user_func($this->upperLimitSearchWordCallback) > 200) {
return \call_user_func($this->upperLimitSearchWordCallback);
}

return 200;
}

/**
* Getter for upperLimitSearchWordCallback function
*
* @return callable Function name or the actual function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getUpperLimitSearchWordCallback()
{
return $this->upperLimitSearchWordCallback;
}

/**
* Setter for the upperLimitSearchWordCallback function
*
* @param callable $function Function name or the actual function.
*
* @return callable The previous function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function setUpperLimitSearchWordCallback(callable $function)
{
$previous = $this->upperLimitSearchWordCallback;
$this->upperLimitSearchWordCallback = $function;

return $previous;
}

/**
* Returns the number of characters displayed in search results.
*
* @return integer The number of characters displayed (200 if no value was set for a specific language).
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getSearchDisplayedCharactersNumber()
{
if ($this->searchDisplayedCharactersNumberCallback !== null) {
return \call_user_func($this->searchDisplayedCharactersNumberCallback);
}

return 200;
}

/**
* Getter for searchDisplayedCharactersNumberCallback function
*
* @return callable Function name or the actual function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function getSearchDisplayedCharactersNumberCallback()
{
return $this->searchDisplayedCharactersNumberCallback;
}

/**
* Setter for the searchDisplayedCharactersNumberCallback function.
*
* @param callable $function Function name or the actual function.
*
* @return callable The previous function.
*
* @since 1.7.0
*
* @deprecated 4.4 will be removed in 6.0 without replacement
*/
public function setSearchDisplayedCharactersNumberCallback(callable $function)
{
$previous = $this->searchDisplayedCharactersNumberCallback;
$this->searchDisplayedCharactersNumberCallback = $function;

return $previous;
}

/**
* Loads a single language file and appends the results to the existing strings
*
Expand Down
Loading