PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.0
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.0
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
imagify / vendor / composer / autoload_aliases.php

autoload_aliases.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.0, at vendor/composer/autoload_aliases.php

792 lines 24.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 'WPMedia_Base_MixpanelBase' =>
323 array (
324 'type' => 'class',
325 'classname' => 'WPMedia_Base_MixpanelBase',
326 'isabstract' => false,
327 'namespace' => '\\',
328 'extends' => 'Imagify_WPMedia_Base_MixpanelBase',
329 'implements' =>
330 array (
331 ),
332 ),
333 'WPMedia_ConsumerStrategies_AbstractConsumer' =>
334 array (
335 'type' => 'class',
336 'classname' => 'WPMedia_ConsumerStrategies_AbstractConsumer',
337 'isabstract' => true,
338 'namespace' => '\\',
339 'extends' => 'Imagify_WPMedia_ConsumerStrategies_AbstractConsumer',
340 'implements' =>
341 array (
342 ),
343 ),
344 'WPMedia_ConsumerStrategies_CurlConsumer' =>
345 array (
346 'type' => 'class',
347 'classname' => 'WPMedia_ConsumerStrategies_CurlConsumer',
348 'isabstract' => false,
349 'namespace' => '\\',
350 'extends' => 'Imagify_WPMedia_ConsumerStrategies_CurlConsumer',
351 'implements' =>
352 array (
353 ),
354 ),
355 'WPMedia_ConsumerStrategies_FileConsumer' =>
356 array (
357 'type' => 'class',
358 'classname' => 'WPMedia_ConsumerStrategies_FileConsumer',
359 'isabstract' => false,
360 'namespace' => '\\',
361 'extends' => 'Imagify_WPMedia_ConsumerStrategies_FileConsumer',
362 'implements' =>
363 array (
364 ),
365 ),
366 'WPMedia_ConsumerStrategies_SocketConsumer' =>
367 array (
368 'type' => 'class',
369 'classname' => 'WPMedia_ConsumerStrategies_SocketConsumer',
370 'isabstract' => false,
371 'namespace' => '\\',
372 'extends' => 'Imagify_WPMedia_ConsumerStrategies_SocketConsumer',
373 'implements' =>
374 array (
375 ),
376 ),
377 'WPMedia_Mixpanel' =>
378 array (
379 'type' => 'class',
380 'classname' => 'WPMedia_Mixpanel',
381 'isabstract' => false,
382 'namespace' => '\\',
383 'extends' => 'Imagify_WPMedia_Mixpanel',
384 'implements' =>
385 array (
386 ),
387 ),
388 'WPMedia_Producers_MixpanelBaseProducer' =>
389 array (
390 'type' => 'class',
391 'classname' => 'WPMedia_Producers_MixpanelBaseProducer',
392 'isabstract' => true,
393 'namespace' => '\\',
394 'extends' => 'Imagify_WPMedia_Producers_MixpanelBaseProducer',
395 'implements' =>
396 array (
397 ),
398 ),
399 'WPMedia_Producers_MixpanelEvents' =>
400 array (
401 'type' => 'class',
402 'classname' => 'WPMedia_Producers_MixpanelEvents',
403 'isabstract' => false,
404 'namespace' => '\\',
405 'extends' => 'Imagify_WPMedia_Producers_MixpanelEvents',
406 'implements' =>
407 array (
408 ),
409 ),
410 'WPMedia_Producers_MixpanelGroups' =>
411 array (
412 'type' => 'class',
413 'classname' => 'WPMedia_Producers_MixpanelGroups',
414 'isabstract' => false,
415 'namespace' => '\\',
416 'extends' => 'Imagify_WPMedia_Producers_MixpanelGroups',
417 'implements' =>
418 array (
419 ),
420 ),
421 'WPMedia_Producers_MixpanelPeople' =>
422 array (
423 'type' => 'class',
424 'classname' => 'WPMedia_Producers_MixpanelPeople',
425 'isabstract' => false,
426 'namespace' => '\\',
427 'extends' => 'Imagify_WPMedia_Producers_MixpanelPeople',
428 'implements' =>
429 array (
430 ),
431 ),
432 'WPMedia\\Mixpanel\\Optin' =>
433 array (
434 'type' => 'class',
435 'classname' => 'Optin',
436 'isabstract' => false,
437 'namespace' => 'WPMedia\\Mixpanel',
438 'extends' => 'Imagify\\Dependencies\\WPMedia\\Mixpanel\\Optin',
439 'implements' =>
440 array (
441 ),
442 ),
443 'WPMedia\\Mixpanel\\Tracking' =>
444 array (
445 'type' => 'class',
446 'classname' => 'Tracking',
447 'isabstract' => false,
448 'namespace' => 'WPMedia\\Mixpanel',
449 'extends' => 'Imagify\\Dependencies\\WPMedia\\Mixpanel\\Tracking',
450 'implements' =>
451 array (
452 ),
453 ),
454 'WPMedia\\Mixpanel\\TrackingPlugin' =>
455 array (
456 'type' => 'class',
457 'classname' => 'TrackingPlugin',
458 'isabstract' => false,
459 'namespace' => 'WPMedia\\Mixpanel',
460 'extends' => 'Imagify\\Dependencies\\WPMedia\\Mixpanel\\TrackingPlugin',
461 'implements' =>
462 array (
463 ),
464 ),
465 'WPMedia\\Mixpanel\\WPConsumer' =>
466 array (
467 'type' => 'class',
468 'classname' => 'WPConsumer',
469 'isabstract' => false,
470 'namespace' => 'WPMedia\\Mixpanel',
471 'extends' => 'Imagify\\Dependencies\\WPMedia\\Mixpanel\\WPConsumer',
472 'implements' =>
473 array (
474 ),
475 ),
476 'League\\Container\\Argument\\ArgumentResolverTrait' =>
477 array (
478 'type' => 'trait',
479 'traitname' => 'ArgumentResolverTrait',
480 'namespace' => 'League\\Container\\Argument',
481 'use' =>
482 array (
483 0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ArgumentResolverTrait',
484 ),
485 ),
486 'League\\Container\\ContainerAwareTrait' =>
487 array (
488 'type' => 'trait',
489 'traitname' => 'ContainerAwareTrait',
490 'namespace' => 'League\\Container',
491 'use' =>
492 array (
493 0 => 'Imagify\\Dependencies\\League\\Container\\ContainerAwareTrait',
494 ),
495 ),
496 'League\\Container\\Argument\\ArgumentInterface' =>
497 array (
498 'type' => 'interface',
499 'interfacename' => 'ArgumentInterface',
500 'namespace' => 'League\\Container\\Argument',
501 'extends' =>
502 array (
503 0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ArgumentInterface',
504 ),
505 ),
506 'League\\Container\\Argument\\ArgumentResolverInterface' =>
507 array (
508 'type' => 'interface',
509 'interfacename' => 'ArgumentResolverInterface',
510 'namespace' => 'League\\Container\\Argument',
511 'extends' =>
512 array (
513 0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface',
514 ),
515 ),
516 'League\\Container\\Argument\\DefaultValueInterface' =>
517 array (
518 'type' => 'interface',
519 'interfacename' => 'DefaultValueInterface',
520 'namespace' => 'League\\Container\\Argument',
521 'extends' =>
522 array (
523 0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\DefaultValueInterface',
524 ),
525 ),
526 'League\\Container\\Argument\\LiteralArgumentInterface' =>
527 array (
528 'type' => 'interface',
529 'interfacename' => 'LiteralArgumentInterface',
530 'namespace' => 'League\\Container\\Argument',
531 'extends' =>
532 array (
533 0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\LiteralArgumentInterface',
534 ),
535 ),
536 'League\\Container\\Argument\\ResolvableArgumentInterface' =>
537 array (
538 'type' => 'interface',
539 'interfacename' => 'ResolvableArgumentInterface',
540 'namespace' => 'League\\Container\\Argument',
541 'extends' =>
542 array (
543 0 => 'Imagify\\Dependencies\\League\\Container\\Argument\\ResolvableArgumentInterface',
544 ),
545 ),
546 'League\\Container\\ContainerAwareInterface' =>
547 array (
548 'type' => 'interface',
549 'interfacename' => 'ContainerAwareInterface',
550 'namespace' => 'League\\Container',
551 'extends' =>
552 array (
553 0 => 'Imagify\\Dependencies\\League\\Container\\ContainerAwareInterface',
554 ),
555 ),
556 'League\\Container\\Definition\\DefinitionAggregateInterface' =>
557 array (
558 'type' => 'interface',
559 'interfacename' => 'DefinitionAggregateInterface',
560 'namespace' => 'League\\Container\\Definition',
561 'extends' =>
562 array (
563 0 => 'Imagify\\Dependencies\\League\\Container\\Definition\\DefinitionAggregateInterface',
564 ),
565 ),
566 'League\\Container\\Definition\\DefinitionInterface' =>
567 array (
568 'type' => 'interface',
569 'interfacename' => 'DefinitionInterface',
570 'namespace' => 'League\\Container\\Definition',
571 'extends' =>
572 array (
573 0 => 'Imagify\\Dependencies\\League\\Container\\Definition\\DefinitionInterface',
574 ),
575 ),
576 'League\\Container\\DefinitionContainerInterface' =>
577 array (
578 'type' => 'interface',
579 'interfacename' => 'DefinitionContainerInterface',
580 'namespace' => 'League\\Container',
581 'extends' =>
582 array (
583 0 => 'Imagify\\Dependencies\\League\\Container\\DefinitionContainerInterface',
584 ),
585 ),
586 'League\\Container\\Inflector\\InflectorAggregateInterface' =>
587 array (
588 'type' => 'interface',
589 'interfacename' => 'InflectorAggregateInterface',
590 'namespace' => 'League\\Container\\Inflector',
591 'extends' =>
592 array (
593 0 => 'Imagify\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface',
594 ),
595 ),
596 'League\\Container\\Inflector\\InflectorInterface' =>
597 array (
598 'type' => 'interface',
599 'interfacename' => 'InflectorInterface',
600 'namespace' => 'League\\Container\\Inflector',
601 'extends' =>
602 array (
603 0 => 'Imagify\\Dependencies\\League\\Container\\Inflector\\InflectorInterface',
604 ),
605 ),
606 'League\\Container\\ServiceProvider\\BootableServiceProviderInterface' =>
607 array (
608 'type' => 'interface',
609 'interfacename' => 'BootableServiceProviderInterface',
610 'namespace' => 'League\\Container\\ServiceProvider',
611 'extends' =>
612 array (
613 0 => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\BootableServiceProviderInterface',
614 ),
615 ),
616 'League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' =>
617 array (
618 'type' => 'interface',
619 'interfacename' => 'ServiceProviderAggregateInterface',
620 'namespace' => 'League\\Container\\ServiceProvider',
621 'extends' =>
622 array (
623 0 => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface',
624 ),
625 ),
626 'League\\Container\\ServiceProvider\\ServiceProviderInterface' =>
627 array (
628 'type' => 'interface',
629 'interfacename' => 'ServiceProviderInterface',
630 'namespace' => 'League\\Container\\ServiceProvider',
631 'extends' =>
632 array (
633 0 => 'Imagify\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface',
634 ),
635 ),
636 'Psr\\Container\\ContainerExceptionInterface' =>
637 array (
638 'type' => 'interface',
639 'interfacename' => 'ContainerExceptionInterface',
640 'namespace' => 'Psr\\Container',
641 'extends' =>
642 array (
643 0 => 'Imagify\\Dependencies\\Psr\\Container\\ContainerExceptionInterface',
644 ),
645 ),
646 'Psr\\Container\\ContainerInterface' =>
647 array (
648 'type' => 'interface',
649 'interfacename' => 'ContainerInterface',
650 'namespace' => 'Psr\\Container',
651 'extends' =>
652 array (
653 0 => 'Imagify\\Dependencies\\Psr\\Container\\ContainerInterface',
654 ),
655 ),
656 'Psr\\Container\\NotFoundExceptionInterface' =>
657 array (
658 'type' => 'interface',
659 'interfacename' => 'NotFoundExceptionInterface',
660 'namespace' => 'Psr\\Container',
661 'extends' =>
662 array (
663 0 => 'Imagify\\Dependencies\\Psr\\Container\\NotFoundExceptionInterface',
664 ),
665 ),
666 'WPMedia\\PluginFamily\\Controller\\PluginFamilyInterface' =>
667 array (
668 'type' => 'interface',
669 'interfacename' => 'PluginFamilyInterface',
670 'namespace' => 'WPMedia\\PluginFamily\\Controller',
671 'extends' =>
672 array (
673 0 => 'Imagify\\Dependencies\\WPMedia\\PluginFamily\\Controller\\PluginFamilyInterface',
674 ),
675 ),
676 );
677
678 public function __construct()
679 {
680 $this->includeFilePath = __DIR__ . '/autoload_alias.php';
681 }
682
683 /**
684 * @param string $class
685 */
686 public function autoload($class): void
687 {
688 if (!isset($this->autoloadAliases[$class])) {
689 return;
690 }
691 switch ($this->autoloadAliases[$class]['type']) {
692 case 'class':
693 $this->load(
694 $this->classTemplate(
695 $this->autoloadAliases[$class]
696 )
697 );
698 break;
699 case 'interface':
700 $this->load(
701 $this->interfaceTemplate(
702 $this->autoloadAliases[$class]
703 )
704 );
705 break;
706 case 'trait':
707 $this->load(
708 $this->traitTemplate(
709 $this->autoloadAliases[$class]
710 )
711 );
712 break;
713 default:
714 // Never.
715 break;
716 }
717 }
718
719 private function load(string $includeFile): void
720 {
721 file_put_contents($this->includeFilePath, $includeFile);
722 include $this->includeFilePath;
723 file_exists($this->includeFilePath) && unlink($this->includeFilePath);
724 }
725
726 /**
727 * @param ClassAliasArray $class
728 */
729 private function classTemplate(array $class): string
730 {
731 $abstract = $class['isabstract'] ? 'abstract ' : '';
732 $classname = $class['classname'];
733 if (isset($class['namespace'])) {
734 $namespace = "namespace {$class['namespace']};";
735 $extends = '\\' . $class['extends'];
736 $implements = empty($class['implements']) ? ''
737 : ' implements \\' . implode(', \\', $class['implements']);
738 } else {
739 $namespace = '';
740 $extends = $class['extends'];
741 $implements = !empty($class['implements']) ? ''
742 : ' implements ' . implode(', ', $class['implements']);
743 }
744 return <<<EOD
745 <?php
746 $namespace
747 $abstract class $classname extends $extends $implements {}
748 EOD;
749 }
750
751 /**
752 * @param InterfaceAliasArray $interface
753 */
754 private function interfaceTemplate(array $interface): string
755 {
756 $interfacename = $interface['interfacename'];
757 $namespace = isset($interface['namespace'])
758 ? "namespace {$interface['namespace']};" : '';
759 $extends = isset($interface['namespace'])
760 ? '\\' . implode('\\ ,', $interface['extends'])
761 : implode(', ', $interface['extends']);
762 return <<<EOD
763 <?php
764 $namespace
765 interface $interfacename extends $extends {}
766 EOD;
767 }
768
769 /**
770 * @param TraitAliasArray $trait
771 */
772 private function traitTemplate(array $trait): string
773 {
774 $traitname = $trait['traitname'];
775 $namespace = isset($trait['namespace'])
776 ? "namespace {$trait['namespace']};" : '';
777 $uses = isset($trait['namespace'])
778 ? '\\' . implode(';' . PHP_EOL . ' use \\', $trait['use'])
779 : implode(';' . PHP_EOL . ' use ', $trait['use']);
780 return <<<EOD
781 <?php
782 $namespace
783 trait $traitname {
784 use $uses;
785 }
786 EOD;
787 }
788 }
789
790 spl_autoload_register([ new AliasAutoloader(), 'autoload' ]);
791 }
792