As documented in https://wiki.php.net/rfc/use_global_elements, the engine (by default) does a local namespace
lookup, then falls back to global namespace when first calling a global function referenced in namespaced code,
unless that function is referenced via fully qualified name (FQN).
By using the FQN, the actual symbol can be looked up at compile-time, both by the PHP engine and by static analysis
tooling, allowing for compiler (in particular) optimizations to replace known hot-path functions with specialized opcodes.
Sadly, no actual benchmark at hand: the improvements can be minimal or massive, depending on where this library is
used (tight loops being most relevant).
* 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
I realized, that 30% of the request time in our app is spent by
hydrating the uuid (We are using Doctrine and in this specific request
I was accidentally hydrating few thousands entities). Luckily, I
remembered the #160 and tried to do similar optimization for uuid
decoding. It resulted in 10-20% performance improvement.
Defers all environment related decisions to factory initialization
All behavior is customizable through DI, but all deps are initialized to proper default instances
Removes static factory configuration
Remove $littleEndian parameter
Add fromGuidString/Bytes factory methods for GUIDs
No longer possible to output GUIDs as UUIDs and vice-versa
Pass tests