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

[CLEANUP] Avoid Hungarian notation in CSSBlockList (part 2) #851

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

oliverklee
Copy link
Contributor

Part of #756

@coveralls
Copy link

coveralls commented Jan 29, 2025

Coverage Status

coverage: 45.006%. remained the same
when pulling f349c98 on cleanup/hungarian-cssblocklist
into dbf016e on main.

Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

I think renaming $aSpecificitySearch to $specificitySearchResults is not accurate.

$sComparator = $aSpecificitySearch[0];
$iTargetSpecificity = $aSpecificitySearch[1];
$comparator = '===';
$specificitySearchResults = \explode(' ', $specificitySearch);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be named with something like 'parts', 'elements' or 'components'. The input string contains either a number (e.g. "1"), or an operator and a number (e.g. ">= 1"). The result goes into $result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe $expressionParts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I think that works. It's only used locally in that small section of code.

@oliverklee oliverklee force-pushed the cleanup/hungarian-cssblocklist branch from 5a2b89f to 4bf8ee8 Compare January 30, 2025 09:45
@oliverklee oliverklee requested a review from JakeQZ January 30, 2025 09:45
@oliverklee oliverklee force-pushed the cleanup/hungarian-cssblocklist branch from 4bf8ee8 to afdefc5 Compare January 30, 2025 09:54
Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

I spotted another naming issue I missed when I reviewed previously.

switch ($sComparator) {
$targetSpecificity = (int) $targetSpecificity;
$selectorSpecificity = $selector->getSpecificity();
$hasMatches = false;
Copy link
Contributor

@JakeQZ JakeQZ Jan 30, 2025

Choose a reason for hiding this comment

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

Apologies, I missed this in the previous review.

I don't think "has" is correct here. The equivalent linguistic phrase is "it matches" rather than "it has matches" - i.e. "matches" is a verb rather than a noun.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better late than never. ;-) I've come up with a different name and repushed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe comparatorMatched?

@JakeQZ JakeQZ merged commit c8a7b5f into main Jan 30, 2025
21 checks passed
@JakeQZ JakeQZ deleted the cleanup/hungarian-cssblocklist branch January 30, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants