spaze / phpstan-disallowed-calls

PHPStan rules to detect disallowed method & function calls, constant, namespace, attribute & superglobal usages
MIT License
255 stars 17 forks source link

Add flag support for params #142

Closed spaze closed 1 year ago

spaze commented 1 year ago

I'd like to allow params when a flag is present ia param value like JSON_HEX_TAG | JSON_HEX_APOS. Currently that's not possible and a param value is treated as scalar value.

This will need a new param format, one idea is mentioned in https://github.com/spaze/phpstan-disallowed-calls/pull/141#issuecomment-1327289245

After adding the support, json_decode() with JSON_THROW_ON_ERROR could be added to the "loose" config as originally proposed by @ilazaridis in #141.

Also this should be updated too then https://github.com/spaze/phpstan-disallowed-calls/blob/332969d0aa67ddb8597c2f1248268d69ebf5f9c7/disallowed-loose-calls.neon#L9-L12