Source for file RemoveShortStrings.php
Documentation is available at RemoveShortStrings.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @package MediaSearch_Filter_KeyWords
* @copyright Copyright (c) 2009 Sven Strittmatter
* @see MediaSearch_Filter_KeyWords_Interface
require_once('MediaSearch/Filter/KeyWords/Interface.php');
* Removes key words shorter than 3 characters.
* @package MediaSearch_Filter_KeyWords
* @copyright Copyright (c) 2009 Sven Strittmatter
* Instance for singleton.
* @var MediaSearch_Filter_KeyWords_RemoveShortStrings
private static $instance;
* Singleton inplementation (see GoF).
private function __construct() {
* Returns th einstance of this class.
* @return MediaSearch_Filter_KeyWords_RemoveShortStrings
public static function get() {
if (null === self::$instance) {
self::$instance = new MediaSearch_Filter_KeyWords_RemoveShortStrings();
* Removes all key word strings shorter than 3 characters.
public function process(array $input) {
foreach ($input as $keyword) {
if (strlen($keyword) < 3) {
|