milkmeowo /
laravel-queue-aliyun-mns
| 1 | <?php |
||
| 2 | |||
| 3 | /* |
||
| 4 | * Laravel-Mns -- 阿里云消息队列(MNS)的 Laravel 适配。 |
||
| 5 | * |
||
| 6 | * This file is part of the milkmeowo/laravel-mns. |
||
| 7 | * |
||
| 8 | * (c) Milkmeowo <[email protected]> |
||
| 9 | * @link: https://github.com/milkmeowo/laravel-queue-aliyun-mns |
||
| 10 | * |
||
| 11 | * This source file is subject to the MIT license that is bundled |
||
| 12 | * with this source code in the file LICENSE. |
||
| 13 | */ |
||
| 14 | |||
| 15 | namespace Milkmeowo\LaravelMns\Connectors; |
||
| 16 | |||
| 17 | use AliyunMNS\Client as MnsClient; |
||
| 18 | use Milkmeowo\LaravelMns\MnsQueue; |
||
| 19 | use Milkmeowo\LaravelMns\Adaptors\MnsAdapter; |
||
| 20 | use Illuminate\Queue\Connectors\ConnectorInterface; |
||
|
0 ignored issues
–
show
|
|||
| 21 | |||
| 22 | class MnsConnector implements ConnectorInterface |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * 接口方法,连接器. |
||
| 26 | * |
||
| 27 | * @param array $config |
||
| 28 | * |
||
| 29 | * @return \Illuminate\Contracts\Queue\Queue|MnsQueue |
||
|
0 ignored issues
–
show
The type
Illuminate\Contracts\Queue\Queue 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...
|
|||
| 30 | */ |
||
| 31 | public function connect(array $config) |
||
| 32 | { |
||
| 33 | $adapter = $this->getAdapter($config); |
||
| 34 | |||
| 35 | return new MnsQueue($adapter, $config['wait_seconds']); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Mns 适配器. |
||
| 40 | * |
||
| 41 | * @param array $config |
||
| 42 | * |
||
| 43 | * @return MnsAdapter |
||
| 44 | */ |
||
| 45 | public function getAdapter(array $config) |
||
| 46 | { |
||
| 47 | $client = $this->getClient($config); |
||
| 48 | |||
| 49 | return new MnsAdapter($client, $config['queue']); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Mns Client. |
||
| 54 | * |
||
| 55 | * @param array $config |
||
| 56 | * |
||
| 57 | * @return MnsClient |
||
| 58 | */ |
||
| 59 | public function getClient(array $config) |
||
| 60 | { |
||
| 61 | return new MnsClient($config['endpoint'], $config['key'], $config['secret']); |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
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