/** * {@inheritdoc} */ public function asConfig() { if (!isset($this->vars['regexp'])) { throw new RuntimeException("Regexp filter is missing a 'regexp' value"); } return parent::asConfig(); }
/** * Constructor * * @return void */ public function __construct() { parent::__construct('s9e\\TextFormatter\\Parser\\BuiltInFilters::filterUrl'); $this->resetParameters(); $this->addParameterByName('attrValue'); $this->addParameterByName('urlConfig'); $this->addParameterByName('logger'); $this->setJS('BuiltInFilters.filterUrl'); }
public function asConfig() { if (!isset($this->vars['min'])) { throw new RuntimeException("Range filter is missing a 'min' value"); } if (!isset($this->vars['max'])) { throw new RuntimeException("Range filter is missing a 'max' value"); } return parent::asConfig(); }
public function __construct() { parent::__construct('s9e\\TextFormatter\\Parser\\BuiltInFilters::filterSimpletext'); $this->setJS('BuiltInFilters.filterSimpletext'); }
/** * @testdox getParser() removes JavaScript-specific data from attribute filters */ public function testAsConfigRemovesJavaScriptAttributeFilters() { $filter = new AttributeFilter(function ($v) { }); $filter->setJS('function(v){return false;}'); $this->configurator->tags->add('A')->attributes->add('a')->filterChain->append($filter); $parser = $this->configurator->getParser(); $tagsConfig = $this->readAttribute($parser, 'tagsConfig'); $this->assertArrayNotHasKey('js', $tagsConfig['A']['attributes']['a']['filterChain'][0]); }
/** * @testdox isSafeAsURL() returns TRUE if markAsSafeAsURL() is called */ public function testMarkedSafeAsURL() { $filter = new AttributeFilter(function () { }); $filter->markAsSafeAsURL(); $this->assertTrue($filter->isSafeAsURL()); }