slimphp / Slim-Csrf

Slim Framework CSRF protection middleware
MIT License
336 stars 58 forks source link

[Discussion] Source code using PSR-7 Interface or Slim Interface #30

Closed geggleto closed 9 years ago

geggleto commented 9 years ago

I see a lot of TypeHinting PSR-7 interface but usage of Slim Add-On methods.

Using the PSR-7 Type-Hint's seem wrong since we are requiring methods that only exist on the Slim\Http versions.

Thoughts on changing this?

Examples: https://github.com/slimphp/Slim-Csrf/blob/master/src/Guard.php#L128 https://github.com/slimphp/Slim-Csrf/blob/master/src/Guard.php#L162-L163 https://github.com/slimphp/Slim-Csrf/blob/master/src/Guard.php#L314 https://github.com/slimphp/Slim-Csrf/blob/master/src/Guard.php#L297-L298

JoeBengalen commented 9 years ago

first, second and third examples are all part of psr7 ServerRequestInterface.

I don't understand the last example as its not code on the request/response?

geggleto commented 9 years ago

Ah the type hints DONT use the Server* variant.

I will add this to my open PR.

geggleto commented 9 years ago

See #28