1 | <?php |
||
2 | /** |
||
3 | * Created by PhpStorm. |
||
4 | * User: 5729906803 |
||
5 | * Date: 9/13/2020 |
||
6 | * Time: 1:04 PM |
||
7 | */ |
||
8 | |||
9 | namespace Hsy\SimotelConnect; |
||
10 | |||
11 | |||
12 | class SmartApi |
||
13 | { |
||
14 | public function callApi($apiData) |
||
15 | { |
||
16 | $appName = $apiData['app_name']; |
||
17 | $apiMethodsRepositoryClassPath = config("simotel.smartApi.methodsRepositoryClass"); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
18 | $apiMethodsRepository = new $apiMethodsRepositoryClassPath; |
||
19 | if (!method_exists($apiMethodsRepository, $appName)) |
||
20 | return false; |
||
21 | |||
22 | $apiResponse = $apiMethodsRepository->$appName($apiData); |
||
23 | if (!is_array($apiResponse)) |
||
24 | return false; |
||
25 | |||
26 | return $apiResponse; |
||
27 | |||
28 | } |
||
29 | } |
||
30 |