{% if argument.default is not empty %}
- {% if 'self::' in argument.default %}
- {{ argument.default|replace({'self':argument.method|split('::')[0]})|route('class:short')|raw }}
+ {% if 'self::' in argument.default.render %}
+ {{ argument.default.render|replace({'\\self':argument.method|split('::')[0]})|route('class:short')|raw }}
+ {% elseif argument.default.render starts with '\\Ibexa\\Contracts\\' %}
+ {{ argument.default.render|route('class:short') }}
{% else %}
{{ argument.default }}
{% endif %}
diff --git a/tools/php_api_ref/.phpdoc/template/components/method-signature.html.twig b/tools/php_api_ref/.phpdoc/template/components/method-signature.html.twig
index aa1881f12f..5ccf519db7 100644
--- a/tools/php_api_ref/.phpdoc/template/components/method-signature.html.twig
+++ b/tools/php_api_ref/.phpdoc/template/components/method-signature.html.twig
@@ -16,7 +16,13 @@
${{ argument.name }}
{% if argument.default is not null %}
=
- {{ argument.default }}
+
+ {%- if argument.default.render starts with '\\Ibexa\\Contracts\\' -%}
+ {{ argument.default.render|route('class:short') }}
+ {%- else -%}
+ {{ argument.default }}
+ {%- endif -%}
+ ]
{% endif %}
diff --git a/tools/php_api_ref/.phpdoc/template/menu-entry.html.twig b/tools/php_api_ref/.phpdoc/template/menu-entry.html.twig
new file mode 100644
index 0000000000..bedd3e8bfe
--- /dev/null
+++ b/tools/php_api_ref/.phpdoc/template/menu-entry.html.twig
@@ -0,0 +1,29 @@
+{% set is_nested = entry.children.count or entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
+{% set url = entry|route("url")|raw %}
+{% set type = type|default('') %}
+
+{% if type != 'namespace' or is_nested %}
+
+
+
+ {% if is_nested %}
+
+ {% endif %}
+
+{% endif %}
diff --git a/tools/php_api_ref/.phpdoc/template/menu.html.twig b/tools/php_api_ref/.phpdoc/template/menu.html.twig
new file mode 100644
index 0000000000..4c86bee8a1
--- /dev/null
+++ b/tools/php_api_ref/.phpdoc/template/menu.html.twig
@@ -0,0 +1,99 @@
+{% if depth == 0 %}
+ {% if entry.children.count > 0 %}
+ {% for child in entry.children %}
+ {% include 'components/menu-entry.html.twig' with {
+ title: entry.name|shortFQSEN ~ ' ' ~ child.name|shortFQSEN,
+ nav_id: nav_id ~ '-' ~ loop.index,
+ expanded: true,
+ entry: child,
+ } %}
+ {% endfor %}
+ {% endif %}
+{% else %}
+
+ {% set index = 0 %}
+
+ {% if entry.children.count > 0 %}
+ {% if depth > 1 %}
+
+ {% endif %}
+
+ {% for child in entry.children %}
+ {% include 'components/menu-entry.html.twig' with {
+ title: child.name|shortFQSEN,
+ nav_id: nav_id ~ '-' ~ index,
+ entry: child,
+ expanded: false,
+ icon: 'folder.svg',
+ type: 'namespace',
+ } %}
+
+ {% set index = index + 1 %}
+ {% endfor %}
+
+ {% endif %}
+
+ {% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
+ {% if depth > 1 %}
+
+ {% endif %}
+
+ {% if entry.interfaces[0] is defined %}
+ {% for element in entry.interfaces|sort_asc %}
+ {% include 'components/menu-entry.html.twig' with {
+ title: element.name|shortFQSEN,
+ nav_id: nav_id ~ '-' ~ index,
+ entry: element,
+ expanded: false,
+ icon: 'file.svg',
+ } %}
+
+ {% set index = index + 1 %}
+ {% endfor %}
+ {% endif %}
+ {% if entry.classes[0] is defined %}
+ {% for element in entry.classes|sort_asc %}
+ {% include 'components/menu-entry.html.twig' with {
+ title: element.name|shortFQSEN,
+ nav_id: nav_id ~ '-' ~ index,
+ entry: element,
+ expanded: false,
+ icon: 'file.svg',
+ } %}
+
+ {% set index = index + 1 %}
+ {% endfor %}
+ {% endif %}
+ {% if entry.traits[0] is defined %}
+ {% for element in entry.traits|sort_asc %}
+ {% include 'components/menu-entry.html.twig' with {
+ title: element.name|shortFQSEN,
+ nav_id: nav_id ~ '-' ~ index,
+ entry: element,
+ expanded: false,
+ icon: 'file.svg',
+ } %}
+
+ {% set index = index + 1 %}
+ {% endfor %}
+ {% endif %}
+ {% if entry.enums[0] is defined %}
+ {% for element in entry.enums|sort_asc %}
+ {% include 'components/menu-entry.html.twig' with {
+ title: element.name|shortFQSEN,
+ nav_id: nav_id ~ '-' ~ index,
+ entry: element,
+ expanded: false,
+ icon: 'file.svg',
+ } %}
+
+ {% set index = index + 1 %}
+ {% endfor %}
+ {% endif %}
+
+ {% endif %}
+{% endif %}
diff --git a/tools/php_api_ref/phpdoc.sh b/tools/php_api_ref/phpdoc.sh
index a85b14bae0..d56712815d 100755
--- a/tools/php_api_ref/phpdoc.sh
+++ b/tools/php_api_ref/phpdoc.sh
@@ -3,17 +3,17 @@
set +x;
AUTH_JSON=${1:-~/.composer/auth.json}; # Path to an auth.json file allowing to install the targeted edition and version
-OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference}; # Path to the directory where the built PHP API Reference is hosted
+PHP_API_OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference}; # Path to the directory where the built PHP API Reference is hosted
DXP_EDITION='commerce'; # Edition from and for which the Reference is built
DXP_VERSION='4.6.*'; # Version from and for which the Reference is built
DXP_ADD_ONS=(connector-ai connector-openai automated-translation product-catalog-date-time-attribute rector discounts discounts-codes product-catalog-symbol-attribute collaboration share fieldtype-richtext-rte integrated-help cdp); # Packages not included in $DXP_EDITION but added to the Reference, listed without their vendor "ibexa"
DXP_EDITIONS=(oss headless experience commerce); # Available editions ordered by ascending capabilities
SF_VERSION='5.4'; # Symfony version used by Ibexa DXP
-PHPDOC_VERSION='3.8.0'; # Version of phpDocumentor used to build the Reference
+PHPDOC_VERSION='3.9.1'; # Version of phpDocumentor used to build the Reference
PHPDOC_CONF="$(pwd)/tools/php_api_ref/phpdoc.dist.xml"; # Absolute path to phpDocumentor configuration file
#PHPDOC_CONF="$(pwd)/tools/php_api_ref/phpdoc.dev.xml"; # Absolute path to phpDocumentor configuration file
-PHPDOC_TEMPLATE_VERSION='3.8.0'; # Version of the phpDocumentor base template set
+PHPDOC_TEMPLATE_VERSION='3.9.1'; # Version of the phpDocumentor base template set
PHPDOC_DIR="$(pwd)/tools/php_api_ref/.phpdoc"; # Absolute path to phpDocumentor resource directory (containing the override template set)
PHP_BINARY="php -d error_reporting=`php -r 'echo E_ALL & ~E_DEPRECATED;'`"; # Avoid depreciation messages from phpDocumentor/Reflection/issues/529 when using PHP 8.2 or higher
@@ -22,16 +22,16 @@ FORCE_DXP_INSTALL=1; # If 1, empty the temporary directory, install DXP from scr
BASE_DXP_BRANCH=''; # Branch from and for which the Reference is built when using a dev branch as version
VIRTUAL_DXP_VERSION=''; # Version for which the reference is supposedly built when using dev branch as version
-if [ ! -d $OUTPUT_DIR ]; then
- echo -n "Creating ${OUTPUT_DIR}… ";
- mkdir -p $OUTPUT_DIR;
+if [ ! -d $PHP_API_OUTPUT_DIR ]; then
+ echo -n "Creating ${PHP_API_OUTPUT_DIR}… ";
+ mkdir -p $PHP_API_OUTPUT_DIR;
if [ $? -eq 0 ]; then
echo 'OK';
else
exit 1;
fi;
fi;
-OUTPUT_DIR=$(realpath $OUTPUT_DIR); # Transform to absolute path before changing the working directory
+PHP_API_OUTPUT_DIR=$(realpath $PHP_API_OUTPUT_DIR); # Transform into absolute path before changing the working directory
if [ 1 -eq $FORCE_DXP_INSTALL ]; then
echo 'Remove temporary directory…';
@@ -78,7 +78,7 @@ export COMPOSER_ROOT_VERSION=$DXP_VERSION;
if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
for additional_package in "${DXP_ADD_ONS[@]}"; do
- composer require --no-interaction --ignore-platform-reqs --no-scripts --with-all-dependencies ibexa/$additional_package:$DXP_VERSION
+ composer require --no-interaction --ignore-platform-reqs --no-scripts --with-all-dependencies ibexa/$additional_package:$DXP_VERSION;
done;
fi;
@@ -179,18 +179,18 @@ if [ $? -eq 0 ]; then
./php_api_reference/js/searchIndex.js \
> ./php_api_reference/js/searchIndex.new.js;
mv -f ./php_api_reference/js/searchIndex.new.js ./php_api_reference/js/searchIndex.js;
- echo -n "Copy phpDocumentor output to ${OUTPUT_DIR}… ";
- cp -rf ./php_api_reference/* $OUTPUT_DIR;
+ echo -n "Copy phpDocumentor output to ${PHP_API_OUTPUT_DIR}… ";
+ cp -rf ./php_api_reference/* $PHP_API_OUTPUT_DIR;
echo -n 'Remove surplus… ';
while IFS= read -r line; do
file="$(echo $line | sed -r 's/Only in (.*): (.*)/\1\/\2/')";
- if [[ $file = $OUTPUT_DIR/* ]]; then
+ if [[ $file = $PHP_API_OUTPUT_DIR/* ]]; then
rm -rf $file;
fi;
- done <<< "$(diff -qr ./php_api_reference $OUTPUT_DIR | grep 'Only in ')";
+ done <<< "$(diff -qr ./php_api_reference $PHP_API_OUTPUT_DIR | grep 'Only in ')";
echo 'OK.';
else
- echo 'A phpDocumentor error prevents reference update.';
+ echo 'A phpDocumentor error prevents PHP Reference update.';
exit 3;
fi;
From 5fbec2ca8b9f597ed0d81d41b2632a20ace5624a Mon Sep 17 00:00:00 2001
From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Date: Wed, 8 Apr 2026 14:52:37 +0200
Subject: [PATCH 2/2] .phpdoc/template: Rm badly placed templates
---
.../.phpdoc/template/menu-entry.html.twig | 29 ------
.../.phpdoc/template/menu.html.twig | 99 -------------------
2 files changed, 128 deletions(-)
delete mode 100644 tools/php_api_ref/.phpdoc/template/menu-entry.html.twig
delete mode 100644 tools/php_api_ref/.phpdoc/template/menu.html.twig
diff --git a/tools/php_api_ref/.phpdoc/template/menu-entry.html.twig b/tools/php_api_ref/.phpdoc/template/menu-entry.html.twig
deleted file mode 100644
index bedd3e8bfe..0000000000
--- a/tools/php_api_ref/.phpdoc/template/menu-entry.html.twig
+++ /dev/null
@@ -1,29 +0,0 @@
-{% set is_nested = entry.children.count or entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
-{% set url = entry|route("url")|raw %}
-{% set type = type|default('') %}
-
-{% if type != 'namespace' or is_nested %}
-
- {% for child in entry.children %}
- {% include 'components/menu-entry.html.twig' with {
- title: child.name|shortFQSEN,
- nav_id: nav_id ~ '-' ~ index,
- entry: child,
- expanded: false,
- icon: 'folder.svg',
- type: 'namespace',
- } %}
-
- {% set index = index + 1 %}
- {% endfor %}
-
- {% endif %}
-
- {% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
- {% if depth > 1 %}
-
- {% endif %}
-
- {% if entry.interfaces[0] is defined %}
- {% for element in entry.interfaces|sort_asc %}
- {% include 'components/menu-entry.html.twig' with {
- title: element.name|shortFQSEN,
- nav_id: nav_id ~ '-' ~ index,
- entry: element,
- expanded: false,
- icon: 'file.svg',
- } %}
-
- {% set index = index + 1 %}
- {% endfor %}
- {% endif %}
- {% if entry.classes[0] is defined %}
- {% for element in entry.classes|sort_asc %}
- {% include 'components/menu-entry.html.twig' with {
- title: element.name|shortFQSEN,
- nav_id: nav_id ~ '-' ~ index,
- entry: element,
- expanded: false,
- icon: 'file.svg',
- } %}
-
- {% set index = index + 1 %}
- {% endfor %}
- {% endif %}
- {% if entry.traits[0] is defined %}
- {% for element in entry.traits|sort_asc %}
- {% include 'components/menu-entry.html.twig' with {
- title: element.name|shortFQSEN,
- nav_id: nav_id ~ '-' ~ index,
- entry: element,
- expanded: false,
- icon: 'file.svg',
- } %}
-
- {% set index = index + 1 %}
- {% endfor %}
- {% endif %}
- {% if entry.enums[0] is defined %}
- {% for element in entry.enums|sort_asc %}
- {% include 'components/menu-entry.html.twig' with {
- title: element.name|shortFQSEN,
- nav_id: nav_id ~ '-' ~ index,
- entry: element,
- expanded: false,
- icon: 'file.svg',
- } %}
-
- {% set index = index + 1 %}
- {% endfor %}
- {% endif %}
-