PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / php-http / discovery / src / Strategy / CommonPsr17ClassesStrategy.php
ameliabooking / vendor / php-http / discovery / src / Strategy Last commit date
CommonClassesStrategy.php 6 months ago CommonPsr17ClassesStrategy.php 6 months ago DiscoveryStrategy.php 3 years ago MockClientStrategy.php 3 years ago PuliBetaStrategy.php 3 years ago
CommonPsr17ClassesStrategy.php
82 lines
1 <?php
2
3 namespace AmeliaHttp\Discovery\Strategy;
4
5 use AmeliaVendor\Psr\Http\Message\RequestFactoryInterface;
6 use AmeliaVendor\Psr\Http\Message\ResponseFactoryInterface;
7 use AmeliaVendor\Psr\Http\Message\ServerRequestFactoryInterface;
8 use AmeliaVendor\Psr\Http\Message\StreamFactoryInterface;
9 use AmeliaVendor\Psr\Http\Message\UploadedFileFactoryInterface;
10 use AmeliaVendor\Psr\Http\Message\UriFactoryInterface;
11
12 /**
13 * @internal
14 *
15 * @author Tobias Nyholm <tobias.nyholm@gmail.com>
16 */
17 final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
18 {
19 /**
20 * @var array
21 */
22 private static $classes = [
23 RequestFactoryInterface::class => [
24 'AmeliaNyholm\Psr7\Factory\Psr17Factory',
25 'Zend\Diactoros\RequestFactory',
26 'Http\Factory\Diactoros\RequestFactory',
27 'Http\Factory\Guzzle\RequestFactory',
28 'Http\Factory\Slim\RequestFactory',
29 ],
30 ResponseFactoryInterface::class => [
31 'AmeliaNyholm\Psr7\Factory\Psr17Factory',
32 'Zend\Diactoros\ResponseFactory',
33 'Http\Factory\Diactoros\ResponseFactory',
34 'Http\Factory\Guzzle\ResponseFactory',
35 'Http\Factory\Slim\ResponseFactory',
36 ],
37 ServerRequestFactoryInterface::class => [
38 'AmeliaNyholm\Psr7\Factory\Psr17Factory',
39 'Zend\Diactoros\ServerRequestFactory',
40 'Http\Factory\Diactoros\ServerRequestFactory',
41 'Http\Factory\Guzzle\ServerRequestFactory',
42 'Http\Factory\Slim\ServerRequestFactory',
43 ],
44 StreamFactoryInterface::class => [
45 'AmeliaNyholm\Psr7\Factory\Psr17Factory',
46 'Zend\Diactoros\StreamFactory',
47 'Http\Factory\Diactoros\StreamFactory',
48 'Http\Factory\Guzzle\StreamFactory',
49 'Http\Factory\Slim\StreamFactory',
50 ],
51 UploadedFileFactoryInterface::class => [
52 'AmeliaNyholm\Psr7\Factory\Psr17Factory',
53 'Zend\Diactoros\UploadedFileFactory',
54 'Http\Factory\Diactoros\UploadedFileFactory',
55 'Http\Factory\Guzzle\UploadedFileFactory',
56 'Http\Factory\Slim\UploadedFileFactory',
57 ],
58 UriFactoryInterface::class => [
59 'AmeliaNyholm\Psr7\Factory\Psr17Factory',
60 'Zend\Diactoros\UriFactory',
61 'Http\Factory\Diactoros\UriFactory',
62 'Http\Factory\Guzzle\UriFactory',
63 'Http\Factory\Slim\UriFactory',
64 ],
65 ];
66
67 /**
68 * {@inheritdoc}
69 */
70 public static function getCandidates($type)
71 {
72 $candidates = [];
73 if (isset(self::$classes[$type])) {
74 foreach (self::$classes[$type] as $class) {
75 $candidates[] = ['class' => $class, 'condition' => [$class]];
76 }
77 }
78
79 return $candidates;
80 }
81 }
82