ondrejmirtes
Repos
158
Followers
557
Following
27

PHP Static Analysis Tool - discover bugs in your code without running it!

11330
782

Doctrine extensions for PHPStan

449
75

Extra strict and opinionated rules for PHPStan

412
38

PHPUnit extensions and rules for PHPStan

347
39

Events

Fix for PHPStan anonymous classes which have name but not namespacedName

[GENERATED] Downgraded

[GENERATED] Renamed

Created at 32 minutes ago
issue comment
Null coalesce operator on nested array returns unexpected error

Thanks :) BTW Has Sulu considered PHPStan open-source sponsorship (https://github.com/sponsors/ondrejmirtes/), or PHPStan Pro team subscription (https://phpstan.org/blog/introducing-phpstan-pro)? If you're getting value out of PHPStan, I'd really appreciate the support :)

Created at 34 minutes ago
issue comment
Isset on parse_url returned type not working

Yeah, I guess it could be improved :)

Created at 58 minutes ago
reopened issue
Isset on parse_url returned type not working

Bug report

The isset returns an error in phpstan on parse_url:

$urlParsed = parse_url($url);

return isset($urlParsed['path']);

I'm not understanding. Found similar issue here from @darkspock maybe he can also tell why he thought it is not an error on phpstan side.

Code snippet that reproduces the problem

https://phpstan.org/r/e895b82e-932d-43a6-b184-c6e1a20ecc4b

Expected output

No error should be returned.

Did PHPStan help you today? Did it make you happy in any way?

Adding phpstan to a external project not using static code analyse yet and see lot of things which can improve also from architecture point of view avoiding inheritance and use strict type classes.

Created at 58 minutes ago
closed issue
Isset on parse_url returned type not working

Bug report

The isset returns an error in phpstan on parse_url:

$urlParsed = parse_url($url);

return isset($urlParsed['path']);

I'm not understanding. Found similar issue here from @darkspock maybe he can also tell why he thought it is not an error on phpstan side.

Code snippet that reproduces the problem

https://phpstan.org/r/e895b82e-932d-43a6-b184-c6e1a20ecc4b

Expected output

No error should be returned.

Did PHPStan help you today? Did it make you happy in any way?

Adding phpstan to a external project not using static code analyse yet and see lot of things which can improve also from architecture point of view avoiding inheritance and use strict type classes.

Created at 1 hour ago
issue comment
Isset on parse_url returned type not working

Eliminate false first: https://phpstan.org/r/1e3ea302-4618-4c24-9afe-08f4ab683efb

Created at 1 hour ago
issue comment
Backed enums and json_encode

Great 😊

Created at 1 hour ago
issue comment
Backed enums and json_encode

StringBackedEnum and IntBackedEnum do not exist, they're just internal to PhpStorm for its IDE purposes. They're not in PHP.

Created at 2 hours ago
ondrejmirtes delete tag 5.9.0
Created at 3 hours ago
ondrejmirtes delete tag 5.7.0
Created at 3 hours ago
ondrejmirtes delete tag 5.5.0
Created at 3 hours ago
ondrejmirtes delete tag 5.11.0
Created at 3 hours ago
ondrejmirtes delete tag 5.10.0
Created at 3 hours ago
ondrejmirtes create branch test-6
Created at 3 hours ago
issue comment
str_contains should imply that the value of strpos is not false.

It's not worth the complexity IMHO

Created at 7 hours ago
issue comment
curl_setopt with CURLOPT_POSTFIELDS → Parameter #3 $value of function curl_setopt expects non-empty-string, string given.

http_build_query should be modified to return non-empty-string.

Created at 7 hours ago
closed issue
str_contains should imply that the value of strpos is not false.

Feature request

I didn't find any similar issues.

In the following example https://phpstan.org/r/42ef2c3c-5699-4e32-9c1e-52d69251f706 it could be useful having phpstan to remove false from the return type of strpos.

I surely can write https://phpstan.org/r/3506b4da-d07c-4141-aabc-b45289df6fd0 but it's might be considered as less readable by some people, and some tools like rector are promoting using str_contains: https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#strcontainsrector

We could imagine some similar features

  • str_starts_with imply str_contains
  • str_ends_with imply str_contains
Created at 7 hours ago
issue comment
str_contains should imply that the value of strpos is not false.

It's not feasible to carry that information in the typesystem. Just do this instead: https://phpstan.org/r/40ad51ac-7bbc-4b8d-8998-51ce0202e41e (it's gonna be faster too)

Created at 7 hours ago
issue comment
Shopware Update from 5.7.7 to 5.7.15

Ask in https://github.com/staabm/phpstan-dba, I have no experience with the extension.

Created at 7 hours ago

Updated PHPStan to commit b7973e47ccb929f3d6ddeac53973b07ea1653d62

https://github.com/phpstan/phpstan-src/commit/b7973e47ccb929f3d6ddeac53973b07ea1653d62 Improve unsetting constant offsets on array

Created at 7 hours ago

Improve unsetting constant offsets on array

Created at 7 hours ago
pull request closed
Improve unsetting constant offsets on array
Created at 7 hours ago
issue comment
Improve unsetting constant offsets on array

Yes! I've had this in my todolist :) Thank you!

Created at 7 hours ago
issue comment
Shopware Update from 5.7.7 to 5.7.15

This exception is coming from staabm/phpstan-dba anyway.

Created at 7 hours ago

Updated PHPStan to commit 542e3f973cf4592d9f470c141a1a0cbeef4719df

https://github.com/phpstan/phpstan-src/commit/542e3f973cf4592d9f470c141a1a0cbeef4719df Update compiler

Created at 8 hours ago

Update dependency phpstan/phpstan to v1.8.6

Created at 8 hours ago
delete branch
ondrejmirtes delete branch renovate/extractor
Created at 8 hours ago
pull request closed
Update dependency phpstan/phpstan to v1.8.6

Mend Renovate

This PR contains the following updates:

| Package | Type | Update | Change | |---|---|---|---| | phpstan/phpstan | require | patch | 1.8.5 -> 1.8.6 |


Release Notes

v1.8.6

Compare Source

Improvements 🔧

Bleeding edge 🔪

If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon:

includes:
	- vendor/phpstan/phpstan/conf/bleedingEdge.neon

Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more

Bugfixes 🐛

Function signature fixes 🤖


Configuration

📅 Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Mend Renovate. View repository job log here.

Created at 8 hours ago
delete branch
ondrejmirtes delete branch renovate/playground-api
Created at 8 hours ago