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

chore: Add psalm for code analysis #911

Merged
merged 3 commits into from
Sep 14, 2024
Merged

chore: Add psalm for code analysis #911

merged 3 commits into from
Sep 14, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Aug 20, 2024

Fixes #705

Fix all detected problem.
There should be no¹ change in logic or behavior.

¹ Well one exception: If a suspicious login could not be persisted the code threw at some random place, so instead we handle this by notify the user and log that as critical severity.

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot

lib/Service/LoginClassifier.php Outdated Show resolved Hide resolved
lib/Service/LoginClassifier.php Outdated Show resolved Hide resolved
@@ -148,7 +148,7 @@ public function load(int $id): Estimator {
}

/**
* @param Estimator|Persistable $estimator
* @param Estimator $estimator (Must implement Persistable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be done in a follow up, but this causes many issues as all functions also need to return the correct type.

@susnux susnux force-pushed the chore/add-psalm branch 5 times, most recently from 8f7cf51 to 8a04581 Compare August 20, 2024 18:51
@susnux
Copy link
Contributor Author

susnux commented Aug 20, 2024

php8.0 lint Expected — Waiting for status to be reported

This needs to be removed from the expected checks - it does not exist as we can only check 8.1+
Alternatively merge this here first: #914

@susnux susnux force-pushed the chore/add-psalm branch 3 times, most recently from 00cda81 to 14dbeae Compare August 20, 2024 20:41
@susnux susnux requested a review from miaulalala August 20, 2024 20:57
Fix all detected problem.
There should be no¹ change in logic or behavior.

¹ Well one exception: If a suspicious login could not be persisted the code threw at some random place, so instead we handle this by notify the user and log that as critical severity.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux merged commit a10bd94 into master Sep 14, 2024
31 checks passed
@susnux susnux deleted the chore/add-psalm branch September 14, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup psalm
2 participants