1 | <?php |
||
14 | class WordpressApi |
||
15 | { |
||
16 | /** |
||
17 | * Base URI. |
||
18 | * |
||
19 | * The base URI for the API. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $base_uri = 'https://api.wordpress.org/'; |
||
24 | |||
25 | /** |
||
26 | * @var Client |
||
27 | */ |
||
28 | private $client; |
||
29 | |||
30 | 7 | public function __construct() |
|
36 | |||
37 | /** |
||
38 | * @return Core |
||
39 | */ |
||
40 | 3 | public static function core(): Core |
|
41 | { |
||
42 | 3 | return new Core(); |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return Plugin |
||
47 | */ |
||
48 | 1 | public static function plugin(): Plugin |
|
49 | { |
||
50 | 1 | return new Plugin(); |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return Secret |
||
55 | */ |
||
56 | public static function secret(): Secret |
||
60 | |||
61 | /** |
||
62 | * @return Stats |
||
63 | */ |
||
64 | public static function stats(): Stats |
||
68 | |||
69 | /** |
||
70 | * @return Theme |
||
71 | */ |
||
72 | public static function theme(): Theme |
||
76 | |||
77 | /** |
||
78 | * @return Translation |
||
79 | */ |
||
80 | public static function translation(): Translation |
||
84 | |||
85 | /** |
||
86 | * @param null $endpoint |
||
87 | * @param bool $json_decode |
||
88 | * @return mixed |
||
89 | * @throws GuzzleException |
||
90 | */ |
||
91 | 5 | protected function get($endpoint = null, $json_decode = true) |
|
100 | } |
||
101 |