ErrorException Required parameter $alias follows optional parameter $params in codeigniter [duplicate] - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Thursday, March 31, 2022

ErrorException Required parameter $alias follows optional parameter $params in codeigniter [duplicate]

this is php 8 and this error appears everytime from my incomingRequest.php file

the error states ```Deprecated: Required parameter $userAgent follows optional parameter $body``

the initial code

public function __construct($config, URI $uri = null, $body = 'php://input', UserAgent $userAgent)
    {
        // Get our body from php://input
        if ($body === 'php://input')
        {
            $body = file_get_contents('php://input');
        }

        $this->body      = ! empty($body) ? $body : null;
        $this->config    = $config;
        $this->userAgent = $userAgent;

        
parent::__construct($config);

        $this->populateHeaders();

this is php 8 and this error appears everytime from my incomingRequest.php file

the error states ```Deprecated: Required parameter $userAgent follows optional parameter $body``

the initial code

public function __construct($config, URI $uri = null, $body = 'php://input', UserAgent $userAgent)
    {
        // Get our body from php://input
        if ($body === 'php://input')
        {
            $body = file_get_contents('php://input');
        }

        $this->body      = ! empty($body) ? $body : null;
        $this->config    = $config;
        $this->userAgent = $userAgent;

        
parent::__construct($config);

        $this->populateHeaders();


source https://stackoverflow.com/questions/71682188/errorexception-required-parameter-alias-follows-optional-parameter-params-in-c

No comments:

Post a Comment