This repository was archived by the owner on Jun 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +238
-0
lines changed Expand file tree Collapse file tree 5 files changed +238
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Apisearch PHP Client.
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ *
9
+ * Feel free to edit as you please, and have fun.
10
+ *
11
+ * @author Marc Morera <[email protected] >
12
+ * @author PuntMig Technologies
13
+ */
14
+
15
+ declare (strict_types=1 );
16
+
17
+ namespace Apisearch \App ;
18
+
19
+ /**
20
+ * Class AppRepositoryBucket.
21
+ */
22
+ class AppRepositoryBucket
23
+ {
24
+ /**
25
+ * @var AppRepository[]
26
+ *
27
+ * Repositories
28
+ */
29
+ private $ repositories = [];
30
+
31
+ /**
32
+ * Add repository.
33
+ *
34
+ * @param string $appName
35
+ * @param AppRepository $repository
36
+ */
37
+ public function addRepository (
38
+ string $ appName ,
39
+ AppRepository $ repository
40
+ ) {
41
+ $ this ->repositories [$ appName ] = $ repository ;
42
+ }
43
+
44
+ /**
45
+ * Get repository by name and index.
46
+ *
47
+ * @param string $appName
48
+ *
49
+ * @return AppRepository|null
50
+ */
51
+ public function findRepository (string $ appName ): ? AppRepository
52
+ {
53
+ return isset ($ this ->repositories [$ appName ])
54
+ ? $ this ->repositories [$ appName ]
55
+ : null ;
56
+ }
57
+ }
Original file line number Diff line number Diff line change @@ -46,6 +46,16 @@ public function deleteToken(TokenUUID $tokenUUID)
46
46
$ this ->throwMockException ();
47
47
}
48
48
49
+ /**
50
+ * Get tokens.
51
+ *
52
+ * @return Token[]
53
+ */
54
+ public function getTokens (): array
55
+ {
56
+ $ this ->throwMockException ();
57
+ }
58
+
49
59
/**
50
60
* Throw exception.
51
61
*
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Apisearch PHP Client.
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ *
9
+ * Feel free to edit as you please, and have fun.
10
+ *
11
+ * @author Marc Morera <[email protected] >
12
+ * @author PuntMig Technologies
13
+ */
14
+
15
+ declare (strict_types=1 );
16
+
17
+ namespace Apisearch \Event ;
18
+
19
+ /**
20
+ * Class EventRepositoryBucket.
21
+ */
22
+ class EventRepositoryBucket
23
+ {
24
+ /**
25
+ * @var EventRepository[]
26
+ *
27
+ * Repositories
28
+ */
29
+ private $ repositories = [];
30
+
31
+ /**
32
+ * Add repository.
33
+ *
34
+ * @param string $name
35
+ * @param EventRepository $repository
36
+ */
37
+ public function addRepository (
38
+ string $ name ,
39
+ EventRepository $ repository
40
+ ) {
41
+ $ this ->repositories [$ name ] = $ repository ;
42
+ }
43
+
44
+ /**
45
+ * Get repository by name and index.
46
+ *
47
+ * @param string $name
48
+ *
49
+ * @return EventRepository|null
50
+ */
51
+ public function findRepository (string $ name ): ? EventRepository
52
+ {
53
+ return isset ($ this ->repositories [$ name ])
54
+ ? $ this ->repositories [$ name ]
55
+ : null ;
56
+ }
57
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Apisearch PHP Client.
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ *
9
+ * Feel free to edit as you please, and have fun.
10
+ *
11
+ * @author Marc Morera <[email protected] >
12
+ * @author PuntMig Technologies
13
+ */
14
+
15
+ declare (strict_types=1 );
16
+
17
+ namespace Apisearch \Log ;
18
+
19
+ /**
20
+ * Class LogRepositoryBucket.
21
+ */
22
+ class LogRepositoryBucket
23
+ {
24
+ /**
25
+ * @var LogRepository[]
26
+ *
27
+ * Repositories
28
+ */
29
+ private $ repositories = [];
30
+
31
+ /**
32
+ * Add repository.
33
+ *
34
+ * @param string $name
35
+ * @param LogRepository $repository
36
+ */
37
+ public function addRepository (
38
+ string $ name ,
39
+ LogRepository $ repository
40
+ ) {
41
+ $ this ->repositories [$ name ] = $ repository ;
42
+ }
43
+
44
+ /**
45
+ * Get repository by name and index.
46
+ *
47
+ * @param string $name
48
+ *
49
+ * @return LogRepository|null
50
+ */
51
+ public function findRepository (string $ name ): ? LogRepository
52
+ {
53
+ return isset ($ this ->repositories [$ name ])
54
+ ? $ this ->repositories [$ name ]
55
+ : null ;
56
+ }
57
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Apisearch PHP Client.
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ *
9
+ * Feel free to edit as you please, and have fun.
10
+ *
11
+ * @author Marc Morera <[email protected] >
12
+ * @author PuntMig Technologies
13
+ */
14
+
15
+ declare (strict_types=1 );
16
+
17
+ namespace Apisearch \User ;
18
+
19
+ /**
20
+ * Class UserRepositoryBucket.
21
+ */
22
+ class UserRepositoryBucket
23
+ {
24
+ /**
25
+ * @var UserRepository[]
26
+ *
27
+ * Repositories
28
+ */
29
+ private $ repositories = [];
30
+
31
+ /**
32
+ * Add repository.
33
+ *
34
+ * @param string $name
35
+ * @param UserRepository $repository
36
+ */
37
+ public function addRepository (
38
+ string $ name ,
39
+ UserRepository $ repository
40
+ ) {
41
+ $ this ->repositories [$ name ] = $ repository ;
42
+ }
43
+
44
+ /**
45
+ * Get repository by name and index.
46
+ *
47
+ * @param string $name
48
+ *
49
+ * @return UserRepository|null
50
+ */
51
+ public function findRepository (string $ name ): ? UserRepository
52
+ {
53
+ return isset ($ this ->repositories [$ name ])
54
+ ? $ this ->repositories [$ name ]
55
+ : null ;
56
+ }
57
+ }
You can’t perform that action at this time.
0 commit comments