PHP 8.1.33
Preview: Request.php Size: 2.07 KB
/home/jambtst2015/public_html/ida.com.ng/libraries/vendor/laminas/laminas-diactoros/src/Request.php

<?php

/**
 * @see       https://github.com/laminas/laminas-diactoros for the canonical source repository
 * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md
 * @license   https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License
 */

declare(strict_types=1);

namespace Laminas\Diactoros;

use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;

use function strtolower;

/**
 * HTTP Request encapsulation
 *
 * Requests are considered immutable; all methods that might change state are
 * implemented such that they retain the internal state of the current
 * message and return a new instance that contains the changed state.
 */
class Request implements RequestInterface
{
    use RequestTrait;

    /**
     * @param null|string|UriInterface $uri URI for the request, if any.
     * @param null|string $method HTTP method for the request, if any.
     * @param string|resource|StreamInterface $body Message body, if any.
     * @param array $headers Headers for the message, if any.
     * @throws Exception\InvalidArgumentException for any invalid value.
     */
    public function __construct($uri = null, string $method = null, $body = 'php://temp', array $headers = [])
    {
        $this->initialize($uri, $method, $body, $headers);
    }

    /**
     * {@inheritdoc}
     */
    public function getHeaders() : array
    {
        $headers = $this->headers;
        if (! $this->hasHeader('host')
            && $this->uri->getHost()
        ) {
            $headers['Host'] = [$this->getHostFromUri()];
        }

        return $headers;
    }

    /**
     * {@inheritdoc}
     */
    public function getHeader($header) : array
    {
        if (! $this->hasHeader($header)) {
            if (strtolower($header) === 'host'
                && $this->uri->getHost()
            ) {
                return [$this->getHostFromUri()];
            }

            return [];
        }

        $header = $this->headerNames[strtolower($header)];

        return $this->headers[$header];
    }
}

Directory Contents

Dirs: 4 × Files: 21

Name Size Perms Modified Actions
Exception DIR
- drwxr-xr-x 2024-11-22 17:53:12
Edit Download
functions DIR
- drwxr-xr-x 2024-11-22 17:53:12
Edit Download
Request DIR
- drwxr-xr-x 2024-11-22 17:53:12
Edit Download
Response DIR
- drwxr-xr-x 2024-11-22 17:53:12
Edit Download
4.48 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.35 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
1.54 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
5.31 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
12.63 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
521 B lrw-r--r-- 2024-11-22 17:53:12
Edit Download
1.80 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.76 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
2.07 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
662 B lrw-r--r-- 2024-11-22 17:53:12
Edit Download
9.96 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
5.88 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
727 B lrw-r--r-- 2024-11-22 17:53:12
Edit Download
6.44 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
3.02 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
8.60 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
1.22 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
7.49 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
1.02 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
17.34 KB lrw-r--r-- 2024-11-22 17:53:12
Edit Download
621 B lrw-r--r-- 2024-11-22 17:53:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).