Set the card's expiry year

@param string $sCardExpYear The card's expiry year

@throws ChargeRequestException
@return $this
337314
public function setCardExpYear($sCardExpYear)
    {
        //  Validate
        if (is_numeric($sCardExpYear)) {

            //  Accept two digits or 4 digits only
            if (strlen($sCardExpYear) == 2 || strlen($sCardExpYear) == 4) {

                //  Two digit values should be turned into a 4 digit value
                if (strlen($sCardExpYear) == 2) {

                    //  Sorry people living in the 2100's, I'm very sorry everything is broken.
                    $sCardExpYear = '20' . $sCardExpYear;
                }

                $iYear = (int) $sCardExpYear;
                $oNow  = Factory::factory('DateTime');

                if ($oNow->format('Y') > $iYear) {
                    throw new ChargeRequestException(
                        '"' . $sCardExpYear . '" is an invalid expiry year; must be ' . $oNow->format('Y') . ' or later.',
                        1
                    );
                }

                $this->oCard->exp->year = (string) $iYear;
                return $this;

            } else {
                throw new ChargeRequestException(
                    '"' . $sCardExpYear . '" is an invalid expiry year; must be 2 or 4 digits.',
                    1
                );
            }

        } else {
            throw new ChargeRequestException(
                '"' . $sCardExpYear . '" is an invalid expiry year; must be numeric.',
                1
            );
        }
    }
41156
public function setExpire($expire) : self
    {
        // convert expiration time to a Unix timestamp
        if ($expire instanceof \DateTime || $expire instanceof \DateTimeImmutable) {
            $expire = (int) $expire->format('U');
        } elseif (!is_numeric($expire) || !is_int($expire)) {
            throw new \InvalidArgumentException(sprintf(
                "The cookie expiration time is not valid with type '%s'",
                gettype($expire)
            ));
        } elseif ($expire > 0) {
            $expire = time() + $expire;
        }

        $this->expire = $expire;

        return $this;
    }
1236651
public function setExpirationDate($expirationDate)
    {
        if (is_string($expirationDate)) {
            $expirationDate = new \DateTime($expirationDate);
        }

        $this->expirationDate = $expirationDate;

        return $this;
    }
1227871
public function setExpires(string $expires)
    {
        if (empty($expires)) {
            Throw new HeaderException('Empty expires is not allowed.');
        }

        $this->expires = $expires;
    }
316466
private function setExpirationDate(array $parsedValues)
    {
        $expirationDate = null;
        if (isset($parsedValues[self::EXPIRATION_INDEX])) {
            $dateStr = $parsedValues[self::EXPIRATION_INDEX];

            if ($dateStr !== '-') {
                $expirationDate = \DateTime::createFromFormat('Y-m-d', $dateStr);

                if (!$expirationDate) {
                    throw new AttributeException('Invalid Date provided');
                }
            }
        }

        $this->expirationDate = $expirationDate;
    }
972091
public function markChargedback($timestamp = null)
  {
    if(empty($this->_customerFid))
    {
      throw new \RuntimeException(
        "You cannot mark a customer as chargedback before setting a customer fid"
      );
    }

    $ep = $this->_getEndpoint();
    $this->_processRequest(
      $ep->markChargeback(
        MarkDatePayload::create($this->_customerFid, $timestamp)
      )
    );
    return $this;
  }
969548
public function setCurrencyCode($currencyCode): self
    {
        if ($currencyCode instanceof RowColumn) {
            $this->currency_column = $currencyCode->getColumnName();
        } elseif (!is_string($currencyCode) || trim($currencyCode) === '') {
            throw new Exception\InvalidArgumentException(__METHOD__ . ' Currency code must be an non empty string (or a RowColumn object)');
        }
        $this->params['currency_code'] = $currencyCode;

        return $this;
    }
488002
public function setRenewalPolicy($value)
    {
        if (!in_array($value, self::renewalPolicies(), true)) {
            throw new DomainException(sprintf(self::UNEXPECTED_RENEWAL_POLICY, implode(', ', self::renewalPolicies())));
        }
        $this->setAttribute('renewalPolicy', $value);
    }
764703
public function setExpirationDate($expirationDate)
    {
        self::writeFullTag(
            $expirationDate,
            'expiration_date',
            true,
            'video:expiration_date',
            $this->validator,
            'validateExpirationDate',
            $this->exception,
            'Provided expiration date value is not a valid.'
        );

        return $this;
    }
1331626
function set(key, value /*, exflag, secs, pxflag, ms, xflag, req*/) {
  var i
    , arg
    // expiry flag: EX | PX
    , flag
    // expiry value: number
    , expiry
    // exists flag: NX | XX
    , xflag
    // request object when available
    , req;

  for(i = 0;i < arguments.length;i++) {
    arg = arguments[i];
    if(typeof arg === 'object') {
      req = arg;
    }else if(arg === Constants.NX || arg === Constants.XX) {
      xflag = arg;
    }else if(arg === Constants.EX || arg === Constants.PX) {
      flag = arg;
      expiry = arguments[++i];
    }
  }
  return this.setKey(key, value, flag, expiry, xflag, req) || null;
}
623201
public function setAverageMassCharge($massCharge, $charge)
    {
        $this->setAverageMass($this->getNeutralMass($massCharge, $charge));
        $this->setCharge($charge);
    }
902785
private function setPagSeguroDiscountsByPaymentMethod()
    {
        $storeId = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
        if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_credit_card', $storeId) == 1) {
            $creditCard = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_credit_card_value', $storeId);
            if ($creditCard && $creditCard != 0.00) {
                $this->_paymentRequest->addPaymentMethod()->withParameters(
                    \PagSeguro\Enum\PaymentMethod\Group::CREDIT_CARD,
                    \PagSeguro\Enum\PaymentMethod\Config\Keys::DISCOUNT_PERCENT,
                    $creditCard
                );
            }
        }
        if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_online_debit', $storeId) == 1) {
            $eft = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_online_debit_value', $storeId);
            if ($eft && $eft != 0.00) {
                $this->_paymentRequest->addPaymentMethod()->withParameters(
                    \PagSeguro\Enum\PaymentMethod\Group::EFT,
                    \PagSeguro\Enum\PaymentMethod\Config\Keys::DISCOUNT_PERCENT,
                    $eft
                );
            }
        }
        if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_boleto', $storeId) == 1) {
            $boleto = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_boleto_value', $storeId);
            if ($boleto && $boleto != 0.00) {
                $this->_paymentRequest->addPaymentMethod()->withParameters(
                    \PagSeguro\Enum\PaymentMethod\Group::BOLETO,
                    \PagSeguro\Enum\PaymentMethod\Config\Keys::DISCOUNT_PERCENT,
                    $boleto
                );
            }
        }
        if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_deposit_account', $storeId)) {
            $deposit = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_deposit_account_value', $storeId);
            if ($deposit && $deposit != 0.00) {
                $this->_paymentRequest->addPaymentMethod()->withParameters(
                    \PagSeguro\Enum\PaymentMethod\Group::DEPOSIT,
                    \PagSeguro\Enum\PaymentMethod\Config\Keys::DISCOUNT_PERCENT,
                    $deposit
                );
            }
        }
        if ($this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_balance', $storeId)) {
            $balance = (double)$this->_scopeConfig->getValue('payment/pagseguro_default_lightbox/discount_balance_value', $storeId);
            if ($balance && $balance != 0.00) {
                $this->_paymentRequest->addPaymentMethod()->withParameters(
                    \PagSeguro\Enum\PaymentMethod\Group::BALANCE,
                    \PagSeguro\Enum\PaymentMethod\Config\Keys::DISCOUNT_PERCENT,
                    $balance
                );
            }
        }
    }
514016
function setExpiry(key, ms, req) {
  var rval = this.getRawKey(key);
  if(rval === undefined) return 0;
  // expiry is in the past or now, delete immediately
  // but return 1 to indicate the expiry was set
  if(ms <= Date.now()) {
    this.delKey(key, req);
    return 1;
  }
  if(!this._expires[key]) {
    this._ekeys.push(key);
  }
  this._expires[key] = ms;
  rval.e = ms;
  return 1;
}
793194
public function setFetchDepth($fetchDepth = null)
    {
        if (!$this->useFetchDepth) {
            return 0;
        }

        $oldFetchDepth = $this->session->getSessionOption($this->useFetchDepth);

        if (isset($fetchDepth)) {
            $this->session->setSessionOption($this->useFetchDepth, $fetchDepth);
        }

        return $oldFetchDepth;
    }
1117402
public function setYear($year)
    {
        if (!is_scalar($year)) {
            throw new Exception('Year must be a string or an integer in EventManager setYear method.');
        }
        $this->year = $year;

        return $this->year;
    }
667163
public function setExpire($expire)
    {
        if (!$expire instanceof DateTime) {
            if (is_integer($expire)) {
                $expire = (new DateTime())->setTimestamp($expire);
            } else {
                $expire = new DateTime($expire);
            }
        }
        $this->expire = $expire;

        return $this;
    }
547489
public function setExpiry(?\DateTimeImmutable $expiry = null): void
    {
        $date = new \DateTimeImmutable();
        $expiry = $expiry ?: $date;

        $this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
        $this->setHeader('Expires', $expiry->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));

        if ($expiry <= $date) {
            $this->setHeader('Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0');

            return;
        }

        $maxAge = $expiry->getTimestamp() - $date->getTimestamp();
        $this->setHeader('Cache-Control', 'public, max-age=' . $maxAge);
    }