Skip to content

chore: clean up and add comments to NodeResolver::resolve_uri() conditional logic.#2656

Merged
jasonbahl merged 1 commit intowp-graphql:developfrom
justlevine:chore/resolve_uri-comment-conditionals
Dec 7, 2022
Merged

chore: clean up and add comments to NodeResolver::resolve_uri() conditional logic.#2656
jasonbahl merged 1 commit intowp-graphql:developfrom
justlevine:chore/resolve_uri-comment-conditionals

Conversation

@justlevine
Copy link
Copy Markdown
Collaborator

What does this implement/fix? Explain your changes.

This PR cleans up NodeResolver::resolve_uri() to make it more readable and maintainable.

More specifically, it replaces the use of elseif() with a regular if() when the previous conditional returns early, adding a comment before each one explaining the case trying to be handled.

Supersedes (partially): #2342

Note: No method logic has been changed by this PR.

This PR is intentionally limited in scope, to allow for additional incremental PRs with smaller changesets (and possibilities for regressions), since NodeResolver is currently one of the most fragile classes currently in the codebase.

Does this close any currently open issues?

Part of #2366

Any relevant logs, error output, GraphiQL screenshots, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

Where has this been tested?

Operating System: Ubuntu 20.04 (wsl2 + devilbox + php 8.0.19)

WordPress Version: 6.1.1

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 2f99e42 and detected 0 issues on this pull request.

View more on Code Climate.

@justlevine justlevine added component: architecture Relating to fundamental architectural decisions type: chore Maintenance tasks, refactoring, and other non-functional changes scope: code quality Refactoring, linting, and enforcing coding standards labels Dec 6, 2022
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 81.362% when pulling 2f99e42 on justlevine:chore/resolve_uri-comment-conditionals into 790c1ef on wp-graphql:develop.

@justlevine justlevine added the status: in review Awaiting review before merging or closing label Dec 6, 2022
@justlevine justlevine requested a review from jasonbahl December 6, 2022 22:43
@jasonbahl jasonbahl merged commit 4a5c592 into wp-graphql:develop Dec 7, 2022
@justlevine justlevine deleted the chore/resolve_uri-comment-conditionals branch December 7, 2022 00:45
@jasonbahl jasonbahl mentioned this pull request Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: architecture Relating to fundamental architectural decisions scope: code quality Refactoring, linting, and enforcing coding standards status: in review Awaiting review before merging or closing type: chore Maintenance tasks, refactoring, and other non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants