Source for file Trim.php
Documentation is available at Trim.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');
* Trims the white spaces from the key words.
* @package MediaSearch_Filter_KeyWords
* @copyright Copyright (c) 2009 Sven Strittmatter
* Instance for singleton.
* @var MediaSearch_Filter_KeyWords_Trim
private static $instance;
* Singleton inplementation (see GoF).
private function __construct() {
* Returns th einstance of this class.
* @return MediaSearch_Filter_KeyWords_Trim
public static function get() {
if (null === self::$instance) {
self::$instance = new MediaSearch_Filter_KeyWords_Trim();
* Trims the whitespaces from all given key word strings.
public function process(array $input) {
foreach ($input as $keyword) {
$filtered[] = trim($keyword);
|