Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan Level 9 #147

Closed
spaze opened this issue Jun 12, 2023 · 0 comments · Fixed by #164
Closed

PHPStan Level 9 #147

spaze opened this issue Jun 12, 2023 · 0 comments · Fixed by #164
Assignees

Comments

@spaze spaze self-assigned this Jun 12, 2023
spaze added a commit that referenced this issue Jun 12, 2023
- Pass the fully qualified action instead of presenter and action as separate params
- Specify whether a default CSP should be used in `sendHeaders` param
- Can remove the `onRequest` event handler because the SecurityHeaders service can get the action itself now

For #147, because `$action = $request->getParameter(...)` returns mixed
spaze added a commit that referenced this issue Jun 12, 2023
For #147, "Part $uri (mixed) of encapsed string cannot be cast to string", also `(string)$_SERVER['REQUEST_URI']` gives "Cannot cast mixed to string" which is... exciting!
spaze added a commit that referenced this issue Jun 12, 2023
- Pass the fully qualified action instead of presenter and action as separate params
- Specify whether a default CSP should be used in `sendHeaders` param
- Can remove the `onRequest` event handler because the SecurityHeaders service can get the action itself now

For #147, because `$action = $request->getParameter(...)` returns mixed
spaze added a commit that referenced this issue Jun 12, 2023
For #147, "Part $uri (mixed) of encapsed string cannot be cast to string", also `(string)$_SERVER['REQUEST_URI']` gives "Cannot cast mixed to string" which is... exciting!
spaze added a commit that referenced this issue Jun 13, 2023
- Pass the fully qualified action instead of presenter and action as separate params
- Specify whether a default CSP should be used in `sendHeaders` param
- Can remove the `onRequest` event handler because the SecurityHeaders service can get the action itself now, this made the test a bit more difficult but that's fine

For #147, because `$action = $request->getParameter(...)` returns mixed
spaze added a commit that referenced this issue Jun 13, 2023
For #147, "Part $uri (mixed) of encapsed string cannot be cast to string", also `(string)$_SERVER['REQUEST_URI']` gives "Cannot cast mixed to string" which is... exciting!
spaze added a commit that referenced this issue Jun 13, 2023
Fixes these two

```
 ------ ---------------------------------------------------------------------------------------------------------------
  Line   app/Application/WebApplication.php
 ------ ---------------------------------------------------------------------------------------------------------------
  30     Parameter #2 $actionName of method MichalSpacekCz\Http\SecurityHeaders::setCsp() expects string, mixed given.
  44     Part $uri (mixed) of encapsed string cannot be cast to string.
 ------ ---------------------------------------------------------------------------------------------------------------
```

by using
1. the new spaze/csp-config API
2. existing objects to get the URL to redirect to

For #147
spaze added a commit that referenced this issue Jun 21, 2023
... to represent a training date. This cleans up quite a few messy things like naming, locations etc. See the commit messages.

Ref #147
spaze added a commit that referenced this issue Jun 27, 2023
From 84 errors down to 25.

For #147
spaze added a commit that referenced this issue Jun 29, 2023
From 25 errors down to just 6.

For #147
@spaze spaze closed this as completed in #164 Jul 2, 2023
spaze added a commit that referenced this issue Jul 2, 2023
From 6 errors in #156 down to zero, nil, nothing, nada.
And back to _max_ level which is 9 currently, see the [PHPStan config](https://github.com/phpstan/phpstan-src/blob/0d6755b37d986a3803cbb3b149f4af60e42c0829/conf/config.levelmax.neon#L1-L2).

Close #147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant