HTMLPurifier_AttrDef_HTML_Pixels::make PHP Method

make() public method

public make ( string $string ) : HTMLPurifier_AttrDef
$string string
return HTMLPurifier_AttrDef
    public function make($string)
    {
        if ($string === '') {
            $max = null;
        } else {
            $max = (int) $string;
        }
        $class = get_class($this);
        return new $class($max);
    }

Usage Example

Esempio n. 1
0
 public function test_make()
 {
     $factory = new HTMLPurifier_AttrDef_HTML_Pixels();
     $this->def = $factory->make('30');
     $this->assertDef('25');
     $this->assertDef('35', '30');
 }
HTMLPurifier_AttrDef_HTML_Pixels