Hey Larry,
On 6.11.2025 00:24:52, Larry Garfield wrote:
In other news, Ilija and I said a year ago that we'd take a swing at adding
isReadable/isWriteable methods to ReflectionProperty. Took a while, but here
we are. A strangely small RFC from us:
https://wiki.php.net/rfc/isreadable-iswriteable
Have you considered returning false on isReadable() and isWritable() for
methods, whose only statement is throwing? I.e. when a getter or setter
unconditionally throws without any other statements present, they are
not marked as readable or writable.
Otherwise this essentially "punishes" providing better exceptions in a
getter or setter, and serves also cases where the LSP inheritance forces
presence of a getter/setter, but still shall not be allowed on the
specific instance.
Thanks,
Bob