private function buildHeaderLine(string $name, array $sources): string
    {
        $header = '';
        if (!empty($sources)) {
            $value = "";
            foreach ($sources as $source) {
                if (!empty($value)) {
                    $value .= ' ';
                }
                $value .= $source;
            }
            $header = ($name == "script-src" && !empty(self::$nonce))
                ? "$name $value 'nonce-" . self::$nonce . "';"
                : "$name $value;";
        }
        return $header;
    }
private function buildHeaderLine(string $name, array $sources): string
    {
        $header = '';
        if (!empty($sources)) {
            $value = "";
            foreach ($sources as $source) {
                if (!empty($value)) {
                    $value .= ' ';
                }
                $value .= $source;
            }
            $header = ($name == "script-src" && !empty(self::$nonce))
                ? "$name $value 'nonce-" . self::$nonce . "';"
                : "$name $value;";
        }
        return $header;
    }
private function buildHeaderLine ( string $ name , array $ sources ) : string { $ header = '' ; if ( ! empty ( $ sources ) ) { $ value = "" ; foreach ( $ sources as $ source ) { if ( ! empty ( $ value ) ) { $ value .= ' ' ; } $ value .= $ source ; } $ header = ( $ name == "script-src" && ! empty ( self :: $ nonce ) ) ? "$name $value 'nonce-" . self :: $ nonce . "';" : "$name $value;" ; } return $ header ; }
Retrieve a specific CSP line based on the provided sources.

@param string $name
@param string[] $sources
@return string
Retrieve a specific CSP line based on the provided sources .