Skip to content

Instantly share code, notes, and snippets.

@djmetzle
Created June 4, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djmetzle/c73d0eaa7aca042b7364921423622ebe to your computer and use it in GitHub Desktop.
Save djmetzle/c73d0eaa7aca042b7364921423622ebe to your computer and use it in GitHub Desktop.
a new attempt at a controller interface
<?
declare(strict_types = 1);
namespace iFixit\Framework\Interfaces;
abstract class AbstractController {
abstract public function routes(): RouteList {}
}
@djmetzle
Copy link
Author

djmetzle commented Jun 4, 2019

functions should implement something like:

public function <handle>(Request $request, $diContainers, ...$getParams): Reponse {}

@djmetzle
Copy link
Author

djmetzle commented Jun 5, 2019

On a second pass here, i was mistaken about injecting a DI container into route handlers. We should be injecting the Request object though.

Revised handler signature:

public function <handle>(Request $request, ...$getParams): Reponse {}

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