Skip to content

Fix: Remove redundant function_exists check in checkNodePath#9

Closed
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix/remove-redundant-check
Closed

Fix: Remove redundant function_exists check in checkNodePath#9
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix/remove-redundant-check

Conversation

@google-labs-jules
Copy link

This pull request addresses a small performance optimization by removing a redundant function_exists check in the XmlProcessor::checkNodePath method. The original code had a typo (str_end_with instead of str_ends_with) and was falling back to substr_compare. The code has been simplified to use str_ends_with() directly, improving readability and removing the unnecessary check.


PR created automatically by Jules for task 13754263547782446615

The `checkNodePath` method contained a `function_exists` check for `str_end_with`, which is a typo for the `str_ends_with` function. The fallback `substr_compare` was always being used.

This commit refactors the check to use `str_ends_with()` directly, which is available in PHP 8.0+ and simplifies the code. This also addresses the user's request to remove the redundant check.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

I will automatically address your feedback. For any comments you don't want me to act on, just include (aside).



For security, I will only act on instructions from the user who triggered this task for this pull request.

@github-actions
Copy link

Code Coverage

Package Line Rate Health
features/NodeProcessor/ArrayNodeProcessor.php 100%
features/NodeProcessor/InvokeNodeProcessorInterface.php 0%
features/NodeProcessor/TextNodeProcessor.php 100%
src/NodeProcessor/AbstractNodeProcessor.php 100%
src/NodeProcessor/CloseNodeProcessorInterface.php 0%
src/NodeProcessor/Context/AbstractElementContext.php 100%
src/NodeProcessor/Context/CloseContext.php 0%
src/NodeProcessor/Context/NodeProcessorContext.php 100%
src/NodeProcessor/Context/OpenContext.php 100%
src/NodeProcessor/Context/TextContext.php 100%
src/NodeProcessor/NodeProcessorInterface.php 0%
src/NodeProcessor/OpenNodeProcessorInterface.php 0%
src/NodeProcessor/TextNodeProcessorInterface.php 0%
src/XmlProcessor.php 96%
src/XmlProcessorContext.php 100%
Summary 98% (142 / 145)

Minimum allowed line rate is 60%

@Scarbous Scarbous closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant