Skip to content

Add get all css functions method #2

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

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

npghub
Copy link
Collaborator

@npghub npghub commented Oct 8, 2024

No description provided.

@npghub npghub marked this pull request as ready for review October 8, 2024 14:04
*
* @return array<int, CSSFunction>
*/
public function getAllFunctions($mElement = null)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Could we think of a better name for this? Maybe getFunctionsRecursively()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nitpick: Could we think of a better name for this? Maybe getFunctionsRecursively()?

I'm following the naming scheme of the file eg. getAllValues, getAllRulesets, etc.

} elseif ($oElement instanceof Rule) {
$this->allFunctions($oElement->getValue(), $aResult);
} elseif ($oElement instanceof CSSFunction) {
$aResult[] = $oElement;
Copy link
Member

Choose a reason for hiding this comment

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

Should we consider using generators to reduce memory usage? Would it be worthy 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we consider using generators to reduce memory usage? Would it be worthy 🤔

Nice. Yet I don't think this would go well with upstream if this change makes it there :) (very conservative. Maybe with good reason)

@npghub npghub merged commit ac01e86 into patched-2024 Oct 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants