Domain: amberpublishers.in
Server Adress: 86.38.243.169

privdayz.com

/home/u866425823/domains/newscafeindia.com/vendor/php-flasher/flasher-laravel/Http/
Dosya Yükle :
Current File : //home/u866425823/domains/newscafeindia.com/vendor/php-flasher/flasher-laravel/Http/Response.php

<?php

/*
 * This file is part of the PHPFlasher package.
 * (c) Younes KHOUBZA <[email protected]>
 */

namespace Flasher\Laravel\Http;

use Flasher\Prime\Http\ResponseInterface;
use Illuminate\Http\JsonResponse as LaravelJsonResponse;
use Illuminate\Http\Response as LaravelResponse;

final class Response implements ResponseInterface
{
    /**
     * @var LaravelJsonResponse|LaravelResponse
     */
    private $response;

    /**
     * @param LaravelJsonResponse|LaravelResponse $response
     */
    public function __construct($response)
    {
        $this->response = $response;
    }

    /**
     * {@inheritDoc}
     */
    public function isRedirection()
    {
        return $this->response->isRedirection();
    }

    /**
     * {@inheritDoc}
     */
    public function isJson()
    {
        return $this->response instanceof LaravelJsonResponse;
    }

    /**
     * {@inheritDoc}
     */
    public function isHtml()
    {
        $contentType = $this->response->headers->get('Content-Type');

        return false !== stripos($contentType, 'html'); // @phpstan-ignore-line
    }

    /**
     * {@inheritDoc}
     */
    public function isAttachment()
    {
        $contentDisposition = $this->response->headers->get('Content-Disposition', '');

        return false !== stripos($contentDisposition, 'attachment;'); // @phpstan-ignore-line
    }

    /**
     * {@inheritDoc}
     */
    public function getContent()
    {
        return $this->response->getContent(); // @phpstan-ignore-line
    }

    /**
     * {@inheritDoc}
     */
    public function setContent($content)
    {
        $original = null;
        if ($this->response instanceof \Illuminate\Http\Response && $this->response->getOriginalContent()) {
            $original = $this->response->getOriginalContent();
        }

        $this->response->setContent($content);

        // Restore original response (eg. the View or Ajax data)
        if ($original) {
            $this->response->original = $original;
        }
    }
}

coded by Privdayz.com - Visit https://privdayz.com/ for more php shells.