Monthly report: May 2022
Dump of my development activities
phpstan-dba - created by me
PHPStan based SQL static analysis and type inference for the database access layer. Supports @doctrineproject DBAL, PDO, mysqli with MySQL/MariaDB and @PostgreSQL.
Tweets
check your sql queries like a boss. resultset type inference included.
— markus staab (@markusstaab) May 19, 2022
next level static analysis - using the #phpstandba extension for @phpstan
Supports @doctrineproject DBAL, PDO, mysqli with MySQL/MariaDB and @PostgreSQL.https://t.co/eyK8jHxaY6
plz RT pic.twitter.com/5yt858JmPw
READ MORE Tweets
PHPStan - my contributions
PHPStan finds bugs in your code without writing tests
General Improvements
Signature Improvements
Parameter and Returntype improvements help PHPStan to understand your code. The better the inference the less additional manual code is required by you to make PHPStan understand whats going on.
- implement str-case functions return type extension
- infer non-empty-string on substr() comparison with constant string
- infer non-empty-string on str-casing functions comparison with constant string
-
infer non-empty-string on strstr() comparison with constant string
- improve is_subclass_of type checks
- use conditional parameter for is_a() via stub
- use conditional return type for is_a() via stub
kill instanceof StringType
In the PHPStan codebase we should refactor all uses of instanceof StringType
to $type->isXXX
checks, which paves the way for different String-Types like non-empty-string
, numeric-string
or non-falsey-string
(to be implemented).
💌 Support my open source activities
Honor the work I am doing in my freetime by sponsoring me.
Found a bug? Please help improve this article.