mingyoung /
easywechat-composer
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | /* |
||||
| 6 | * This file is part of the EasyWeChatComposer. |
||||
| 7 | * |
||||
| 8 | * (c) 张铭阳 <[email protected]> |
||||
| 9 | * |
||||
| 10 | * This source file is subject to the MIT license that is bundled |
||||
| 11 | * with this source code in the file LICENSE. |
||||
| 12 | */ |
||||
| 13 | |||||
| 14 | namespace EasyWeChatComposer\Laravel\Http\Controllers; |
||||
| 15 | |||||
| 16 | use EasyWeChatComposer\Delegation\Hydrate; |
||||
| 17 | use EasyWeChatComposer\Encryption\DefaultEncrypter; |
||||
| 18 | use Illuminate\Http\Request; |
||||
|
0 ignored issues
–
show
|
|||||
| 19 | use Throwable; |
||||
| 20 | |||||
| 21 | class DelegatesController |
||||
| 22 | { |
||||
| 23 | /** |
||||
| 24 | * @param \Illuminate\Http\Request $request |
||||
| 25 | * @param \EasyWeChatComposer\Encryption\DefaultEncrypter $encrypter |
||||
| 26 | * |
||||
| 27 | * @return \Illuminate\Http\Response |
||||
|
0 ignored issues
–
show
The type
Illuminate\Http\Response was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 28 | */ |
||||
| 29 | public function __invoke(Request $request, DefaultEncrypter $encrypter) |
||||
| 30 | { |
||||
| 31 | try { |
||||
| 32 | $data = json_decode($encrypter->decrypt($request->get('encrypted')), true); |
||||
| 33 | |||||
| 34 | $hydrate = new Hydrate($data); |
||||
| 35 | |||||
| 36 | $response = $hydrate->handle(); |
||||
| 37 | |||||
| 38 | return response()->json([ |
||||
|
0 ignored issues
–
show
The function
response 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
Loading history...
|
|||||
| 39 | 'response_type' => get_class($response), |
||||
|
0 ignored issues
–
show
$response of type array is incompatible with the type object expected by parameter $object of get_class().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 40 | 'response' => $encrypter->encrypt($response->getBodyContents()), |
||||
| 41 | ]); |
||||
| 42 | } catch (Throwable $t) { |
||||
| 43 | return [ |
||||
|
0 ignored issues
–
show
|
|||||
| 44 | 'exception' => get_class($t), |
||||
| 45 | 'message' => $t->getMessage(), |
||||
| 46 | ]; |
||||
| 47 | } |
||||
| 48 | } |
||||
| 49 | } |
||||
| 50 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths