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 Latte level 8 #177

Merged
merged 5 commits into from
Jul 18, 2023
Merged

PHPStan Latte level 8 #177

merged 5 commits into from
Jul 18, 2023

Conversation

spaze
Copy link
Owner

@spaze spaze commented Jul 18, 2023

  • Interview source name & href are always filled, no need to have them nullable
  • Make sure nullable values have a value when doing something with them

Ref #141

There will always be a venue because otherwise it wouldn't be non-remote but let's make sure.

Fixes
```
Parameter #1 $name of method MichalSpacekCz\Www\Presenters\VenuesPresenter::actionVenue() expects string, string|null given.
```
I believe this makes more sense than a custom component here, mostly because setting an HTTP response code in a control seems too late, but please don't quote me on that. And because I'm lazy to create one. You can quote me on that one.

Fixes errors like
```
 ------ ---------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   Compiled   Www/Presenters/templates/Trainings/common/discontinued.latte rendered from MichalSpacekCz\Www\Presenters\TrainingsPresenter::training included in Www/Presenters/templates/Trainings/training.latte
         line       See compiled template: /tmp/phpstan-latte/app/Www/Presenters/templates/Trainings/common/discontinued.latte.c71c89e220e831eac21a8b16bb8087a1.php
 ------ ---------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1      70         Argument of an invalid type array<int, MichalSpacekCz\Training\Discontinued\DiscontinuedTraining|null>|null supplied for foreach, only iterables are supported.
  2      76         Cannot call method getTrainings() on MichalSpacekCz\Training\Discontinued\DiscontinuedTraining|null.
  3      97         Cannot call method getDescription() on MichalSpacekCz\Training\Discontinued\DiscontinuedTraining|null.
  3      97         Cannot call method getNewHref() on MichalSpacekCz\Training\Discontinued\DiscontinuedTraining|null.
 ------ ---------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
@spaze spaze self-assigned this Jul 18, 2023
@spaze spaze mentioned this pull request Jul 18, 2023
@spaze spaze merged commit 586385d into main Jul 18, 2023
54 checks passed
@spaze spaze deleted the spaze/phpstan-latte-level-8 branch July 18, 2023 02:34
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 this pull request may close these issues.

None yet

1 participant