helpers.php
2.19 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
/**
* Created by PhpStorm.
* User: Hanson
* Date: 2016/12/29
* Time: 0:10
*/
use Hanson\Vbot\Core\Server;
use Hanson\Vbot\Core\Myself;
use Hanson\Vbot\Core\Http;
use Hanson\Vbot\Collections\Account;
use Hanson\Vbot\Collections\Member;
use Hanson\Vbot\Collections\Contact;
use Hanson\Vbot\Collections\Message;
use Hanson\Vbot\Collections\Group;
use Hanson\Vbot\Collections\Official;
if (! function_exists('server')) {
/**
* Get the available container instance.
*
* @param array $config
* @return Server
*/
function server($config = [])
{
return Server::getInstance($config);
}
}
if (! function_exists('myself')) {
/**
* Get the available container instance.
*
* @return Myself
*/
function myself()
{
return Myself::getInstance();
}
}
if (! function_exists('http')) {
/**
* Get the available container instance.
*
* @return Http
*/
function http()
{
return Http::getInstance();
}
}
if (! function_exists('account')) {
/**
* Get the available container instance.
*
* @return Account
*/
function account()
{
return Account::getInstance();
}
}
if (! function_exists('contact')) {
/**
* Get the available container instance.
*
* @return Contact
*/
function contact()
{
return Contact::getInstance();
}
}
if (! function_exists('member')) {
/**
* Get the available container instance.
*
* @return Member
*/
function member()
{
return Member::getInstance();
}
}
if (! function_exists('group')) {
/**
* Get the available container instance.
*
* @return Group
*/
function group()
{
return Group::getInstance();
}
}
if (! function_exists('message')) {
/**
* Get the available container instance.
*
* @return Message
*/
function message()
{
return Message::getInstance();
}
}
if (! function_exists('official')) {
/**
* Get the available container instance.
*
* @return Official
*/
function official()
{
return Official::getInstance();
}
}