PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | vendor/composer/autoload_aliases.php +14 -1 2.3.0 → trunk View file →
@@ -16,9 +16,10 @@
16 16 *
17 17 * @phpstan-type ClassAliasArray array{'type':'class',isabstract:bool,classname:string,namespace?:string,extends:string,implements:array<string>}
18 18 * @phpstan-type InterfaceAliasArray array{'type':'interface',interfacename:string,namespace?:string,extends:array<string>}
19 19 * @phpstan-type TraitAliasArray array{'type':'trait',traitname:string,namespace?:string,use:array<string>}
20 - * @phpstan-type AutoloadAliasArray array<string,ClassAliasArray|InterfaceAliasArray|TraitAliasArray>
20 + * @phpstan-type EnumAliasArray array{'type':'enum',enumname:string,namespace?:string,concrete:string}
21 + * @phpstan-type AutoloadAliasArray array<string,ClassAliasArray|InterfaceAliasArray|TraitAliasArray|EnumAliasArray>
21 22 */
22 23 class AliasAutoloader
23 24 {
24 25 private string $includeFilePath;
@@ -707,8 +708,20 @@
707 708 $this->load(
708 709 $this->traitTemplate(
709 710 $this->autoloadAliases[$class]
710 711 )
712 + );
713 + break;
714 + case 'enum':
715 + // Enums are final so cannot be aliased with an `extends` shim like classes are; `class_alias()`
716 + // makes the original name a true alias of the renamed enum, preserving case identity (`===`),
717 + // `match` arms, `::cases()`, `::from()` and `instanceof` the enum itself. Unlike the class shim,
718 + // the alias does not implement the enum's original interface names, so `instanceof` against an
719 + // original interface name is false. Enums require PHP 8.1, but this only executes when an enum
720 + // is autoloaded by its original name, i.e. on a runtime already using enums.
721 + \class_alias(
722 + $this->autoloadAliases[$class]['concrete'],
723 + $class
711 724 );
712 725 break;
713 726 default:
714 727 // Never.