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); } }
protected function buildSimpleListener(array $directives, $reportOnly = false, $compatHeaders = true, $contentTypes = array()) { $directiveSet = new DirectiveSet(new PolicyManager()); $directiveSet->setDirectives($directives); if ($reportOnly) { return new ContentSecurityPolicyListener($directiveSet, new DirectiveSet(new PolicyManager()), $this->nonceGenerator, $this->shaComputer, $compatHeaders, $contentTypes); } else { return new ContentSecurityPolicyListener(new DirectiveSet(new PolicyManager()), $directiveSet, $this->nonceGenerator, $this->shaComputer, $compatHeaders, $contentTypes); } }