vendor/nelmio/security-bundle/Twig/TokenParser/CSPScriptParser.php line 16

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Nelmio SecurityBundle.
  4.  *
  5.  * (c) Nelmio <hello@nelm.io>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Nelmio\SecurityBundle\Twig\TokenParser;
  11. use Nelmio\SecurityBundle\ContentSecurityPolicy\ShaComputer;
  12. class CSPScriptParser extends AbstractCSPParser
  13. {
  14.     public function __construct(ShaComputer $shaComputer)
  15.     {
  16.         parent::__construct($shaComputer'cspscript''script-src');
  17.     }
  18.     protected function computeSha($data)
  19.     {
  20.         return $this->shaComputer->computeForScript($data);
  21.     }
  22. }