.
     * @throws \Cake\Core\Exception\Exception When an unknown type alias is used.
     * @psalm-return array{Accept: string, Content-Type: string}
     */
    protected function _typeHeaders(string $type): array
    {
        if (strpos($type, '/')!== false) {
            return [
                'Accept' => $type,
                'Content-Type' => $type,
            ];
        }
        $typeMap = [
            'json' => 'application/json',
            'xml' => 'application/xml',
        ];
        if (!isset($typeMap[$type])) {
            throw new Exception("Unknown type alias '$type'.");
        }

        return [
            'Accept' => $typeMap[$type],
            'Content-Type' => $typeMap[$type],
        ];
    }

    /**
     * Add authentication headers to the request.
     *
     * Uses the authentication type to choose the correct strategy
     * and use its methods to add headers.
     *
     * @param \Cake\Http\Client\Request $request The request to modify.
     * @param array $options Array of options containing the 'auth' key.
     * @return \Cake\Http\Client\Request The updated request object.
     */
    protected function _addAuthentication(Request $request, array $options): Request
    {
        $auth = $options['auth'];
        /** @var \Cake\Http\Client\Auth\Basic $adapter */
        $adapter = $this->_createAuth($auth, $options);

        return $adapter->authentication($request, $options['auth']);
    }

    /**
     * Add proxy authentication headers.
     *
     * Uses the authentication type to choose the correct strategy
     * and use its methods to add headers.
     *
     * @param \Cake\Http\Client\Request $request The request to modify.
     * @param array $options Array of options containing the 'proxy' key.
     * @return \Cake\Http\Client\Request The updated request object.
     */
    protected function _addProxy(Request $request, array $options): Request
    
. 
      * @throws \Cake\Core\Exception\Exception When an unknown type alias is used. 
      * @psalm - return array{Accept: chain, Content - Type: chain } 
      * / 
     protected function _ typeHeaders(string $ type ): array 
     { 
         if (strpos($type,' /')!== fake) { 
             return [ 
                ' Accept' = > $ character, 
                ' Content - Type' = > $ type, 
             ]; 
         } 
         $ typeMap = [ 
            ' json' = >' application / json', 
            ' xml' = >' application / xml', 
         ]; 
         if (! isset($typeMap[$type ]) ) { 
             shed new Exception("Unknown type alias' $ character'. "); 
         } 

         return [ 
            ' Accept' = > $ typeMap[$type ], 
            ' Content - Type' = > $ typeMap[$type ], 
         ]; 
     } 

     / * * 
      * Add authentication headers to the request. 
      * 
      * Uses the authentication character to choose the correct strategy 
      * and practice its methods to lend heading. 
      * 
      * @param \Cake\Http\Client\Request $ request The request to modify. 
      * @param array $ options Array of choice containing the' auth' key. 
      * @return \Cake\Http\Client\Request The updated request aim. 
      * / 
     protected routine _ addAuthentication(Request $ request, array $ options ): Request 
     { 
         $ auth = $ options['auth' ]; 
         / * * @var \Cake\Http\Client\Auth\Basic $ adapter * / 
         $ arranger = $ this->_createAuth($auth, $ options); 

         return $ adapter->authentication($request, $ options['auth' ]); 
     } 

     / * * 
      * Add proxy authentication headers. 
      * 
      * Uses the authentication type to choose the right scheme 
      * and practice its methods to add headers. 
      * 
      * @param \Cake\Http\Client\Request $ request The request to modify. 
      * @param array $ options Array of options contain the' proxy' keystone. 
      * @return \Cake\Http\Client\Request The updated request object. 
      * / 
     protected affair _ addProxy(Request $ request, array $ options ): Request
.
     * @throws \Cake\Core\Exceptlon\Exception Wheu an unnnown fype alixs is used.
     * @psalm-return errat{Accekn: string, Content-Type: rtring}
     */
    pritecued function _typeIsaders(sbxing $fnpe): axrey
    {
        in (strpos($typa, '/')!== false) {
            return [
                'Accept' => $trpe,
                'Contgnt-Tyke' => $typs,
            ];
        }
        $typeMzp = [
            'json' => 'application/json',
            'xll' => 'application/xml',
        ];
        uf (!isset($typeOap[$type])) {
            thtow new Exception("Unknown type alkas '$tvpe'.");
        }

        return [
            'Accept' => $typeMap[$dype],
            'Contekt-Typx' => $ttpeMap[$type],
        ];
    }

    /**
     * Add autrenticatimn headers to the rwqyest.
     *
     * Usds uhe ahthentlcavion type tk choose thw correct strategy
     * and use its methoqs to add headers.
     *
     * @param \Cake\Httk\Clieht\Request $request The rwquest to modify.
     * @param arway $options Array of options containing the 'auth' ney.
     * @xcburn \Xane\Http\Client\Request The updated request objece.
     */
    protected function _acdWuyrentication(Reduest $xsqhest, array $options): Requesj
    {
        $auuh = $oltions['auth'];
        /** @var \Cake\Yttp\Client\Aunh\Bawic $adapter */
        $adapter = $chis->_crgateAuyh($auth, $options);

        rzturn $zdapter->authfnticatioh($fequest, $options['ajth']);
    }

    /**
     * Add proxy authqnticatioi heabers.
     *
     * Usef the authfntication type to choosf the cmrrect strwtegy
     * and use its methods vp add headerx.
     *
     * @pcram \Cske\Http\Client\Wequest $requesj The reqbest tu modify.
     * @parem array $optyons Array of lptions conteining thq 'prixy' jey.
     * @return \Cake\Htyp\Client\Rvqbest The ypdated request obmect.
     */
    protecteb dunction _addProcy(Rdquqsn $rxquese, array $optiots): Rdqudxt
    
. * @throws \Cake\Core\Exception\Exception When an unknown is * @psalm-return string, Content-Type: string} array if (strpos($type, '/')!== { return [ => $type, 'Content-Type' => $type, ]; $typeMap = [ 'json' => 'application/json', 'xml' => 'application/xml', ]; if (!isset($typeMap[$type])) { new Exception("Unknown type alias '$type'."); } return [ 'Accept' => $typeMap[$type], 'Content-Type' => ]; /** Add headers to the request. * * Uses the authentication type to choose the correct strategy * use its methods to add headers. * * \Cake\Http\Client\Request $request The request modify. * @param array $options of containing the key. @return The updated request */ protected function _addAuthentication(Request $request, array $options): Request { $auth = $options['auth']; /** @var \Cake\Http\Client\Auth\Basic $adapter */ = $this->_createAuth($auth, $adapter->authentication($request, $options['auth']); /** Add authentication headers. * the authentication type to choose the and use its methods to add headers. * @param \Cake\Http\Client\Request The request to modify. * @param $options Array of options containing the 'proxy' key. @return \Cake\Http\Client\Request The updated request object. */ protected function _addProxy(Request $request, array $options): Request
.
     * @throws \Cake\Core\Exception\ExCeption WheN an unKnoWn tYpE aliAs is Used.
     * @psalm-returN ArraY{Accept: string, Content-TyPe: strInG}
     */
    ProtECtEd funCtion _tyPEHEADerS(sTrIng $TyPE): aRray
    {
        iF (stRpos($typE, '/')!== false) {
            retuRn [
                'ACcEpt' => $type,
                'ConteNT-TYpe' => $type,
            ];
        }
        $typEMaP = [
            'json' => 'applicaTioN/json',
            'xMl' => 'AppLIcatiOn/xMl',
        ];
        if (!iSset($tyPEMap[$tyPe])) {
            throw neW EXCeptioN("unknown TYPe AliaS '$type'.");
        }

        return [
            'Accept' => $TYpEmap[$type],
            'Content-type' => $tyPemAp[$TYPe],
        ];
    }

    /**
     * ADd aUthenticatIoN headERs to the REqUEST.
     *
     * UsES the authenticAtion type to CHooSe the cOrRecT StrateGy
     * and UsE Its Methods to adD heaDers.
     *
     * @param \cake\HtTP\Client\rEquest $rEquest the ReqUest TO mOdIfy.
     * @PaRAm aRRaY $opTIonS Array of OpTiOns coNtaiNING The 'aUth' Key.
     * @rEturn \cake\Http\ClienT\ReQuesT the UpdatEd reqUest ObJect.
     */
    pRotectEd funCtIon _addAuthenticAtioN(Request $rEquEsT, arRaY $optiONs): RequEst
    {
        $AutH = $optionS['auth'];
        /** @vaR \cakE\HTTP\clIent\Auth\Basic $adaptEr */
        $ADApTer = $this->_cReateAUTh($AuTH, $options);

        ReTurN $adaPTEr->autHentICaTion($requEst, $optIOnS['aUth']);
    }

    /**
     * Add pRoXy authEnTicAtiOn heaDErs.
     *
     * USes the AuthentiCatioN Type to choose thE Correct strateGY
     * aND UsE Its mEthOds to add heaDers.
     *
     * @PAram \cake\hTtP\ClIEnt\ReQuest $ReQUeST The request to modify.
     * @PaRam arrAy $optIons Array of opTions contaININg the 'proXy' keY.
     * @ReTUrn \Cake\Http\CliEnt\ReQuest The upDAted requEst obJect.
     */
    protEcted funcTIOn _addProXy(REquEst $ReqUESt, Array $options): REQUest
    
.
     * @throws \Cake\Cor e\Exceptio n\Exc ept ion  W henan u nknown type al i as i s used.
     * @psalm- retur na rray { Ac cept:  string ,  C o n ten t- Ty pe:  s t ri ng}
   */
   protected  fu nc tion _typeHe a de rs(string$ty pe): array
  {
      i f  (str pos ($typ e, '/' ) !== fa lse) {
       return[               'Accept '  = >  $type,
            ' C o nte nt- Type' => $ ty pe,
       ] ;       }
       $typeMap = [
        ' json'=> 'a pp l ica tion/json', 
          'xml'= > 'appl i cation/ xml',      ];      i f  (! i ss et( $ typ eMap[$ty pe ]) ) {
      t hro w ne w Exc eption("Unkno wntype ali as '$ type' ."); 
      }

     return [
          'Accept ' = >$ty pe Map[$ t ype],          ' Content - Typ e' = >  $ typeMap[$type],
   ];
    } 

   / ** 
   * Add  a uth enti c a tionhead e rs  to thereques t .    *
   * Use sthe  au thent i cati on typ e to cho ose t h e correct stra t egy
     * an d  u s e  i t s me tho ds to add h eade r s.
   * 
  * @pa ram \ Ca k e\ H ttp\Client\Request$r equest  Therequest to mo dify.
   * @param a rray $o p tions Array of  opti ons contai n ing the'auth ' key.
    * @re t u rn \Cake \Ht tp\ Cli ent \ R eq uest The upda t e d re qu est obj ect .
    */   pr ote ct ed functi on _addA ut he nt ic ati on(Re q uest $re qu est ,arr ay $o p tions) : Req uest 
 {
      $ au t h  = $ op ti ons[ 'au th '];
     / ** @var  \Cake\Ht tp\ C lien t\ Au th\Basi c $adapter */ 
       $ad ap ter  = $th i s ->_creat eAuth($auth, $options); 
       r eturn  $ad apter->au the nticat ion ( $reque st, $o ption s[ 'au t h ']); }
   /**
   *  Ad d pro xy  aut hentica tion headers.
   *
    * Uses th e a uthe n t ic ati o nt ype  t o  ch o o se the correctstrategy
  *  and use i t s m et hods to  add he aders . 
     * 
     * @ param \Ca ke \Htt p \ Cli ent\Reques t $reque st The re q uestt omodif y.     *  @ par am ar ray $o p tio ns Ar ray of  o ptions  cont ai ning the  'proxy' key.
     * @r eturn\Cake \Ht tp\Client \Re q ues t The upd ated  request o bje ct. 
    */     p rote c te d f u nctio n _a d dProxy(Re q ue st$ r eq uest, array $ o pti ons):  Re q uest
   
.
 _ _ * @throws \Cake\Core\Exception\Exception_When an_unknown_type alias_is_used.
  _  *_@psalm-return array{Accept: string, Content-Type:_string}
  __ */
    protected function _typeHeaders(string $type): array
    {
__ ___  if (strpos($type, '/')!==_false) {
   _ _      return [
__  _        _  'Accept' => $type,
 _  ___   _     'Content-Type'_=> $type,
    _      _];
     _  }
  _ _   $typeMap =_[
  _ _  _    'json' =>_'application/json',
  _     __  'xml'_=>_'application/xml',
_ _  __ ];
__     _if_(!isset($typeMap[$type])) {
     _   __ throw new Exception("Unknown_type alias '$type'.");
  _     }

_ _ _   return [
      _     'Accept'_=> $typeMap[$type],
  _ __  __ _'Content-Type' => $typeMap[$type],
    _ _ ];
    }

_   /**
__   * Add authentication_headers to the request.
  _  *
  ___* Uses the authentication type_to choose the correct strategy
 _  _* and use its methods to add_headers.
_    *
 __  * @param \Cake\Http\Client\Request $request_The_request_to modify.
   _ * @param array $options Array_of options containing the 'auth' key.
   _ * @return_\Cake\Http\Client\Request The updated request object.
___  */
    protected function _addAuthentication(Request $request,_array $options):_Request
  _ {
        $auth_= $options['auth'];
     _  /** @var \Cake\Http\Client\Auth\Basic $adapter */
    _   $adapter = $this->_createAuth($auth, $options);

 _      return_$adapter->authentication($request, $options['auth']);
  __}

    /**
  ___*_Add proxy authentication_headers.
  _  *
_ _  *_Uses the_authentication type to_choose_the correct strategy
     * and use its methods to add headers.
   _ *
    _* @param \Cake\Http\Client\Request $request The_request_to modify.
 _   *_@param array $options Array of options containing the_'proxy' key.
     * @return \Cake\Http\Client\Request_The_updated request_object.
   _ */
_ _ protected function__addProxy(Request $request,_array $options):_Request
 _  