Skip to content

[CLEANUP] Avoid Hungarian notation for function #1070

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 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Value/CalcFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class CalcFunction extends CSSFunction
public static function parse(ParserState $parserState, bool $ignoreCase = false): CSSFunction
{
$aOperators = ['+', '-', '*', '/'];
$sFunction = $parserState->parseIdentifier();
$function = $parserState->parseIdentifier();
if ($parserState->peek() != '(') {
// Found ; or end of line before an opening bracket
throw new UnexpectedTokenException('(', $parserState->peek(), 'literal', $parserState->currentLine());
} elseif (!\in_array($sFunction, ['calc', '-moz-calc', '-webkit-calc'], true)) {
} elseif (!\in_array($function, ['calc', '-moz-calc', '-webkit-calc'], true)) {
// Found invalid calc definition. Example calc (...
throw new UnexpectedTokenException('calc', $sFunction, 'literal', $parserState->currentLine());
throw new UnexpectedTokenException('calc', $function, 'literal', $parserState->currentLine());
}
$parserState->consume('(');
$oCalcList = new CalcRuleValueList($parserState->currentLine());
Expand Down Expand Up @@ -100,6 +100,6 @@ public static function parse(ParserState $parserState, bool $ignoreCase = false)
if (!$parserState->isEnd()) {
$parserState->consume(')');
}
return new CalcFunction($sFunction, $list, ',', $parserState->currentLine());
return new CalcFunction($function, $list, ',', $parserState->currentLine());
}
}
4 changes: 2 additions & 2 deletions src/Value/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ public static function parsePrimitiveValue(ParserState $parserState)
*/
private static function parseMicrosoftFilter(ParserState $parserState): CSSFunction
{
$sFunction = $parserState->consumeUntil('(', false, true);
$function = $parserState->consumeUntil('(', false, true);
$arguments = Value::parseValue($parserState, [',', '=']);
return new CSSFunction($sFunction, $arguments, ',', $parserState->currentLine());
return new CSSFunction($function, $arguments, ',', $parserState->currentLine());
}

/**
Expand Down