-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathHttpDefaultFeatures.php
More file actions
93 lines (80 loc) · 2.97 KB
/
Copy pathHttpDefaultFeatures.php
File metadata and controls
93 lines (80 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
declare(strict_types=1);
namespace Smsapi\Client\Service;
use Smsapi\Client\Feature\Blacklist\BlacklistFeature;
use Smsapi\Client\Feature\Blacklist\BlacklistHttpFeature;
use Smsapi\Client\Feature\Contacts\ContactsFeature;
use Smsapi\Client\Feature\Contacts\ContactsHttpFeature;
use Smsapi\Client\Feature\Data\DataFactoryProvider;
use Smsapi\Client\Feature\Hlr\HlrFeature;
use Smsapi\Client\Feature\Hlr\HlrHttpFeature;
use Smsapi\Client\Feature\ShortUrl\ShortUlrHttpFeature;
use Smsapi\Client\Feature\ShortUrl\ShortUrlFeature;
use Smsapi\Client\Feature\Mfa\MfaFeature;
use Smsapi\Client\Feature\Mfa\MfaHttpFeature;
use Smsapi\Client\Feature\Sms\SmsFeature;
use Smsapi\Client\Feature\Sms\SmsHttpFeature;
use Smsapi\Client\Feature\Subusers\SubusersFeature;
use Smsapi\Client\Feature\Ping\PingFeature;
use Smsapi\Client\Feature\Ping\PingHttpFeature;
use Smsapi\Client\Feature\Subusers\SubusersHttpFeature;
use Smsapi\Client\Infrastructure\RequestExecutor\RequestExecutorFactory;
/**
* @internal
*/
trait HttpDefaultFeatures
{
/** @var RequestExecutorFactory */
private $requestExecutorFactory;
/** @var DataFactoryProvider */
private $dataFactoryProvider;
public function pingFeature(): PingFeature
{
return new PingHttpFeature($this->requestExecutorFactory->createRestRequestExecutor());
}
public function smsFeature(): SmsFeature
{
return new SmsHttpFeature($this->requestExecutorFactory, $this->dataFactoryProvider);
}
public function mfaFeature(): MfaFeature
{
$restRequestExecutor = $this->requestExecutorFactory->createRestRequestExecutor();
$mfaFactory = $this->dataFactoryProvider->provideMfaFactory();
return new MfaHttpFeature($restRequestExecutor, $mfaFactory);
}
public function hlrFeature(): HlrFeature
{
return new HlrHttpFeature(
$this->requestExecutorFactory->createLegacyRequestExecutor(),
$this->dataFactoryProvider->provideHlrFactory()
);
}
public function subusersFeature(): SubusersFeature
{
return new SubusersHttpFeature(
$this->requestExecutorFactory->createRestRequestExecutor(),
$this->dataFactoryProvider->provideSubuserFactory()
);
}
public function shortUrlFeature(): ShortUrlFeature
{
return new ShortUlrHttpFeature(
$this->requestExecutorFactory->createRestRequestExecutor(),
$this->dataFactoryProvider->provideShortUrlLinkFactory()
);
}
public function contactsFeature(): ContactsFeature
{
return new ContactsHttpFeature(
$this->requestExecutorFactory->createRestRequestExecutor(),
$this->dataFactoryProvider
);
}
public function blacklistFeature(): BlacklistFeature
{
return new BlacklistHttpFeature(
$this->requestExecutorFactory->createRestRequestExecutor(),
$this->dataFactoryProvider->provideBlacklistedPhoneNumberFactory()
);
}
}