1 | <?php |
||||
2 | |||||
3 | namespace TheCaliskan\TDK; |
||||
4 | |||||
5 | use Illuminate\Http\Client\Response; |
||||
6 | use Illuminate\Support\ServiceProvider; |
||||
7 | |||||
8 | class TDKServiceProvider extends ServiceProvider |
||||
9 | { |
||||
10 | /** |
||||
11 | * Register any application services. |
||||
12 | * |
||||
13 | * @return void |
||||
14 | */ |
||||
15 | public function register() |
||||
16 | { |
||||
17 | } |
||||
18 | |||||
19 | /** |
||||
20 | * Bootstrap any application services. |
||||
21 | * |
||||
22 | * @return void |
||||
23 | */ |
||||
24 | public function boot() |
||||
25 | { |
||||
26 | Response::macro('tdkThrow', function () { |
||||
27 | $this->throw(); |
||||
0 ignored issues
–
show
|
|||||
28 | |||||
29 | if (isset($this->json()['error'])) { |
||||
0 ignored issues
–
show
The method
json() does not exist on TheCaliskan\TDK\TDKServiceProvider .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
30 | throw new TDKException($this); |
||||
0 ignored issues
–
show
$this of type TheCaliskan\TDK\TDKServiceProvider is incompatible with the type Illuminate\Http\Client\Response expected by parameter $response of TheCaliskan\TDK\TDKException::__construct() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
31 | } |
||||
32 | |||||
33 | return $this; |
||||
34 | }); |
||||
35 | |||||
36 | $this->app->singleton('thecaliskan-tdk', function ($app) { |
||||
37 | return new TDK($app); |
||||
38 | }); |
||||
39 | } |
||||
40 | |||||
41 | /** |
||||
42 | * Get the services provided by the provider. |
||||
43 | * |
||||
44 | * @return array |
||||
45 | */ |
||||
46 | public function provides() |
||||
47 | { |
||||
48 | return [ |
||||
49 | 'thecaliskan-tdk', |
||||
50 | ]; |
||||
51 | } |
||||
52 | } |
||||
53 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.