Commit Graph

15 Commits

Author SHA1 Message Date
Ben Ramsey f1891183f9 Upgrade PHPStan 2022-08-05 14:46:56 -05:00
Graham Campbell 2ed177534e Ignore serialization shape checking for code coverage purposes 2021-09-05 14:03:47 +01:00
Graham Campbell 0997de99a2 Add support for PHP 8.1 2021-09-05 12:41:13 +01:00
Ben Ramsey 4511ccd7e6 chore(deps): upgrade vimeo/psalm 2021-08-06 14:25:16 -05:00
Ben Ramsey 0a25f73ae0 Fix static analysis issues 2020-10-28 21:19:26 -05:00
Ben Ramsey 8a8d5d4ba8 Add isNegative() to the Type\NumberInterface 2020-03-07 10:57:12 -06:00
Ben Ramsey b3c26661ca Correct capitalization of microsecond 2020-03-04 16:51:46 -06:00
Ben Ramsey a21eb6c3ca Update TypeInterface to extend JsonSerializable and Serializable 2020-03-04 16:44:05 -06:00
Ben Ramsey 0bd312f944 Improve test coverage 2020-02-26 20:17:49 -06:00
Ben Ramsey ad75532dc8 Add a Type\TypeInterface that each of the ramsey/uuid types implements 2020-02-21 12:16:49 -06:00
Ben Ramsey f42afcecbb Rename Type\IntegerValue to Type\Integer
Rename `Type\IntegerValue` to `Type\Integer`. It was originally named
`IntegerValue` because static analysis sees `Integer` in docblock
annotations and treats it as the native `int` type. `Integer` is not a
reserved word in PHP, so it should be named `Integer` for consistency
with other types in this library. When using it, a class alias prevents
static analysis from complaining.
2020-02-21 11:59:49 -06:00
Ben Ramsey 303b973c5c Remove @psalm-suppress annotations from BrickMathCalculator
Closes #294
2020-02-21 03:06:37 -06:00
Marco Pivetta a252f29847 Import used functions and constants via use statement to disallow ambiguity for compiler/static-analysis
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).
2020-02-03 13:15:35 -06:00
Ben Ramsey a8d52100de Support microtime in returned DateTimeInterface instances
Fixes #90 and supersedes #93.
2020-01-19 23:21:48 -06:00
Ben Ramsey 07fc6b8f6f Add Hexadecimal, IntegerValue, and Time types 2020-01-18 12:13:57 -06:00