public function make($string) { if ($string === '') { $max = null; } else { $max = (int) $string; } $class = get_class($this); return new $class($max); }
public function test_make() { $factory = new HTMLPurifier_AttrDef_HTML_Pixels(); $this->def = $factory->make('30'); $this->assertDef('25'); $this->assertDef('35', '30'); }