Skip to content
PHP Ecosystem
Explore

PhpInfoModuleGroup

API reference › Debug Core › PhpInfo › PhpInfoModuleGroup

final classPHPForge\Debug\PhpInfo\PhpInfoModuleGroup
Sourcesrc/PhpInfo/PhpInfoModuleGroup.php

Groups phpinfo() modules by the job they perform.

MethodDescriptionDefined by
bucket() staticBuckets items by the group owning their module title, keeping every label in TOC display order with OTHER last. Groups nothing lands in stay empty rather than disappearing, so callers decide whether to skip them.PhpInfoModuleGroup
isExtension() staticWhether the module describes a PHP extension rather than a reporting block.PhpInfoModuleGroup
resolve() staticReturns the group label owning the module, or OTHER when the module is unknown.PhpInfoModuleGroup
ConstantValueDescriptionDefined by
ENVIRONMENT'Environment'Reporting blocks that phpinfo() emits as modules but that describe the environment, not an extension.PhpInfoModuleGroup
OTHER'Other'Bucket for unknown and third-party modules.PhpInfoModuleGroup
public static function bucket(list<PHPForge\Debug\PhpInfo\T> $items, callable(PHPForge\Debug\PhpInfo\T): string $title): array<string, list<PHPForge\Debug\PhpInfo\T>>

Buckets items by the group owning their module title, keeping every label in TOC display order with OTHER last. Groups nothing lands in stay empty rather than disappearing, so callers decide whether to skip them.

Parameters

ParameterTypeDescription
$itemslist<PHPForge\Debug\PhpInfo\T>Items to bucket.
$titlecallable(PHPForge\Debug\PhpInfo\T): stringReads the module title from an item.

Returns

array<string, list<PHPForge\Debug\PhpInfo\T>>: Items per group label.

public static function isExtension(string $title): bool

Whether the module describes a PHP extension rather than a reporting block.

Parameters

ParameterTypeDescription
$titlestringModule title reported by phpinfo().

Returns

bool

public static function resolve(string $title): string

Returns the group label owning the module, or OTHER when the module is unknown.

Parameters

ParameterTypeDescription
$titlestringModule title reported by phpinfo().

Returns

string