| 1 |
<?php |
| 2 |
|
| 3 |
// Functions and constants |
| 4 |
|
| 5 |
namespace { |
| 6 |
|
| 7 |
} |
| 8 |
|
| 9 |
|
| 10 |
namespace Imagify\Dependencies { |
| 11 |
|
| 12 |
use BrianHenryIE\Strauss\Types\AutoloadAliasInterface; |
| 13 |
|
| 14 |
/** |
| 15 |
* @see AutoloadAliasInterface |
| 16 |
* |
| 17 |
* @phpstan-type ClassAliasArray array{'type':'class',isabstract:bool,classname:string,namespace?:string,extends:string,implements:array<string>} |
| 18 |
* @phpstan-type InterfaceAliasArray array{'type':'interface',interfacename:string,namespace?:string,extends:array<string>} |
| 19 |
* @phpstan-type TraitAliasArray array{'type':'trait',traitname:string,namespace?:string,use:array<string>} |
| 20 |
* @phpstan-type AutoloadAliasArray array<string,ClassAliasArray|InterfaceAliasArray|TraitAliasArray> |
| 21 |
*/ |
| 22 |
class AliasAutoloader |
| 23 |
{ |
| 24 |
private string $includeFilePath; |
| 25 |
|
| 26 |
/** |
| 27 |
* @var AutoloadAliasArray |
| 28 |
*/ |
| 29 |
private array $autoloadAliases = array ( |
| 30 |
'WP_Async_Request' => |
| 31 |
array ( |
| 32 |
'type' => 'class', |
| 33 |
'classname' => 'WP_Async_Request', |
| 34 |
'isabstract' => true, |
| 35 |
'namespace' => '\\', |
| 36 |
'extends' => 'Imagify_WP_Async_Request', |
| 37 |
'implements' => |
| 38 |
array ( |
| 39 |
), |
| 40 |
), |
| 41 |
'WP_Background_Process' => |
| 42 |
array ( |
| 43 |
'type' => 'class', |
| 44 |
'classname' => 'WP_Background_Process', |
| 45 |
'isabstract' => true, |
| 46 |
'namespace' => '\\', |
| 47 |
'extends' => 'Imagify_WP_Background_Process', |
| 48 |
'implements' => |
| 49 |
array ( |
| 50 |
), |
| 51 |
), |
| 52 |
'League\\Container\\Argument\\DefaultValueArgument' => |
| 53 |
array ( |
| 54 |
'type' => 'class', |
| 55 |
'classname' => 'DefaultValueArgument', |
| 56 |
'isabstract' => false, |
| 57 |
'namespace' => 'League\\Container\\Argument', |
| 58 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\DefaultValueArgument', |
| 59 |
'implements' => |
| 60 |
array ( |
| 61 |
0 => 'League\\Container\\Argument\\DefaultValueInterface', |
| 62 |
), |
| 63 |
), |
| 64 |
'League\\Container\\Argument\\Literal\\ArrayArgument' => |
| 65 |
array ( |
| 66 |
'type' => 'class', |
| 67 |
'classname' => 'ArrayArgument', |
| 68 |
'isabstract' => false, |
| 69 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 70 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\ArrayArgument', |
| 71 |
'implements' => |
| 72 |
array ( |
| 73 |
), |
| 74 |
), |
| 75 |
'League\\Container\\Argument\\Literal\\BooleanArgument' => |
| 76 |
array ( |
| 77 |
'type' => 'class', |
| 78 |
'classname' => 'BooleanArgument', |
| 79 |
'isabstract' => false, |
| 80 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 81 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\BooleanArgument', |
| 82 |
'implements' => |
| 83 |
array ( |
| 84 |
), |
| 85 |
), |
| 86 |
'League\\Container\\Argument\\Literal\\CallableArgument' => |
| 87 |
array ( |
| 88 |
'type' => 'class', |
| 89 |
'classname' => 'CallableArgument', |
| 90 |
'isabstract' => false, |
| 91 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 92 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\CallableArgument', |
| 93 |
'implements' => |
| 94 |
array ( |
| 95 |
), |
| 96 |
), |
| 97 |
'League\\Container\\Argument\\Literal\\FloatArgument' => |
| 98 |
array ( |
| 99 |
'type' => 'class', |
| 100 |
'classname' => 'FloatArgument', |
| 101 |
'isabstract' => false, |
| 102 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 103 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\FloatArgument', |
| 104 |
'implements' => |
| 105 |
array ( |
| 106 |
), |
| 107 |
), |
| 108 |
'League\\Container\\Argument\\Literal\\IntegerArgument' => |
| 109 |
array ( |
| 110 |
'type' => 'class', |
| 111 |
'classname' => 'IntegerArgument', |
| 112 |
'isabstract' => false, |
| 113 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 114 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\IntegerArgument', |
| 115 |
'implements' => |
| 116 |
array ( |
| 117 |
), |
| 118 |
), |
| 119 |
'League\\Container\\Argument\\Literal\\ObjectArgument' => |
| 120 |
array ( |
| 121 |
'type' => 'class', |
| 122 |
'classname' => 'ObjectArgument', |
| 123 |
'isabstract' => false, |
| 124 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 125 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\ObjectArgument', |
| 126 |
'implements' => |
| 127 |
array ( |
| 128 |
), |
| 129 |
), |
| 130 |
'League\\Container\\Argument\\Literal\\StringArgument' => |
| 131 |
array ( |
| 132 |
'type' => 'class', |
| 133 |
'classname' => 'StringArgument', |
| 134 |
'isabstract' => false, |
| 135 |
'namespace' => 'League\\Container\\Argument\\Literal', |
| 136 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\Literal\\StringArgument', |
| 137 |
'implements' => |
| 138 |
array ( |
| 139 |
), |
| 140 |
), |
| 141 |
'League\\Container\\Argument\\LiteralArgument' => |
| 142 |
array ( |
| 143 |
'type' => 'class', |
| 144 |
'classname' => 'LiteralArgument', |
| 145 |
'isabstract' => false, |
| 146 |
'namespace' => 'League\\Container\\Argument', |
| 147 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\LiteralArgument', |
| 148 |
'implements' => |
| 149 |
array ( |
| 150 |
0 => 'League\\Container\\Argument\\LiteralArgumentInterface', |
| 151 |
), |
| 152 |
), |
| 153 |
'League\\Container\\Argument\\ResolvableArgument' => |
| 154 |
array ( |
| 155 |
'type' => 'class', |
| 156 |
'classname' => 'ResolvableArgument', |
| 157 |
'isabstract' => false, |
| 158 |
'namespace' => 'League\\Container\\Argument', |
| 159 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Argument\\ResolvableArgument', |
| 160 |
'implements' => |
| 161 |
array ( |
| 162 |
0 => 'League\\Container\\Argument\\ResolvableArgumentInterface', |
| 163 |
), |
| 164 |
), |
| 165 |
'League\\Container\\Container' => |
| 166 |
array ( |
| 167 |
'type' => 'class', |
| 168 |
'classname' => 'Container', |
| 169 |
'isabstract' => false, |
| 170 |
'namespace' => 'League\\Container', |
| 171 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Container', |
| 172 |
'implements' => |
| 173 |
array ( |
| 174 |
0 => 'League\\Container\\DefinitionContainerInterface', |
| 175 |
), |
| 176 |
), |
| 177 |
'League\\Container\\Definition\\Definition' => |
| 178 |
array ( |
| 179 |
'type' => 'class', |
| 180 |
'classname' => 'Definition', |
| 181 |
'isabstract' => false, |
| 182 |
'namespace' => 'League\\Container\\Definition', |
| 183 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Definition\\Definition', |
| 184 |
'implements' => |
| 185 |
array ( |
| 186 |
0 => 'League\\Container\\Argument\\ArgumentResolverInterface', |
| 187 |
1 => 'League\\Container\\Definition\\DefinitionInterface', |
| 188 |
), |
| 189 |
), |
| 190 |
'League\\Container\\Definition\\DefinitionAggregate' => |
| 191 |
array ( |
| 192 |
'type' => 'class', |
| 193 |
'classname' => 'DefinitionAggregate', |
| 194 |
'isabstract' => false, |
| 195 |
'namespace' => 'League\\Container\\Definition', |
| 196 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Definition\\DefinitionAggregate', |
| 197 |
'implements' => |
| 198 |
array ( |
| 199 |
0 => 'League\\Container\\Definition\\DefinitionAggregateInterface', |
| 200 |
), |
| 201 |
), |
| 202 |
'League\\Container\\Exception\\ContainerException' => |
| 203 |
array ( |
| 204 |
'type' => 'class', |
| 205 |
'classname' => 'ContainerException', |
| 206 |
'isabstract' => false, |
| 207 |
'namespace' => 'League\\Container\\Exception', |
| 208 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Exception\\ContainerException', |
| 209 |
'implements' => |
| 210 |
array ( |
| 211 |
0 => 'Psr\\Container\\ContainerExceptionInterface', |
| 212 |
), |
| 213 |
), |
| 214 |
'League\\Container\\Exception\\NotFoundException' => |
| 215 |
array ( |
| 216 |
'type' => 'class', |
| 217 |
'classname' => 'NotFoundException', |
| 218 |
'isabstract' => false, |
| 219 |
'namespace' => 'League\\Container\\Exception', |
| 220 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Exception\\NotFoundException', |
| 221 |
'implements' => |
| 222 |
array ( |
| 223 |
0 => 'Psr\\Container\\NotFoundExceptionInterface', |
| 224 |
), |
| 225 |
), |
| 226 |
'League\\Container\\Inflector\\Inflector' => |
| 227 |
array ( |
| 228 |
'type' => 'class', |
| 229 |
'classname' => 'Inflector', |
| 230 |
'isabstract' => false, |
| 231 |
'namespace' => 'League\\Container\\Inflector', |
| 232 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Inflector\\Inflector', |
| 233 |
'implements' => |
| 234 |
array ( |
| 235 |
0 => 'League\\Container\\Argument\\ArgumentResolverInterface', |
| 236 |
1 => 'League\\Container\\Inflector\\InflectorInterface', |
| 237 |
), |
| 238 |
), |
| 239 |
'League\\Container\\Inflector\\InflectorAggregate' => |
| 240 |
array ( |
| 241 |
'type' => 'class', |
| 242 |
'classname' => 'InflectorAggregate', |
| 243 |
'isabstract' => false, |
| 244 |
'namespace' => 'League\\Container\\Inflector', |
| 245 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\Inflector\\InflectorAggregate', |
| 246 |
'implements' => |
| 247 |
array ( |
| 248 |
0 => 'League\\Container\\Inflector\\InflectorAggregateInterface', |
| 249 |
), |
| 250 |
), |
| 251 |
'League\\Container\\ReflectionContainer' => |
| 252 |
array ( |
| 253 |
'type' => 'class', |
| 254 |
'classname' => 'ReflectionContainer', |
| 255 |
'isabstract' => false, |
| 256 |
'namespace' => 'League\\Container', |
| 257 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\ReflectionContainer', |
| 258 |
'implements' => |
| 259 |
array ( |
| 260 |
0 => 'League\\Container\\Argument\\ArgumentResolverInterface', |
| 261 |
1 => 'Psr\\Container\\ContainerInterface', |
| 262 |
), |
| 263 |
), |
| 264 |
'League\\Container\\ServiceProvider\\AbstractServiceProvider' => |
| 265 |
array ( |
| 266 |
'type' => 'class', |
| 267 |
'classname' => 'AbstractServiceProvider', |
| 268 |
'isabstract' => true, |
| 269 |
'namespace' => 'League\\Container\\ServiceProvider', |
| 270 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\AbstractServiceProvider', |
| 271 |
'implements' => |
| 272 |
array ( |
| 273 |
0 => 'League\\Container\\ServiceProvider\\ServiceProviderInterface', |
| 274 |
), |
| 275 |
), |
| 276 |
'League\\Container\\ServiceProvider\\ServiceProviderAggregate' => |
| 277 |
array ( |
| 278 |
'type' => 'class', |
| 279 |
'classname' => 'ServiceProviderAggregate', |
| 280 |
'isabstract' => false, |
| 281 |
'namespace' => 'League\\Container\\ServiceProvider', |
| 282 |
'extends' => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregate', |
| 283 |
'implements' => |
| 284 |
array ( |
| 285 |
0 => 'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface', |
| 286 |
), |
| 287 |
), |
| 288 |
'WPMedia\\PluginFamily\\Controller\\PluginFamily' => |
| 289 |
array ( |
| 290 |
'type' => 'class', |
| 291 |
'classname' => 'PluginFamily', |
| 292 |
'isabstract' => false, |
| 293 |
'namespace' => 'WPMedia\\PluginFamily\\Controller', |
| 294 |
'extends' => 'Imagify\\Dependencies\\WPMedia\\PluginFamily\\Controller\\PluginFamily', |
| 295 |
'implements' => |
| 296 |
array ( |
| 297 |
0 => 'WPMedia\\PluginFamily\\Controller\\PluginFamilyInterface', |
| 298 |
), |
| 299 |
), |
| 300 |
'WPMedia\\PluginFamily\\Model\\PluginFamily' => |
| 301 |
array ( |
| 302 |
'type' => 'class', |
| 303 |
'classname' => 'PluginFamily', |
| 304 |
'isabstract' => false, |
| 305 |
'namespace' => 'WPMedia\\PluginFamily\\Model', |
| 306 |
'extends' => 'Imagify\\Dependencies\\WPMedia\\PluginFamily\\Model\\PluginFamily', |
| 307 |
'implements' => |
| 308 |
array ( |
| 309 |
), |
| 310 |
), |
| 311 |
'WPMedia\\PluginFamily\\PostInstall' => |
| 312 |
array ( |
| 313 |
'type' => 'class', |
| 314 |
'classname' => 'PostInstall', |
| 315 |
'isabstract' => false, |
| 316 |
'namespace' => 'WPMedia\\PluginFamily', |
| 317 |
'extends' => 'Imagify\\Dependencies\\WPMedia\\PluginFamily\\PostInstall', |
| 318 |
'implements' => |
| 319 |
array ( |
| 320 |
), |
| 321 |
), |
| 322 |
'League\\Container\\Argument\\ArgumentResolverTrait' => |
| 323 |
array ( |
| 324 |
'type' => 'trait', |
| 325 |
'traitname' => 'ArgumentResolverTrait', |
| 326 |
'namespace' => 'League\\Container\\Argument', |
| 327 |
'use' => |
| 328 |
array ( |
| 329 |
0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ArgumentResolverTrait', |
| 330 |
), |
| 331 |
), |
| 332 |
'League\\Container\\ContainerAwareTrait' => |
| 333 |
array ( |
| 334 |
'type' => 'trait', |
| 335 |
'traitname' => 'ContainerAwareTrait', |
| 336 |
'namespace' => 'League\\Container', |
| 337 |
'use' => |
| 338 |
array ( |
| 339 |
0 => 'Imagify\\Dependencies\\League\\Container\\ContainerAwareTrait', |
| 340 |
), |
| 341 |
), |
| 342 |
'League\\Container\\Argument\\ArgumentInterface' => |
| 343 |
array ( |
| 344 |
'type' => 'interface', |
| 345 |
'interfacename' => 'ArgumentInterface', |
| 346 |
'namespace' => 'League\\Container\\Argument', |
| 347 |
'extends' => |
| 348 |
array ( |
| 349 |
0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ArgumentInterface', |
| 350 |
), |
| 351 |
), |
| 352 |
'League\\Container\\Argument\\ArgumentResolverInterface' => |
| 353 |
array ( |
| 354 |
'type' => 'interface', |
| 355 |
'interfacename' => 'ArgumentResolverInterface', |
| 356 |
'namespace' => 'League\\Container\\Argument', |
| 357 |
'extends' => |
| 358 |
array ( |
| 359 |
0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface', |
| 360 |
), |
| 361 |
), |
| 362 |
'League\\Container\\Argument\\DefaultValueInterface' => |
| 363 |
array ( |
| 364 |
'type' => 'interface', |
| 365 |
'interfacename' => 'DefaultValueInterface', |
| 366 |
'namespace' => 'League\\Container\\Argument', |
| 367 |
'extends' => |
| 368 |
array ( |
| 369 |
0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\DefaultValueInterface', |
| 370 |
), |
| 371 |
), |
| 372 |
'League\\Container\\Argument\\LiteralArgumentInterface' => |
| 373 |
array ( |
| 374 |
'type' => 'interface', |
| 375 |
'interfacename' => 'LiteralArgumentInterface', |
| 376 |
'namespace' => 'League\\Container\\Argument', |
| 377 |
'extends' => |
| 378 |
array ( |
| 379 |
0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\LiteralArgumentInterface', |
| 380 |
), |
| 381 |
), |
| 382 |
'League\\Container\\Argument\\ResolvableArgumentInterface' => |
| 383 |
array ( |
| 384 |
'type' => 'interface', |
| 385 |
'interfacename' => 'ResolvableArgumentInterface', |
| 386 |
'namespace' => 'League\\Container\\Argument', |
| 387 |
'extends' => |
| 388 |
array ( |
| 389 |
0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ResolvableArgumentInterface', |
| 390 |
), |
| 391 |
), |
| 392 |
'League\\Container\\ContainerAwareInterface' => |
| 393 |
array ( |
| 394 |
'type' => 'interface', |
| 395 |
'interfacename' => 'ContainerAwareInterface', |
| 396 |
'namespace' => 'League\\Container', |
| 397 |
'extends' => |
| 398 |
array ( |
| 399 |
0 => 'Imagify\\Dependencies\\League\\Container\\ContainerAwareInterface', |
| 400 |
), |
| 401 |
), |
| 402 |
'League\\Container\\Definition\\DefinitionAggregateInterface' => |
| 403 |
array ( |
| 404 |
'type' => 'interface', |
| 405 |
'interfacename' => 'DefinitionAggregateInterface', |
| 406 |
'namespace' => 'League\\Container\\Definition', |
| 407 |
'extends' => |
| 408 |
array ( |
| 409 |
0 => 'Imagify\\Dependencies\\League\\Container\\Definition\\DefinitionAggregateInterface', |
| 410 |
), |
| 411 |
), |
| 412 |
'League\\Container\\Definition\\DefinitionInterface' => |
| 413 |
array ( |
| 414 |
'type' => 'interface', |
| 415 |
'interfacename' => 'DefinitionInterface', |
| 416 |
'namespace' => 'League\\Container\\Definition', |
| 417 |
'extends' => |
| 418 |
array ( |
| 419 |
0 => 'Imagify\\Dependencies\\League\\Container\\Definition\\DefinitionInterface', |
| 420 |
), |
| 421 |
), |
| 422 |
'League\\Container\\DefinitionContainerInterface' => |
| 423 |
array ( |
| 424 |
'type' => 'interface', |
| 425 |
'interfacename' => 'DefinitionContainerInterface', |
| 426 |
'namespace' => 'League\\Container', |
| 427 |
'extends' => |
| 428 |
array ( |
| 429 |
0 => 'Imagify\\Dependencies\\League\\Container\\DefinitionContainerInterface', |
| 430 |
), |
| 431 |
), |
| 432 |
'League\\Container\\Inflector\\InflectorAggregateInterface' => |
| 433 |
array ( |
| 434 |
'type' => 'interface', |
| 435 |
'interfacename' => 'InflectorAggregateInterface', |
| 436 |
'namespace' => 'League\\Container\\Inflector', |
| 437 |
'extends' => |
| 438 |
array ( |
| 439 |
0 => 'Imagify\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface', |
| 440 |
), |
| 441 |
), |
| 442 |
'League\\Container\\Inflector\\InflectorInterface' => |
| 443 |
array ( |
| 444 |
'type' => 'interface', |
| 445 |
'interfacename' => 'InflectorInterface', |
| 446 |
'namespace' => 'League\\Container\\Inflector', |
| 447 |
'extends' => |
| 448 |
array ( |
| 449 |
0 => 'Imagify\\Dependencies\\League\\Container\\Inflector\\InflectorInterface', |
| 450 |
), |
| 451 |
), |
| 452 |
'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' => |
| 453 |
array ( |
| 454 |
'type' => 'interface', |
| 455 |
'interfacename' => 'BootableServiceProviderInterface', |
| 456 |
'namespace' => 'League\\Container\\ServiceProvider', |
| 457 |
'extends' => |
| 458 |
array ( |
| 459 |
0 => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\BootableServiceProviderInterface', |
| 460 |
), |
| 461 |
), |
| 462 |
'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' => |
| 463 |
array ( |
| 464 |
'type' => 'interface', |
| 465 |
'interfacename' => 'ServiceProviderAggregateInterface', |
| 466 |
'namespace' => 'League\\Container\\ServiceProvider', |
| 467 |
'extends' => |
| 468 |
array ( |
| 469 |
0 => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface', |
| 470 |
), |
| 471 |
), |
| 472 |
'League\\Container\\ServiceProvider\\ServiceProviderInterface' => |
| 473 |
array ( |
| 474 |
'type' => 'interface', |
| 475 |
'interfacename' => 'ServiceProviderInterface', |
| 476 |
'namespace' => 'League\\Container\\ServiceProvider', |
| 477 |
'extends' => |
| 478 |
array ( |
| 479 |
0 => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface', |
| 480 |
), |
| 481 |
), |
| 482 |
'Psr\\Container\\ContainerExceptionInterface' => |
| 483 |
array ( |
| 484 |
'type' => 'interface', |
| 485 |
'interfacename' => 'ContainerExceptionInterface', |
| 486 |
'namespace' => 'Psr\\Container', |
| 487 |
'extends' => |
| 488 |
array ( |
| 489 |
0 => 'Imagify\\Dependencies\\Psr\\Container\\ContainerExceptionInterface', |
| 490 |
), |
| 491 |
), |
| 492 |
'Psr\\Container\\ContainerInterface' => |
| 493 |
array ( |
| 494 |
'type' => 'interface', |
| 495 |
'interfacename' => 'ContainerInterface', |
| 496 |
'namespace' => 'Psr\\Container', |
| 497 |
'extends' => |
| 498 |
array ( |
| 499 |
0 => 'Imagify\\Dependencies\\Psr\\Container\\ContainerInterface', |
| 500 |
), |
| 501 |
), |
| 502 |
'Psr\\Container\\NotFoundExceptionInterface' => |
| 503 |
array ( |
| 504 |
'type' => 'interface', |
| 505 |
'interfacename' => 'NotFoundExceptionInterface', |
| 506 |
'namespace' => 'Psr\\Container', |
| 507 |
'extends' => |
| 508 |
array ( |
| 509 |
0 => 'Imagify\\Dependencies\\Psr\\Container\\NotFoundExceptionInterface', |
| 510 |
), |
| 511 |
), |
| 512 |
'WPMedia\\PluginFamily\\Controller\\PluginFamilyInterface' => |
| 513 |
array ( |
| 514 |
'type' => 'interface', |
| 515 |
'interfacename' => 'PluginFamilyInterface', |
| 516 |
'namespace' => 'WPMedia\\PluginFamily\\Controller', |
| 517 |
'extends' => |
| 518 |
array ( |
| 519 |
0 => 'Imagify\\Dependencies\\WPMedia\\PluginFamily\\Controller\\PluginFamilyInterface', |
| 520 |
), |
| 521 |
), |
| 522 |
); |
| 523 |
|
| 524 |
public function __construct() |
| 525 |
{ |
| 526 |
$this->includeFilePath = __DIR__ . '/autoload_alias.php'; |
| 527 |
} |
| 528 |
|
| 529 |
/** |
| 530 |
* @param string $class |
| 531 |
*/ |
| 532 |
public function autoload($class): void |
| 533 |
{ |
| 534 |
if (!isset($this->autoloadAliases[$class])) { |
| 535 |
return; |
| 536 |
} |
| 537 |
switch ($this->autoloadAliases[$class]['type']) { |
| 538 |
case 'class': |
| 539 |
$this->load( |
| 540 |
$this->classTemplate( |
| 541 |
$this->autoloadAliases[$class] |
| 542 |
) |
| 543 |
); |
| 544 |
break; |
| 545 |
case 'interface': |
| 546 |
$this->load( |
| 547 |
$this->interfaceTemplate( |
| 548 |
$this->autoloadAliases[$class] |
| 549 |
) |
| 550 |
); |
| 551 |
break; |
| 552 |
case 'trait': |
| 553 |
$this->load( |
| 554 |
$this->traitTemplate( |
| 555 |
$this->autoloadAliases[$class] |
| 556 |
) |
| 557 |
); |
| 558 |
break; |
| 559 |
default: |
| 560 |
// Never. |
| 561 |
break; |
| 562 |
} |
| 563 |
} |
| 564 |
|
| 565 |
private function load(string $includeFile): void |
| 566 |
{ |
| 567 |
file_put_contents($this->includeFilePath, $includeFile); |
| 568 |
include $this->includeFilePath; |
| 569 |
file_exists($this->includeFilePath) && unlink($this->includeFilePath); |
| 570 |
} |
| 571 |
|
| 572 |
/** |
| 573 |
* @param ClassAliasArray $class |
| 574 |
*/ |
| 575 |
private function classTemplate(array $class): string |
| 576 |
{ |
| 577 |
$abstract = $class['isabstract'] ? 'abstract ' : ''; |
| 578 |
$classname = $class['classname']; |
| 579 |
if (isset($class['namespace'])) { |
| 580 |
$namespace = "namespace {$class['namespace']};"; |
| 581 |
$extends = '\\' . $class['extends']; |
| 582 |
$implements = empty($class['implements']) ? '' |
| 583 |
: ' implements \\' . implode(', \\', $class['implements']); |
| 584 |
} else { |
| 585 |
$namespace = ''; |
| 586 |
$extends = $class['extends']; |
| 587 |
$implements = !empty($class['implements']) ? '' |
| 588 |
: ' implements ' . implode(', ', $class['implements']); |
| 589 |
} |
| 590 |
return <<<EOD |
| 591 |
<?php |
| 592 |
$namespace |
| 593 |
$abstract class $classname extends $extends $implements {} |
| 594 |
EOD; |
| 595 |
} |
| 596 |
|
| 597 |
/** |
| 598 |
* @param InterfaceAliasArray $interface |
| 599 |
*/ |
| 600 |
private function interfaceTemplate(array $interface): string |
| 601 |
{ |
| 602 |
$interfacename = $interface['interfacename']; |
| 603 |
$namespace = isset($interface['namespace']) |
| 604 |
? "namespace {$interface['namespace']};" : ''; |
| 605 |
$extends = isset($interface['namespace']) |
| 606 |
? '\\' . implode('\\ ,', $interface['extends']) |
| 607 |
: implode(', ', $interface['extends']); |
| 608 |
return <<<EOD |
| 609 |
<?php |
| 610 |
$namespace |
| 611 |
interface $interfacename extends $extends {} |
| 612 |
EOD; |
| 613 |
} |
| 614 |
|
| 615 |
/** |
| 616 |
* @param TraitAliasArray $trait |
| 617 |
*/ |
| 618 |
private function traitTemplate(array $trait): string |
| 619 |
{ |
| 620 |
$traitname = $trait['traitname']; |
| 621 |
$namespace = isset($trait['namespace']) |
| 622 |
? "namespace {$trait['namespace']};" : ''; |
| 623 |
$uses = isset($trait['namespace']) |
| 624 |
? '\\' . implode(';' . PHP_EOL . ' use \\', $trait['use']) |
| 625 |
: implode(';' . PHP_EOL . ' use ', $trait['use']); |
| 626 |
return <<<EOD |
| 627 |
<?php |
| 628 |
$namespace |
| 629 |
trait $traitname { |
| 630 |
use $uses; |
| 631 |
} |
| 632 |
EOD; |
| 633 |
} |
| 634 |
} |
| 635 |
|
| 636 |
spl_autoload_register([ new AliasAutoloader(), 'autoload' ]); |
| 637 |
} |
| 638 |
|