compared with
Current by Matthew Weier O'Phinney
on Aug 12, 2010 07:09.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (28)

View Page History
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

{zone-data:component-name}

{zone-data:milestones}
* Milestone 1: [DONE] Creating base class Proposal finished
* Milestone 2: [DONE] Importing current development state into Subversion (http://johnpatcher-zf.googlecode.com/svn/trunk/ZendFilterStripSpaces/)
* Milestone 2: Proposal accepted
* Milestone 3: Proposal acceptance Working implementation
* Milestone 4: Import of current prototype to ZF SVN
* Milestone 54: Unit tests
* Milestone 5: Documentation
* Milestone 6: Improvements (if necessary) Moved to core
* Milestone 7: Documentation
{zone-data}

{zone-data:use-cases}
||UC-01||
Default, stripping multiple whitespaces (textual, unicode and html)
{code}
$text = 'Hello World';
$filter = new Zend_Filter_StripSpaces();
echo $filter->filter($text);
// returns 'Hello World'
{code}

||UC-02||
Stripping only multiple textual whitespaces
{code}
$text = 'Hello World';
$stripped = Zend_Filter::get($text, 'StripSpaces');
$filter = new Zend_Filter_StripSpaces(Zend_Filter_StripSpaces::SPACE);
echo $stripped; $filter->filter($text);
// returns 'Hello World'
{code}

||UC-03||
Stripping all whitespaces
{code}
$text = 'Hello&nbsp;&nbsp;World';
$filter = new Zend_Filter_StripSpaces(array('count' => 0);
echo $filter->filter($text);
// returns 'HelloWorld'
{code}

||UC-04||
Stripping multiple types of whitespaces
{code}
$text = 'Hello&nbsp;&nbsp;&nbsp; World';
$filter = new Zend_Filter_StripSpaces(array('count' => 0);
echo $filter->filter($text);
// returns 'HelloWorld'
{code}

||UC-05||
Stripping more than 3 whitespaces
{code}
$text = 'Hello World';
$filter = new Zend_Filter_StripSpaces(array('count' => 3);
echo $filter->filter($text);
// returns 'Hello World'
{code}
{zone-data}

class Zend_Filter_StripSpaces
{
protected $_stripAllSpaces;
const SPACE = 1;
const UNICODE_SPACE = 2;
const HTML_SPACE = 4;
const ALL = 8;

public function __construct($options = false) null) { }

/**
* Sets the space type to strip, defaults to ALL, see constants
*/
public function setStripAllSpaces($stripAllSpaces) setType($type = self::ALL) { }

/**
* Returns the set space type
*/
public function getStripAllSpaces() getType() { }

/**
* Sets the space count to strip, defaults to 1
*/
public function setCount($count = 1) { }

/**
* Returns the set space count
*/
public function getCount() { }

public function filter($value) { }

{zone-data}

{zone-template-instance}
{zone-template-instance}]]></ac:plain-text-body></ac:macro>