These templates were leading to false positives: assuming
an `object` is given as input, the inferred return
type would always have been `true`, which is obviously
not valid.
Removing them is the healthier alternative, for now.
Ref: https://github.com/vimeo/psalm/pull/8722#discussion_r1027102713
As per @weirdan's feedback, we can prevent
the usage of `object` instances that
implement `__invoke()`, as well as `array`
callables, by declaring the ctor argument of
`ReflectionFunction` to be either a real `Closure`,
or a `callable-string`.
While this may not be 100% of scenarios, it is a
healthy way to identify errors in userland.
Ref: https://github.com/vimeo/psalm/pull/8722#discussion_r1027151421
Also:
* added PHP 8.2 stubs
* refined types to make impossible scenarios more clear (like `ReflectionIntersectionType#allowsNull()`)
This is a first attempt at refining these types: the structure of these stubs is quite confusing to me,
so I don't know if this approach is correct, and if the stubs are merged together, or if entire symbols
need to be completely re-declared for each PHP version.