api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Middleware.php 732B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Tqdev\PhpCrudApi\Middleware\Base;
  3. use Tqdev\PhpCrudApi\Controller\Responder;
  4. use Tqdev\PhpCrudApi\Middleware\Router\Router;
  5. abstract class Middleware implements Handler
  6. {
  7. protected $next;
  8. protected $responder;
  9. private $properties;
  10. public function __construct(Router $router, Responder $responder, array $properties)
  11. {
  12. $router->load($this);
  13. $this->responder = $responder;
  14. $this->properties = $properties;
  15. }
  16. public function setNext(Handler $handler) /*: void*/
  17. {
  18. $this->next = $handler;
  19. }
  20. protected function getProperty(String $key, $default)
  21. {
  22. return isset($this->properties[$key]) ? $this->properties[$key] : $default;
  23. }
  24. }