Programming Language PHP

Namespace Nelmio\SecurityBundle\ContentSecurityPolicy

Class DirectiveSet

Method/Function getNames

Total Examples 1

1 code examples of PHP Nelmio\SecurityBundle\ContentSecurityPolicy\DirectiveSet::getNames extracted from open source projects

Was this example useful?
                                                    private function addReportOrEnforceNode(string $reportOrEnforce): ArrayNodeDefinition
        $builder = new TreeBuilder($reportOrEnforce);
        $node = $builder->getRootNode();

        $children = $node->children();
        // Symfony should not normalize dashes to underlines, e.g. img-src to img_src

                ->info('Provides CSP Level 1 fallback when using hash or nonce (CSP level 2) by adding \'unsafe-inline\' source. See and')

                ->info('Do not send directives that browser do not support')

        foreach (DirectiveSet::getNames() as $name => $type) {
            if (DirectiveSet::TYPE_NO_VALUE === $type) {
            } elseif ('report-uri' === $name) {
                            ->then(static function (string $value): array { return [$value]; })
            } elseif (DirectiveSet::TYPE_URI_REFERENCE === $type) {
            } else {

        return $children->end();
DirectiveSet's Other Methods