1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Drupal\graphql\Plugin\GraphQL\Subscriptions; |
4
|
|
|
|
5
|
|
|
use Drupal\Component\Plugin\PluginBase; |
|
|
|
|
6
|
|
|
use Drupal\graphql\Plugin\SubscriptionPluginInterface; |
7
|
|
|
use Drupal\graphql\Plugin\SubscriptionPluginManager; |
8
|
|
|
use Drupal\graphql\Plugin\GraphQL\Traits\ArgumentAwarePluginTrait; |
9
|
|
|
use Drupal\graphql\Plugin\GraphQL\Traits\DeprecatablePluginTrait; |
10
|
|
|
use Drupal\graphql\Plugin\GraphQL\Traits\DescribablePluginTrait; |
11
|
|
|
use Drupal\graphql\Plugin\GraphQL\Traits\TypedPluginTrait; |
12
|
|
|
use Drupal\graphql\Plugin\SchemaBuilderInterface; |
13
|
|
|
|
14
|
|
|
abstract class SubscriptionPluginBase extends PluginBase implements SubscriptionPluginInterface { |
15
|
|
|
use TypedPluginTrait; |
16
|
|
|
use DescribablePluginTrait; |
17
|
|
|
use ArgumentAwarePluginTrait; |
18
|
|
|
use DeprecatablePluginTrait; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* {@inheritdoc} |
22
|
|
|
*/ |
23
|
|
|
public static function createInstance(SchemaBuilderInterface $builder, SubscriptionPluginManager $manager, $definition, $id) { |
24
|
|
|
return [ |
25
|
|
|
'description' => $definition['description'], |
26
|
|
|
'deprecationReason' => $definition['deprecationReason'], |
27
|
|
|
'type' => $builder->processType($definition['type']), |
28
|
|
|
'args' => $builder->processArguments($definition['args']), |
29
|
|
|
'resolve' => function ($value, $args, $context, $info) use ($manager, $id) { |
30
|
|
|
$instance = $manager->getInstance(['id' => $id]); |
31
|
|
|
return call_user_func_array([$instance, 'resolve'], [$value, $args, $context, $info]); |
32
|
|
|
}, |
33
|
|
|
]; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* {@inheritdoc} |
38
|
|
|
*/ |
39
|
|
|
public function getDefinition() { |
40
|
|
|
$definition = $this->getPluginDefinition(); |
41
|
|
|
|
42
|
|
|
return [ |
43
|
|
|
'type' => $this->buildType($definition), |
44
|
|
|
'description' => $this->buildDescription($definition), |
45
|
|
|
'args' => $this->buildArguments($definition), |
46
|
|
|
'deprecationReason' => $this->buildDeprecationReason($definition), |
|
|
|
|
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