<commit_before><?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\View\Helper;

use stdClass;
use Zend\View;
use Zend\View\Exception;

/**
 * Helper for setting and retrieving script elements for HTML head section
 *
 * Allows the following method calls:
 * @method HeadScript appendFile($src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript offsetSetFile($index, $src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript prependFile($src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript setFile($src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript appendScript($script, $type = 'text/javascript', $attrs = array())
 * @method HeadScript offsetSetScript($index, $src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript prependScript($script, $type = 'text/javascript', $attrs = array())
 * @method HeadScript setScript($script, $type = 'text/javascript', $attrs = array())
 */
class HeadScript extends Placeholder\Container\AbstractStandalone
{
    /**
     * Script type constants
     *
     * @const string
     */
    const FILE   = 'FILE';
    const SCRIPT = 'SCRIPT';

    /**
     * Registry key for placeholder
     *
     * @var string
     */
    protected $regKey = 'Zend_View_Helper_HeadScript';

    /**
     * Are arbitrary attributes allowed?
     *
     * @var bool
     */
    protected $arbitraryAttributes = false;

    /**
     * Is capture lock?
     *
     * @var bool
     */
    protected $captureLock;

    /**
     * Capture type
     *
     * @var string
     */
    protected $captureScriptType;

    /**
     * Capture attributes
     *
     * @var null|array
     */
    protected $captureScriptAttrs = null;

    /**
     * Capture type (append, prepend, set)
     *
     * @var string
     */
    protected $captureType;

    /**
     * Optional allowed attributes for script tag
     *
     * @var array
     */
    protected $optionalAttributes = [
        'charset',
        'crossorigin',
        'defer',
        'async',
        'language',
        'src',<commit_msg>Added "id" to allowed attributes in HeadScript view helper<commit_after><?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\View\Helper;

use stdClass;
use Zend\View;
use Zend\View\Exception;

/**
 * Helper for setting and retrieving script elements for HTML head section
 *
 * Allows the following method calls:
 * @method HeadScript appendFile($src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript offsetSetFile($index, $src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript prependFile($src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript setFile($src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript appendScript($script, $type = 'text/javascript', $attrs = array())
 * @method HeadScript offsetSetScript($index, $src, $type = 'text/javascript', $attrs = array())
 * @method HeadScript prependScript($script, $type = 'text/javascript', $attrs = array())
 * @method HeadScript setScript($script, $type = 'text/javascript', $attrs = array())
 */
class HeadScript extends Placeholder\Container\AbstractStandalone
{
    /**
     * Script type constants
     *
     * @const string
     */
    const FILE   = 'FILE';
    const SCRIPT = 'SCRIPT';

    /**
     * Registry key for placeholder
     *
     * @var string
     */
    protected $regKey = 'Zend_View_Helper_HeadScript';

    /**
     * Are arbitrary attributes allowed?
     *
     * @var bool
     */
    protected $arbitraryAttributes = false;

    /**
     * Is capture lock?
     *
     * @var bool
     */
    protected $captureLock;

    /**
     * Capture type
     *
     * @var string
     */
    protected $captureScriptType;

    /**
     * Capture attributes
     *
     * @var null|array
     */
    protected $captureScriptAttrs = null;

    /**
     * Capture type (append, prepend, set)
     *
     * @var string
     */
    protected $captureType;

    /**
     * Optional allowed attributes for script tag
     *
     * @var array
     */
    protected $optionalAttributes = [
        'charset',
        'crossorigin',
        'defer',
        'async',
        'language',
        'src',
        'id',
{'fraction_non_alphanumeric': 0.13826903023983317, 'fraction_numerical': 0.003753910323253389, 'mean_word_length': 2.700617283950617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4521625', 'n_tokens_mistral': 1435, 'n_tokens_neox': 1382, 'n_words': 378}