Issues (17)

src/SmartApi.php (1 issue)

Labels
Severity
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
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
        $apiMethodsRepositoryClassPath = /** @scrutinizer ignore-call */ config("simotel.smartApi.methodsRepositoryClass");
Loading history...
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