original_string: private function generateCspHeader(array $directives)
      {
          return array_reduce(array_keys($directives), function ($res, $name) use ($directives) {
              return ('' !== $res ? $res.'; ' : '').sprintf('%s %s', $name, implode(' ', $directives[$name]));
          }, '');
      }
code: private function generateCspHeader(array $directives)
      {
          return array_reduce(array_keys($directives), function ($res, $name) use ($directives) {
              return ('' !== $res ? $res.'; ' : '').sprintf('%s %s', $name, implode(' ', $directives[$name]));
          }, '');
      }
code_tokens: private function generateCspHeader ( array $ directives ) { return array_reduce ( array_keys ( $ directives ) , function ( $ res , $ name ) use ( $ directives ) { return ( '' !== $ res ? $ res . '; ' : '' ) . sprintf ( '%s %s' , $ name , implode ( ' ' , $ directives [ $ name ] ) ) ; } , '' ) ; }
docstring: Converts a directive set array into Content-Security-Policy header.
  
  @param array $directives The directive set
  
  @return string The Content-Security-Policy header
docstring_tokens: Converts a directive set array into Content - Security - Policy header .