Skip to content

Child classes shown as inheriting private constants, properties and methods of parent class. #3800

@WebSmithery

Description

@WebSmithery

In PHP, private constants, properties and methods are not inherited by child classes, yet in phpDocumentor, when a class extends another class, the child-class documentation lists private constants, properties and methods of the parent as also being private constants, properties and methods of the child.

Expected behavior

Public and protected constants, properties and methods of the parent class should also be listed in the documentation of the child class, but not those which are private in the parent class.

Actual behavior

The documentation of the child class shows all constants, properties and methods of the parent class, regardless of their visibility.

Steps to reproduce the problem

  1. Create a class with a private constant, a private property and a private method.
  2. Create a second, empty class, extending the first.
  3. Generate the documentation.

The documentation of the child class should have nothing—no constants, properties or methods—yet it shows the private constant, property and method of the parent.

Code with which his can be tested: index.txt

Your environment

  • Version used: 3.5.3
  • Ran PHAR directly from command line with default settings and template.
  • PHP version: PHP 8.3.12 (cli). (Also tested with PHP 8.1 and same issue occurs.)
  • Operating system: Windows 10 Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions