Run Psalm on src as well as Static Analysis Fixture (#282)

* Run Psalm on src as well as Static Analysis Fixture

Psalm baselining feature is used to prevent immediate build failures -
psalm will just cause failures for errors caused by future changes to
the code.

See https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file

* Fix MixedArgument issues in OrderedTimeCodec

Potentially unpack should be documented as returning string[] instead of
array to make this unecassary.

* Fix Psalm PossiblyNullPropertyAssignmentValue issues

* Add psalm-immutable annotation to Uuid class

* Fix Psalm MixedArgument issues

* Fix MissingImmutableAnnotation psalm issue

* Fix Psalm MixedAssignment issue

* Fix Psalm InvalidReturnStatement / InvalidReturnType issue

* Add ImpureMethodCall issues to baseline.

Fixing these in one place just moves them somewhere else.

* Exclude psalm-baseline.xml from exported git archives
This commit is contained in:
Barney Laurance
2019-12-28 00:35:40 +00:00
committed by Ben Ramsey
parent 27e1c4e073
commit bdc9170edc
10 changed files with 157 additions and 8 deletions
+5 -1
View File
@@ -75,7 +75,11 @@ class OrderedTimeCodec extends StringCodec
);
}
$hex = unpack('H*', $bytes)[1];
$unpacked = unpack('H*', $bytes);
assert(is_string($unpacked[1]));
$hex = $unpacked[1];
// Rearrange the fields to their original order
$hex = substr($hex, 8, 4)