Skip to content

Commit 4cd8491

Browse files
committed
Increase PHPStan rule level
1 parent 295270b commit 4cd8491

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ composer.lock
22
/vendor/
33
/tmp/
44
phpcs.xml
5+
phpstan.neon
56
phpunit.xml

phpstan.neon.dist

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
includes:
22
- vendor/phpstan/phpstan-phpunit/extension.neon
33
- vendor/phpstan/phpstan-phpunit/rules.neon
4+
45
parameters:
5-
level: 1
6-
paths:
7-
- src
8-
- tests
6+
level: 5
7+
paths:
8+
- src
9+
- tests
10+
11+
universalObjectCratesClasses:
12+
- gapple\StructuredFields\Dictionary
13+
- gapple\StructuredFields\Parameters

src/Serializer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private static function serializeInteger(int $value): string
170170
if ($value > 999999999999999 || $value < -999999999999999) {
171171
throw new SerializeException("Integers are limited to 15 digits");
172172
}
173-
return $value;
173+
return (string) $value;
174174
}
175175

176176
private static function serializeDecimal(float $value): string

tests/Httpwg/HttpwgTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ protected function rulesetDataProvider(): array
3232
}
3333

3434
$dataset = [];
35+
/** @var \stdClass $rule */
3536
foreach ($rules as $rule) {
3637
if (isset($rule->expected)) {
3738
try {
@@ -166,6 +167,7 @@ private static function convertExpectedDictionary(array $dictionary): Dictionary
166167
private static function convertValue($data)
167168
{
168169
if (is_object($data) && property_exists($data, '__type')) {
170+
/** @var \stdClass $data */
169171
switch ($data->__type) {
170172
case 'token':
171173
return new Token($data->value);

0 commit comments

Comments
 (0)