php / php/php-src

Stubs: internally modifyable properties are not @readonly

Open
#15,553 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Status: Needs Triage Stubs
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

We have a couple of internal classes (e.g. mysqli) which implement properties basically as hooks (i.e. internally calling a function). Such properties should not be tagged as @readonly in the stubs, because their behavior is not what users expect (their value is not fixed), and it also can be very confusing regarding the behavior of ReflectionProperty::isReadOnly() et. al, see #15309.

While at least for me this is more of a documentation issue, since the classsynopses are generated from the stub files, some improvements would need to be done there at first.

PHP Version

PHP 8

Operating System

any

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the PHP stub files for internal classes such as mysqli, then check the generated classsynopses that derive from them. Identify properties whose values are internally modified through hooks and remove inappropriate @readonly annotations; done means the generated documentation and ReflectionProperty::isReadOnly() behavior no longer describe them as fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.