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

remove strong type on SendFeedbackForFeature function #18547

Merged
merged 4 commits into from Jan 6, 2022

Conversation

peterhashair
Copy link
Contributor

@peterhashair peterhashair commented Dec 28, 2021

Description:

Fixes: #18537
remove strong type on SendFeedbackForFeature function

Review

remove strong type on functions
@peterhashair peterhashair changed the title remove strong type on feedback send feature function remove strong type on SendFeedbackForFeature function Dec 28, 2021
@peterhashair peterhashair added this to the 4.7.0 milestone Dec 29, 2021
@peterhashair peterhashair added Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Dec 29, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2022

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jan 5, 2022
@peterhashair peterhashair removed the Stale The label used by the Close Stale Issues action label Jan 5, 2022
update int to string
@@ -31,11 +31,11 @@ class API extends \Piwik\Plugin\API
* config: "feedback_email_address".
*
* @param string|null $featureName The name of a feature you want to give feedback to.
* @param int $like Whether you like the feature or not
* @param string|null $like Whether you like the feature or not
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is a bit strange to use string|null and then set the default to $like = false.

* @param string|null $choice Multiple choice option chosen
* @param string|null $message A message containing the actual feedback
*/
public function sendFeedbackForFeature(?string $featureName, int $like, ?string $choice, ?string $message = null)
public function sendFeedbackForFeature($featureName, $like = false, $choice = null, $message = null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should be $like = null

@@ -257,7 +257,7 @@ export default defineComponent({
AjaxHelper.fetch({
method: 'Feedback.sendFeedbackForFeature',
featureName: this.title,
like: this.like ? '1' : '0',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest keeping this line as is otherwise both 'true' and 'false' may be true in php

Copy link
Contributor

@justinvelluppillai justinvelluppillai left a comment

Choose a reason for hiding this comment

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

Left a couple comments needing fixing

update type
@peterhashair peterhashair merged commit 9ed7e18 into 4.x-dev Jan 6, 2022
@peterhashair peterhashair deleted the m-18537-feedback-api branch January 6, 2022 05:14
@sgiehl
Copy link
Member

sgiehl commented Jan 6, 2022

@justinvelluppillai @peterhashair didn't you see that the vue build action failed for this PR due to some code formatting issues? Would be good to always check that before merging, as now the action fails for all PRs after merging in latest changes...
We maybe should consider to require this action to pass for a PR to be mergeable.

@justinvelluppillai
Copy link
Contributor

@sgiehl sorry missed that - yes certainly the build should always be required to pass at least before merging.

@sgiehl
Copy link
Member

sgiehl commented Jan 6, 2022

I have pushed a fix here: #18525
Will merge the PR soon, so it will be fixed on 4.x-dev as well.

@peterhashair
Copy link
Contributor Author

@sgiehl yes, sorry, I forgot to update the VUE format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error: In Feedback.sendFeedbackForFeature API
3 participants