public function setDirectives(array $directives)
{
foreach ($directives as $name => $value) {
$this->setDirective($name, $value);
}
}
protected function buildSimpleListener(array $directives, $reportOnly = false, $compatHeaders = true, $contentTypes = array()) { $directiveSet = new DirectiveSet(); $directiveSet->setDirectives($directives); if ($reportOnly) { return new ContentSecurityPolicyListener($directiveSet, new DirectiveSet(), $compatHeaders, $contentTypes); } else { return new ContentSecurityPolicyListener(new DirectiveSet(), $directiveSet, $compatHeaders, $contentTypes); } }