Calculates cookie expire time

@param array $expires
@return int
192862
private function getExpireTime(array $expires = ['m' => 1]): int
    {
        $expireTime = \time();
        if (\is_array($expires)) {
            if (isset($expires['y'])) {
                $expireTime += \intval(0 + $expires['y']) * 60 * 60 * 24 * 365;
            }
            if (isset($expires['m'])) {
                $expireTime += \intval(0 + $expires['m']) * 60 * 60 * 24 * 30;
            }
            if (isset($expires['d'])) {
                $expireTime += \intval(0 + $expires['d']) * 60 * 60 * 24;
            }
            if (isset($expires['h'])) {
                $expireTime += \intval(0 + $expires['h']) * 60 * 60;
            }
            if (isset($expires['i'])) {
                $expireTime += \intval(0 + $expires['i']) * 60;
            }
            if (isset($expires['s'])) {
                $expireTime += \intval(0 + $expires['s']);
            }
        }
        return $expireTime;
    }
880193
protected function expiration($minutes)
    {
        $time = time() + (int) ($minutes * 60);

        return $minutes === 0 || $time > 9999999999 ? 9999999999 : (int) $time;
    }
489211
public function expireAfter($key, $expire = 0)
    {
        $val = $this->mem->get($key);

        if (isset($val)) {
            return $this->set($key, $val, $expire);
        }

        return false;
    }
224755
public function update($key, $value, $expire = 0)
    {
        $arr = $this->get($key);
        if (!empty($arr)) {
            $arr = array_merge($arr, $value);
            return $this->set($key, $arr, $expire);
        }
        return 0;
    }
168509
private function getExpirationDate($expiryMonth, $expiryYear) {
        $expDate = new DateTime(
            $expiryYear
            . '-'
            . $expiryMonth
            . '-'
            . '01'
            . ' '
            . '00:00:00',
            new DateTimeZone('UTC')
        );

        return $expDate->add(new DateInterval('P1M'))->format('Y-m-d 00:00:00');
    }
833157
public function set($key, $value, int $expire = 30) : Cookies
    {
        setcookie($key, $value, time() + $expire);

        return $this;
    }
1344811
public function cache($key, $expires = null) {
        if ($this->getType() !== self::SELECT) {
            return $this;
        }

        $this->_cacheKey = $key;
        $this->_cacheLength = $expires;

        return $this;
    }
587928
private function getControledExpireTime($expire)
    {
        $lifetime = $this->getControledLifetime($expire - time());

        if (0 < $lifetime) {
            return time() + $lifetime;
        }

        return $expire;
    }
504050
public function getCookieExpiration() {
		$name = $this->getCookieName( 'track-expire' );
		return isset( $_COOKIE[$name] ) ? intval( $_COOKIE[$name] ) : 0;
	}
198744
private function packData($data, $expires)
    {
        $str            = [];
        $str['data']    = $data;
        $str['expires'] = $expires === 0 ? 0 : time() + $expires;
        $str            = serialize($str);

        return $str;
    }
9415
public function expireCampaigns($ids)
    {
        $bind = [
            'send_status' => \Dotdigitalgroup\Email\Model\Campaign::SENT,
            'message' => 'Check sending status in Engagement Cloud',
            'updated_at' => $this->datetime->gmtDate()
        ];
        $this->getConnection()
            ->update(
                $this->getMainTable(),
                $bind,
                ["id in (?)" => $ids]
        );
    }
547239
public function set($key, $value, $expire = null)
    {
        if (null === $expire) {
            $expire = $this->_expire;
        }
        return $this->_mc->set($key, $value, 0, $expire);
    }
213641
public function getExpiresAt() : ?int 
    {
        if ( ! $this->hasExpiresAt()) {
            $this->setExpiresAt($this->getDefaultExpiresAt());
        }
        return $this->expiresAt;
    }
1227871
public function setExpires(string $expires)
    {
        if (empty($expires)) {
            Throw new HeaderException('Empty expires is not allowed.');
        }

        $this->expires = $expires;
    }
1231427
public function getSecureURL($expires = 60) {
		if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
			return;
		}

		/** @var \FileContent $pointer */
		$pointer = $this->owner->obj('CDNFile');

		if($pointer->exists()) {
			$reader = $this->reader();
			if ($reader && $this->owner->canView() && method_exists($reader, 'getSecureURL')) {
				return $reader->getSecureURL($expires);
			}
		}
	}
437058
public static function setCookieHeaders($cookies)
    {
        if (!empty($cookies) && is_array($cookies) && false === headers_sent() && !self::isTest()) {
            foreach ($cookies as $cookie) {
                setcookie($cookie["name"],
                    $cookie["value"],
                    (array_key_exists('expire', $cookie)) ? $cookie["expire"] : NULL,
                    (array_key_exists('path', $cookie)) ? $cookie["path"] : "/",
                    (array_key_exists('domain', $cookie)) ? $cookie["domain"] : Request::getInstance()->getRootUrl(FALSE),
                    (array_key_exists('secure', $cookie)) ? $cookie["secure"] : FALSE,
                    (array_key_exists('http', $cookie)) ? $cookie["http"] : true
                );
            }
        }
    }
23944
public function setExpires($expires)
    {
        if (empty($expires)) {
            return $this;
        }

        $this->expires = strtotime($expires);

        return $this;
    }