Skip to content

Excluded classes and empty namespaces are indexed #3779

@adriendupuis

Description

@adriendupuis

After #3740 empty namespaces aren't rendered. But they are still indexed by the search feature, leading to 404 errors.
Excluded @internal classes are also indexed.

Expected behavior

Internal classes and empty namespaces shouldn't appear in the search index.

Actual behavior

Empty namespaces or internal classes appear in the search index.

Steps to reproduce the problem

  1. In an empty temporary directory, create the two following files:
    Internal/MyInternalInterface.php
<?php
namespace App\Internal;
/** @internal */
interface MyInternalInterface {}

Public/MyPublicInterface.php

<?php
namespace App\Public;
interface MyPublicInterface {}
  1. Generate documentation from this folder using 3.5.3 (latest at the time of writing)
curl -LO "https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.5.3/phpDocumentor.phar";
php phpDocumentor.phar;
  1. Move to doc build and launch a local server, for example on port 8080:
cd .phpdoc/build;
php -S 127.0.0.1:8080;
  1. Open the doc index in a browser. For previous example, http://127.0.0.1:8080/.
  2. In the top right corner search input, search for "internal".
    Two entries are found: \App\Internal and \App\Public\MyPublicInterface.
  3. Click on the first search result, the \App\Internal namespace, the page isn't found.

Your environment

  • Version used: 3.5.3
  • phpDocumentor.phar downloaded and used as-is
  • PHP 8.3.6 (cli) (built: Apr 10 2024 14:21:20) (NTS)
  • macOS Sonoma 14.6.1 (23G93)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions