[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/http/src/ -> Response.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Http Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Http;
  10  
  11  use Laminas\Diactoros\Response as PsrResponse;
  12  
  13  /**
  14   * HTTP response data object class.
  15   *
  16   * @property-read  string   $body     The response body as a string
  17   * @property-read  integer  $code     The status code of the response
  18   * @property-read  array    $headers  The headers as an array
  19   *
  20   * @since  1.0
  21   */
  22  class Response extends PsrResponse
  23  {
  24      /**
  25       * Magic getter for backward compatibility with the 1.x API
  26       *
  27       * @param   string  $name  The variable to return
  28       *
  29       * @return  mixed
  30       *
  31       * @since   2.0.0
  32       * @deprecated  3.0  Access data via the PSR-7 ResponseInterface instead
  33       */
  34  	public function __get($name)
  35      {
  36          switch (strtolower($name))
  37          {
  38              case 'body':
  39                  return (string) $this->getBody();
  40  
  41              case 'code':
  42                  return $this->getStatusCode();
  43  
  44              case 'headers':
  45                  return $this->getHeaders();
  46  
  47              default:
  48                  $trace = debug_backtrace();
  49  
  50                  trigger_error(
  51                      sprintf(
  52                          'Undefined property via __get(): %s in %s on line %s',
  53                          $name,
  54                          $trace[0]['file'],
  55                          $trace[0]['line']
  56                      ),
  57                      E_USER_NOTICE
  58                  );
  59  
  60                  break;
  61          }
  62      }
  63  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer