Skip to content

Question about Filters #824

Description

@natanfelles

Currently a Controller Filter have this skelleton:

<?php namespace App\Filters;

use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Filters\FilterInterface;

class MyFilter implements FilterInterface
{
	public function before(RequestInterface $request)
	{
		//
	}

	public function after(RequestInterface $request, ResponseInterface $response)
	{
		//
	}
}

What about to update for something like:

<?php namespace App\Filters;

use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\Response;
use CodeIgniter\Filters\FilterInterface;

class MyFilter implements FilterInterface
{
	public function before(IncomingRequest $request)
	{
		//
	}

	public function after(IncomingRequest $request, Response $response)
	{
		//
	}
}

Motive: We will can use all methods of the IncomingRequest and Response. I think that the interfaces only are a little limited in this place.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions