[DOC-CVS] [phd] master: Revert "Add explicit type declarations to class constants (PHP 8.3+) (#215)"

[email protected] (Máté Kocsis) Wed, 4 Mar 2026 07:43:54 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Máté Kocsis (kocsismate)
Date: 2026-03-04T08:43:09+01:00

Commit: https://github.com/php/phd/commit/0e43594305922e4a556f8f714d9a49aaf56d588c
Raw diff: https://github.com/php/phd/commit/0e43594305922e4a556f8f714d9a49aaf56d588c.diff

Revert "Add explicit type declarations to class constants (PHP 8.3+) (#215)"

This reverts commit c65199393a58de34ea583d1ead6623d844839902.

Changed paths:
  M  .github/workflows/ci.yml
  M  .github/workflows/test.yml
  M  composer.json
  M  composer.lock
  M  phpdotnet/phd/Config.php
  M  phpdotnet/phd/ErrorHandler.php
  M  phpdotnet/phd/Format.php
  M  phpdotnet/phd/OutputHandler.php
  M  phpdotnet/phd/Package/Generic/Manpage.php
  M  phpdotnet/phd/Package/IDE/API.php
  M  phpdotnet/phd/Package/PEAR/CHM.php
  M  phpdotnet/phd/Package/PHP/CHM.php
  M  phpdotnet/phd/Package/PHP/KDevelop.php
  M  phpdotnet/phd/Reader.php
  M  phpdotnet/phd/Render.php


Diff:

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d4e90132..4025f1cc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,7 +4,7 @@ jobs:
   ubuntu:
     strategy:
       matrix:
-          version: ['8.3', '8.4', '8.5']
+          version: ['8.1', '8.2', '8.3', '8.4', '8.5']
     runs-on: ubuntu-latest
     steps:
       - name: Checkout PhD
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3ea10364..c964cbb5 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -5,7 +5,7 @@ jobs:
     name: test
     strategy:
       matrix:
-        version: ['8.3', '8.4', '8.5']
+        version: ['8.1', '8.2', '8.3', '8.4', '8.5']
     continue-on-error: ${{ matrix.version == '8.5' }}
     runs-on: ubuntu-latest
     steps:
diff --git a/composer.json b/composer.json
index 56806f44..0ba62118 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,7 @@
         }
     ],
     "require": {
-        "php": ">=8.3",
+        "php": ">=8.1.0",
         "ext-dom": "*",
         "ext-sqlite3": "*",
         "ext-xmlreader": "*"
diff --git a/composer.lock b/composer.lock
index 41e6a930..e36a46f7 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "c0b6f4691ba3726550edf399f9af8ee6",
+    "content-hash": "7a1172b1a17b8a58fd3f50557a48316e",
     "packages": [],
     "packages-dev": [],
     "aliases": [],
@@ -13,11 +13,11 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=8.3",
+        "php": ">=8.1.0",
         "ext-dom": "*",
         "ext-sqlite3": "*",
         "ext-xmlreader": "*"
     },
     "platform-dev": {},
-    "plugin-api-version": "2.9.0"
+    "plugin-api-version": "2.6.0"
 }
diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php
index 642c8aef..defc50c6 100644
--- a/phpdotnet/phd/Config.php
+++ b/phpdotnet/phd/Config.php
@@ -3,7 +3,7 @@
 
 class Config
 {
-    public const string VERSION = '@phd_version@';
+    public const VERSION = '@phd_version@';
     public readonly string $copyright;
 
     /** @var array<string, string> */
diff --git a/phpdotnet/phd/ErrorHandler.php b/phpdotnet/phd/ErrorHandler.php
index 766eda6a..202f4cf4 100644
--- a/phpdotnet/phd/ErrorHandler.php
+++ b/phpdotnet/phd/ErrorHandler.php
@@ -3,7 +3,7 @@
 
 class ErrorHandler
 {
-    private const array ERROR_MAP = [
+    private const ERROR_MAP = [
         // PHP Triggered Errors
         E_DEPRECATED                  => 'E_DEPRECATED          ',
         E_RECOVERABLE_ERROR           => 'E_RECOVERABLE_ERROR   ',
diff --git a/phpdotnet/phd/Format.php b/phpdotnet/phd/Format.php
index 53e5f211..2ac1d99d 100644
--- a/phpdotnet/phd/Format.php
+++ b/phpdotnet/phd/Format.php
@@ -10,7 +10,7 @@ abstract class Format extends ObjectStorage
      * @var    integer
      * @usedby createLink()
      */
-    const int SDESC = 1;
+    const SDESC = 1;
 
     /**
      * Represents a long description.
@@ -19,7 +19,7 @@ abstract class Format extends ObjectStorage
      * @var    integer
      * @usedby createLink()
      */
-    const int LDESC = 2;
+    const LDESC = 2;
 
     protected Config $config;
     protected OutputHandler $outputHandler;
diff --git a/phpdotnet/phd/OutputHandler.php b/phpdotnet/phd/OutputHandler.php
index 0a878dfc..96da4c3e 100644
--- a/phpdotnet/phd/OutputHandler.php
+++ b/phpdotnet/phd/OutputHandler.php
@@ -4,7 +4,7 @@
 class OutputHandler
 {
     /** @var array */
-    private const array CONSTANT_TO_MESSAGE_CATEGORY_MAP = [
+    private const CONSTANT_TO_MESSAGE_CATEGORY_MAP = [
         // PhD informationals
         VERBOSE_INDEXING              => 'Indexing              ',
         VERBOSE_FORMAT_RENDERING      => 'Rendering Format      ',
diff --git a/phpdotnet/phd/Package/Generic/Manpage.php b/phpdotnet/phd/Package/Generic/Manpage.php
index 201578cc..d4b86364 100644
--- a/phpdotnet/phd/Package/Generic/Manpage.php
+++ b/phpdotnet/phd/Package/Generic/Manpage.php
@@ -2,8 +2,8 @@
 namespace phpdotnet\phd;
 
 class Package_Generic_Manpage extends Format_Abstract_Manpage {
-    const int OPEN_CHUNK    = 0x01;
-    const int CLOSE_CHUNK   = 0x02;
+    const OPEN_CHUNK    = 0x01;
+    const CLOSE_CHUNK   = 0x02;
 
      private $elementmap = array( /* {{{ */
         'acronym'               => 'format_suppressed_tags',
diff --git a/phpdotnet/phd/Package/IDE/API.php b/phpdotnet/phd/Package/IDE/API.php
index f4ba6955..73bc7302 100644
--- a/phpdotnet/phd/Package/IDE/API.php
+++ b/phpdotnet/phd/Package/IDE/API.php
@@ -35,14 +35,14 @@ class Package_IDE_API
      *
      * @var string
      */
-    const string FUNCTIONS_DIR = 'ide-xml';
+    const FUNCTIONS_DIR = 'ide-xml';
 
     /**
      * Output file of the funclist format in the IDE Package.
      *
      * @var string
      */
-    const string FUNCLIST_FILE = 'ide-funclist.txt';
+    const FUNCLIST_FILE = 'ide-funclist.txt';
 
     /**
      * PhD output directory.
diff --git a/phpdotnet/phd/Package/PEAR/CHM.php b/phpdotnet/phd/Package/PEAR/CHM.php
index c116264b..d016be5b 100755
--- a/phpdotnet/phd/Package/PEAR/CHM.php
+++ b/phpdotnet/phd/Package/PEAR/CHM.php
@@ -2,8 +2,8 @@
 namespace phpdotnet\phd;
 
 class Package_PEAR_CHM extends Package_PEAR_ChunkedXHTML {
-    const string DEFAULT_FONT = "Arial,10,0";
-    const string DEFAULT_TITLE = "PEAR Manual";
+    const DEFAULT_FONT = "Arial,10,0";
+    const DEFAULT_TITLE = "PEAR Manual";
 
     // Array to manual code -> HTML Help Code conversion
 	// Code list: http://www.helpware.net/htmlhelp/hh_info.htm
diff --git a/phpdotnet/phd/Package/PHP/CHM.php b/phpdotnet/phd/Package/PHP/CHM.php
index 7da2be4a..86d9c445 100644
--- a/phpdotnet/phd/Package/PHP/CHM.php
+++ b/phpdotnet/phd/Package/PHP/CHM.php
@@ -3,8 +3,8 @@
 
 class Package_PHP_CHM extends Package_PHP_ChunkedXHTML
 {
-    const string DEFAULT_FONT = "Arial,10,0";
-    const string DEFAULT_TITLE = "PHP Manual";
+    const DEFAULT_FONT = "Arial,10,0";
+    const DEFAULT_TITLE = "PHP Manual";
 
     // Array to manual code -> HTML Help Code conversion
     // Code list: http://www.helpware.net/htmlhelp/hh_info.htm
diff --git a/phpdotnet/phd/Package/PHP/KDevelop.php b/phpdotnet/phd/Package/PHP/KDevelop.php
index 168658d1..5783e898 100644
--- a/phpdotnet/phd/Package/PHP/KDevelop.php
+++ b/phpdotnet/phd/Package/PHP/KDevelop.php
@@ -2,7 +2,7 @@
 namespace phpdotnet\phd;
 
 class Package_PHP_KDevelop extends Format {
-    const string DEFAULT_HREF = "http://www.php.net/manual/en/";
+    const DEFAULT_HREF = "http://www.php.net/manual/en/";
 
     protected $elementmap = array(
         'book'                  => 'format_tocsect1',
diff --git a/phpdotnet/phd/Reader.php b/phpdotnet/phd/Reader.php
index dbce53a1..47240f14 100644
--- a/phpdotnet/phd/Reader.php
+++ b/phpdotnet/phd/Reader.php
@@ -3,11 +3,11 @@
 
 class Reader extends \XMLReader
 {
-    const string XMLNS_XML     = "http://www.w3.org/XML/1998/namespace";
-    const string XMLNS_XLINK   = "http://www.w3.org/1999/xlink";
-    const string XMLNS_PHD     = "http://www.php.net/ns/phd";
-    const string XMLNS_DOCBOOK = "http://docbook.org/ns/docbook";
-    const string XMLNS_MATHML  = "http://www.w3.org/1998/Math/MathML";
+    const XMLNS_XML     = "http://www.w3.org/XML/1998/namespace";
+    const XMLNS_XLINK   = "http://www.w3.org/1999/xlink";
+    const XMLNS_PHD     = "http://www.php.net/ns/phd";
+    const XMLNS_DOCBOOK = "http://docbook.org/ns/docbook";
+    const XMLNS_MATHML  = "http://www.w3.org/1998/Math/MathML";
     
     protected OutputHandler $outputHandler;
 
diff --git a/phpdotnet/phd/Render.php b/phpdotnet/phd/Render.php
index dc7c7550..eeacc68e 100644
--- a/phpdotnet/phd/Render.php
+++ b/phpdotnet/phd/Render.php
@@ -3,13 +3,13 @@
 
 class Render extends ObjectStorage
 {
-    const int CHUNK        = 0x001;
-    const int OPEN         = 0x002;
-    const int CLOSE        = 0x004;
-    const int STANDALONE   = 0x008;
-    const int INIT         = 0x010;
-    const int FINALIZE     = 0x020;
-    const int VERBOSE      = 0x040;
+    const CHUNK        = 0x001;
+    const OPEN         = 0x002;
+    const CLOSE        = 0x004;
+    const STANDALONE   = 0x008;
+    const INIT         = 0x010;
+    const FINALIZE     = 0x020;
+    const VERBOSE      = 0x040;
 
     private   $STACK      = array();