We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 4 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.
There are several approaches to avoid long parameter lists:
1 | <?php |
||
21 | 84 | public function execute( |
|
22 | Schema $schema, |
||
23 | string $requestString, |
||
24 | $rootValue = null, |
||
25 | $contextValue = null, |
||
26 | $variableValues = null, |
||
27 | $operationName = null, |
||
28 | ?callable $fieldResolver = null, |
||
29 | ?array $validationRules = null |
||
30 | ): ExecutionResult { |
||
31 | 84 | if ($this->promiseAdapter && !$this->promiseAdapter instanceof PromiseAdapterInterface && !\is_callable([$this->promiseAdapter, 'wait'])) { |
|
32 | 1 | throw new \RuntimeException( |
|
33 | 1 | \sprintf( |
|
34 | 1 | 'PromiseAdapter should be an object instantiating "%s" or "%s" with a "wait" method.', |
|
35 | 1 | PromiseAdapterInterface::class, |
|
36 | 1 | PromiseAdapter::class |
|
37 | ) |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | 83 | return $this->promiseAdapter->wait(GraphQL::promiseToExecute($this->promiseAdapter, ...\func_get_args())); |
|
|
|||
42 | } |
||
49 |