Nelmio\SecurityBundle\ContentSecurityPolicy\ContentSecurityPolicyParser::parseSourceList PHP Method

parseSourceList() public method

public parseSourceList ( array $sourceList ) : string
$sourceList array
return string
    public function parseSourceList($sourceList)
    {
        if (!is_array($sourceList)) {
            return $sourceList;
        }
        $sourceList = $this->quoteKeywords($sourceList);
        return implode(' ', $sourceList);
    }

Usage Example

 /**
  * @dataProvider keywordsProvider
  */
 public function testQuotesKeywords($source, $expected)
 {
     $parser = new ContentSecurityPolicyParser();
     $sourceList = array($source);
     $result = $parser->parseSourceList($sourceList);
     $this->assertEquals($expected, $result, 'CSP parser should quote CSP keywords');
 }
All Usage Examples Of Nelmio\SecurityBundle\ContentSecurityPolicy\ContentSecurityPolicyParser::parseSourceList
ContentSecurityPolicyParser