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

Create Check_Result class #50

Merged
merged 7 commits into from
Jan 9, 2023
Merged

Conversation

jjgrainger
Copy link
Contributor

Adds the Check_Result class

Closes #11

@jjgrainger jjgrainger added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall plugin infrastructure Milestone 1 labels Dec 22, 2022
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@jjgrainger Left a few comments, mostly LGTM.

includes/Checker/Check_Result.php Outdated Show resolved Hide resolved
includes/Checker/Check_Result.php Outdated Show resolved Hide resolved
includes/Checker/Check_Result.php Outdated Show resolved Hide resolved
includes/Checker/Check_Result.php Outdated Show resolved Hide resolved
includes/Checker/Check_Result.php Outdated Show resolved Hide resolved
@felixarntz felixarntz mentioned this pull request Jan 3, 2023
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@jjgrainger Production code LGTM, left some feedback on the tests.

tests/Checker/Check_Result_Tests.php Show resolved Hide resolved
tests/Checker/Check_Result_Tests.php Show resolved Hide resolved
tests/Checker/Check_Result_Tests.php Outdated Show resolved Hide resolved
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@jjgrainger Thanks, LGTM!

Comment on lines +12 to +17
/**
* Check_Result instance.
*
* @var Check_Result
*/
protected $check_result;
Copy link
Member

Choose a reason for hiding this comment

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

FYI no need to do any formal doc blocks in tests. It's good to add comments when a test method does things that may not be immediately clear on why it does so, but generally tests don't need docs.

Obviously not a blocker, it's okay to have this. But not needed :)

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks @jjgrainger The PR looks solid to me. I have only one suggestion regarding the count function.

Can we use the count function for errors and warnings? If yes, then it removes two variables from the class and the increment logic for those variables.

Ie.

public function get_error_count() {
    return count( $this->errors );
}

cc. @felixarntz

@jjgrainger
Copy link
Contributor Author

Thanks @mukeshpanchal27

The structure of the errors and warnings arrays mean we cannot use the count() function and why we track the warning/errors count manually.

@jjgrainger jjgrainger merged commit c8887a7 into trunk Jan 9, 2023
@jjgrainger jjgrainger deleted the feature/create-check-result-class branch January 9, 2023 09:37
bordoni pushed a commit that referenced this pull request Sep 13, 2023
* Disallow functions: move_uploaded_file, passthru, proc_open

* Adjust tests
bordoni added a commit that referenced this pull request Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issues for the overall plugin infrastructure [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Check_Result class
3 participants