<commit_before><?php

namespace Perfumer\Component\Session;

class Cookie
{
    protected $options = [];

    public function __construct(array $options = [])
    {
        $default_options = [
            'expiration' => 3600,
            'path' => '/',
            'domain' => null,
            'secure' => false,
            'http_only' => true
        ];

        $this->options = array_merge($default_options, $options);
    }

    public function getPath()
    {
        return $this->options['path'];
    }

    public function getDomain()
    {
        return $this->options['domain'];
    }

    public function getSecure()
    {
        return $this->options['secure'];
    }

    public function getHttpOnly()
    {
        return $this->options['http_only'];
    }

    public function get($key, $default = null)
    {
        return isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default;
    }

    public function set($name, $value, $expiration = null)
    {
        if ($expiration === null)
            $expiration = $this->options['expiration'];

        if ($expiration > 0)
            $expiration += time();

        return setcookie($name, $value, $expiration, $this->options['path'], $this->options['domain'], $this->options['secure'], $this->options['http_only']);
    }

    public function delete($name)
    {<commit_msg>Docblock and PSR-2 formatting for Cookie<commit_after><?php

namespace Perfumer\Component\Session;

class Cookie
{
    /**
     * @var array
     */
    protected $options = [];

    /**
     * Cookie constructor.
     * @param array $options
     */
    public function __construct(array $options = [])
    {
        $default_options = [
            'lifetime' => 3600,
            'path' => '/',
            'domain' => null,
            'secure' => false,
            'http_only' => true
        ];

        $this->options = array_merge($default_options, $options);
    }

    /**
     * @return string
     */
    public function getPath()
    {
        return $this->options['path'];
    }

    /**
     * @return string
     */
    public function getDomain()
    {
        return $this->options['domain'];
    }

    /**
     * @return bool
     */
    public function getSecure()
    {
        return $this->options['secure'];
    }

    /**
     * @return bool
     */
    public function getHttpOnly()
    {
        return $this->options['http_only'];
    }

    /**
     * @param string $key
     * @param mixed $default
     * @return mixed
     */
    public function get($key, $default = null)
    {
        return isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default;
    }

    /**
     * @param string $name
     * @param string $value
     * @param int|null $lifetime
     * @return bool
     */
    public function set($name, $value, $lifetime = null)
    {
        if ($lifetime === null) {
            $lifetime = $this->options['lifetime'];
        }

        if ($lifetime > 0) {
            $lifetime += time();
        }

        return setcookie($name, $value, $lifetime, $this->options['path'], $this->options['domain'], $this->options['secure'], $this->options['http_only']);
    }

    /**
     * @param string $name
     * @return bool
     */
    public function delete($name)
    {
{'fraction_non_alphanumeric': 0.15928659286592867, 'fraction_numerical': 0.0033825338253382535, 'mean_word_length': 1.9519056261343013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2946674', 'n_tokens_mistral': 982, 'n_tokens_neox': 954, 'n_words': 204}