public function addHash($type, $hash)
    {
        $directive = self::DIRECTIVE_SCRIPT_SRC;
        if (!(isset($this->directives[$directive]) && is_array($this->directives[$directive]))) {
            $this->directives[$directive] = [];
        }

        if (!(isset($this->directives[$directive]['hashes']) && is_array($this->directives[$directive]['hashes']))) {
            $this->directives[$directive]['hashes'] = [];
        }

        $this->directives[$directive]['hashes'][$type][] = $hash;
    }