Skip to content

Commit ad9cb11

Browse files
committed
Fixing code issues reported by the tools
1 parent 14e6bee commit ad9cb11

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/Value/Expression.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Sabberworm\CSS\Value;
46

5-
use Sabberworm\CSS\OutputFormat;
67
use Sabberworm\CSS\Parsing\ParserState;
78

89
/**
@@ -20,7 +21,7 @@ public static function parse(ParserState $oParserState, bool $bIgnoreCase = fals
2021
{
2122
$oParserState->consume('(');
2223
$aArguments = parent::parseArguments($oParserState);
23-
$mResult = new Expression("", $aArguments, ',', $oParserState->currentLine());
24+
$mResult = new Expression('', $aArguments, ',', $oParserState->currentLine());
2425
$oParserState->consume(')');
2526
return $mResult;
2627
}

src/Value/Value.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static function parsePrimitiveValue(ParserState $parserState)
164164
$value = LineName::parse($parserState);
165165
} elseif ($parserState->comes('U+')) {
166166
$value = self::parseUnicodeRangeValue($parserState);
167-
} elseif ($parserState->comes("(")) {
167+
} elseif ($parserState->comes('(')) {
168168
$value = Expression::parse($parserState);
169169
} else {
170170
$nextCharacter = $parserState->peek(1);

tests/ParserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ public function functionSyntax(): void
438438
/**
439439
* @test
440440
*/
441-
public function parseExpressions()
441+
public function parseExpressions(): void
442442
{
443443
$oDoc = self::parsedStructureForFile('expressions');
444444
$sExpected = 'div {height: (vh - 10);}'
@@ -1194,7 +1194,7 @@ public function lonelyImport(): void
11941194
/**
11951195
* @test
11961196
*/
1197-
public function functionArithmeticInFile()
1197+
public function functionArithmeticInFile(): void
11981198
{
11991199
$oDoc = self::parsedStructureForFile('function-arithmetic', Settings::create()->withMultibyteSupport(true));
12001200
$sExpected = 'div {height: max(300,vh + 10);}

tests/Unit/Value/ExpressionTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Sabberworm\CSS\Tests\Value;
46

57
use PHPUnit\Framework\TestCase;
@@ -30,7 +32,7 @@ public static function provideExpressions(): array
3032
[
3133
'input' => 'max(5, (vh - 10))',
3234
'expected_output' => 'max(5,(vh - 10))',
33-
'expression_index' => 1
35+
'expression_index' => 1,
3436
],
3537
];
3638
}
@@ -54,7 +56,7 @@ public function parseExpressions(string $input, string $expected, int $expressio
5456

5557
private function getDelimiters(string $rule): array
5658
{
57-
$closure = function($rule) {
59+
$closure = function ($rule) {
5860
return self::listDelimiterForRule($rule);
5961
};
6062

0 commit comments

Comments
 (0)