Skip to content

Commit

Permalink
updating packages, updating implementation, partially satisfying stat…
Browse files Browse the repository at this point in the history
…ic analysis
  • Loading branch information
SignpostMarv committed Jan 9, 2020
1 parent fbf1e1d commit cdd7b29
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 192 deletions.
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,6 +1,7 @@
dist: xenial
language: php
php:
- 7.4.0
- 7.4
cache:
directories:
Expand Down
10 changes: 7 additions & 3 deletions Tests/fixtures/Routes/Throws.php
Expand Up @@ -17,8 +17,7 @@
* @psalm-type T1 = array{msg:string}
* @psalm-type T2 = MessageArgs
* @psalm-type R_TYPED = Response
*
* @template-extends DaftRouteAcceptsOnlyTypedArgs<T1, T1, T2, R_TYPED, 'GET', 'GET'>
* @psalm-type THTTP = 'GET'|'POST'|'CONNECT'|'DELETE'|'HEAD'|'OPTIONS'|'PATCH'|'PURGE'|'PUT'|'TRACE'
*/
class Throws extends DaftRouteAcceptsOnlyTypedArgs
{
Expand All @@ -29,7 +28,12 @@ class Throws extends DaftRouteAcceptsOnlyTypedArgs
*/
public static function DaftRouterHandleRequestWithTypedArgs(Request $request, TypedArgs $args) : Response
{
static::DaftRouterAutoMethodChecking($request->getMethod());
/**
* @var THTTP
*/
$method = $request->getMethod();

static::DaftRouterAutoMethodChecking($method);

throw new RuntimeException($args->msg);
}
Expand Down
15 changes: 8 additions & 7 deletions composer.json
Expand Up @@ -42,21 +42,22 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
"dev-master": "3.4.x-dev"
}
},
"conflict": {
"vimeo/psalm": "<3.7"
"vimeo/psalm": "<3.8"
},
"suggest": {
"vimeo/psalm": "Useful for static analysis to reduce runtime type checks etc."
},
"require": {
"php": "^7.4",
"filp/whoops": "^2.5",
"filp/whoops": "^2.7",
"psr/log": "^1.1",
"signpostmarv/daft-framework": "^3.3",
"signpostmarv/daft-router": "^4.3",
"signpostmarv/daft-framework": "^3.4|3.4.x-dev",
"signpostmarv/daft-router": "^4.4|4.4.x-dev",
"signpostmarv/daft-typed-object": "^0.5|0.5.x-dev",
"symfony/http-foundation": "^4.4|^5.0"
},
"require-dev": {
Expand All @@ -68,7 +69,7 @@
"psalm/plugin-phpunit": "^0.8.0",
"roave/security-advisories": "dev-master",
"sebastian/phpcpd": "^4.1",
"signpostmarv/php-cs-fixer-config": "^0.13.0",
"vimeo/psalm": "^3.7"
"signpostmarv/php-cs-fixer-config": "^0.14.0",
"vimeo/psalm": "^3.8"
}
}

0 comments on commit cdd7b29

Please sign in to comment.