Code Duplication    Length = 9-9 lines in 2 locations

PHPDaemon/HTTPRequest/Generic.php 1 location

@@ 639-647 (lines=9) @@
636
     * @param boolean $HTTPOnly Optional. HTTPOnly. Default is false
637
     * @return void
638
     */
639
    public function setcookie($name, $value = '', $maxage = 0, $path = '', $domain = '', $secure = false, $HTTPOnly = false)
640
    {
641
        $this->header(
642
            'Set-Cookie: ' . $name . '=' . rawurlencode($value)
643
            . (empty($domain) ? '' : '; Domain=' . $domain)
644
            . (empty($maxage) ? '' : '; Max-Age=' . $maxage)
645
            . (empty($path) ? '' : '; Path=' . $path)
646
            . (!$secure ? '' : '; Secure')
647
            . (!$HTTPOnly ? '' : '; HttpOnly'), false);
648
    }
649
650
    /**

PHPDaemon/WebSocket/Route.php 1 location

@@ 75-83 (lines=9) @@
72
     * @param  boolean $HTTPOnly Optional. HTTPOnly. Default is false.
73
     * @return void
74
     */
75
    public function setcookie($name, $value = '', $maxage = 0, $path = '', $domain = '', $secure = false, $HTTPOnly = false)
76
    {
77
        $this->client->header(
78
            'Set-Cookie: ' . $name . '=' . rawurlencode($value)
79
                . (empty($domain) ? '' : '; Domain=' . $domain)
80
                . (empty($maxage) ? '' : '; Max-Age=' . $maxage)
81
                . (empty($path) ? '' : '; Path=' . $path)
82
                . (!$secure ? '' : '; Secure')
83
                . (!$HTTPOnly ? '' : '; HttpOnly'),
84
            false
85
        );
86
    }