66
66
require __DIR__ . DIRECTORY_SEPARATOR . '<?php echo PHPFHIR_TRAIT_XMLNS ; ?> .php';
67
67
}
68
68
69
- // common classes
69
+ // enums
70
+ if (!enum_exists('\<?php echo $ nsPrefix . PHPFHIR_ENUM_CONFIG_KEYS ; ?> ', false)) {
71
+ require __DIR__ . DIRECTORY_SEPARATOR . '<?php echo PHPFHIR_ENUM_CONFIG_KEYS ; ?> .php';
72
+ }
73
+
74
+ // classes
70
75
if (!class_exists('\<?php echo $ nsPrefix . PHPFHIR_CLASSNAME_CONSTANTS ; ?> ', false)) {
71
76
require __DIR__ . DIRECTORY_SEPARATOR . '<?php echo PHPFHIR_CLASSNAME_CONSTANTS ; ?> .php';
72
77
}
@@ -105,10 +110,10 @@ abstract class <?php echo PHPFHIR_CLASSNAME_AUTOLOADER; ?>
105
110
*/
106
111
public static function register(): bool
107
112
{
108
- if (self::$_registered) {
109
- return self::$_registered;
113
+ if (! self::$_registered) {
114
+ self::$_registered = spl_autoload_register(__CLASS__ . '::loadClass', true) ;
110
115
}
111
- return self::$_registered = spl_autoload_register([__CLASS__, 'loadClass'], true) ;
116
+ return self::$_registered;
112
117
}
113
118
114
119
/**
@@ -117,7 +122,7 @@ public static function register(): bool
117
122
public static function unregister(): bool
118
123
{
119
124
if (self::$_registered) {
120
- if (spl_autoload_unregister([ __CLASS__, ' loadClass'] )) {
125
+ if (spl_autoload_unregister(__CLASS__ . ':: loadClass')) {
121
126
self::$_registered = false;
122
127
return true;
123
128
}
@@ -131,7 +136,7 @@ public static function unregister(): bool
131
136
* @param string $class
132
137
* @return bool|null
133
138
*/
134
- public static function loadClass(string $class): ? bool
139
+ public static function loadClass(string $class): null| bool
135
140
{
136
141
if (isset(self::_CLASS_MAP[$class])) {
137
142
return (bool)require __DIR__ . DIRECTORY_SEPARATOR . self::_CLASS_MAP[$class];
0 commit comments