Skip to content

Commit 0c36694

Browse files
authored
tests(phpcs): Fix doc comment, spacing and default value rules (#1069)
1 parent 68d9765 commit 0c36694

24 files changed

Lines changed: 25 additions & 41 deletions

examples/graphql_example/src/Plugin/GraphQL/DataProducer/QueryArticles.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public static function create(ContainerInterface $container, array $configuratio
6262
* The plugin id.
6363
* @param mixed $pluginDefinition
6464
* The plugin definition.
65-
*
6665
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityManager
6766
*
6867
* @codeCoverageIgnore

phpcs.xml.dist

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77

88
<rule ref="Drupal">
99
<!-- TODO: those rules are disabled for now until we fix the coding standards for them. -->
10-
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace"/>
11-
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.SpaceBeforeBrace"/>
12-
<exclude name="PEAR.Functions.ValidDefaultValue.NotAtEnd"/>
13-
<exclude name="PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter"/>
14-
<exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/>
15-
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeComma"/>
16-
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction"/>
17-
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.SpaceBeforeBrace"/>
1810
<exclude name="Drupal.Arrays.Array.CommaLastItem"/>
1911
<exclude name="Drupal.Arrays.Array.LongLineDeclaration"/>
2012
<exclude name="Drupal.Arrays.DisallowLongArraySyntax.Found"/>
@@ -23,11 +15,7 @@
2315
<exclude name="Drupal.Classes.PropertyDeclaration.ScopeMissing"/>
2416
<exclude name="Drupal.Classes.UnusedUseStatement.UnusedUse"/>
2517
<exclude name="Drupal.Commenting.ClassComment.Missing"/>
26-
<exclude name="Drupal.Commenting.DataTypeNamespace.DataTypeNamespace"/>
2718
<exclude name="Drupal.Commenting.DocComment.MissingShort"/>
28-
<exclude name="Drupal.Commenting.DocComment.ParamGroup"/>
29-
<exclude name="Drupal.Commenting.DocComment.ShortFullStop"/>
30-
<exclude name="Drupal.Commenting.DocComment.SpacingAfter"/>
3119
<exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
3220
<exclude name="Drupal.Commenting.FunctionComment.MissingParamType"/>
3321
<exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/>

src/Annotation/PersistedQuery.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Drupal\graphql\Annotation;
44

5-
65
use Doctrine\Common\Annotations\AnnotationException;
76
use Drupal\Component\Annotation\Plugin;
87

src/Controller/ServerListBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Drupal\Core\Url;
88

99
/**
10-
* Class ServerListBuilder
10+
* Class ServerListBuilder.
1111
*
1212
* @package Drupal\graphql\Controller
1313
*

src/Entity/ServerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function executeOperation(OperationParams $operation);
2323
public function executeBatch(array $operations);
2424

2525
/**
26-
* Retrieves the server configuration
26+
* Retrieves the server configuration.
2727
*
2828
* @return \GraphQL\Server\ServerConfig
2929
* The server configuration.
@@ -33,7 +33,7 @@ public function configuration();
3333
/**
3434
* Adds a Persisted Query plugin instance to the persisted queries set.
3535
*
36-
* @param PersistedQueryPluginInterface $queryPlugin
36+
* @param \Drupal\graphql\Plugin\PersistedQueryPluginInterface $queryPlugin
3737
*/
3838
public function addPersistedQueryInstance(PersistedQueryPluginInterface $queryPlugin);
3939

src/Form/PersistedQueriesForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class PersistedQueriesForm extends EntityForm {
1515

1616
/**
17-
* @var PersistedQueryPluginManager
17+
* @var \Drupal\graphql\Plugin\PersistedQueryPluginManager
1818
*/
1919
protected $persistedQueryPluginManager;
2020

@@ -183,7 +183,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
183183
/**
184184
* Returns an array with all the available persisted query plugins.
185185
*
186-
* @return PersistedQueryPluginInterface[]
186+
* @return \Drupal\graphql\Plugin\PersistedQueryPluginInterface[]
187187
*/
188188
protected function getAllPersistedQueryPlugins() {
189189
$plugins = [];

src/GraphQL/Execution/Executor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ protected function doExecuteUncached() {
251251
$event = new OperationEvent($this->context);
252252
$this->dispatcher->dispatch(OperationEvent::GRAPHQL_OPERATION_BEFORE, $event);
253253

254-
return $executor->doExecute()->then(function ($result) {
254+
return $executor->doExecute()->then(function ($result) {
255255
$event = new OperationEvent($this->context, $result);
256256
$this->dispatcher->dispatch(OperationEvent::GRAPHQL_OPERATION_AFTER, $event);
257257

src/GraphQL/ResolverBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function compose(ResolverInterface ...$resolvers) {
4343
}
4444

4545
/**
46-
* @param ResolverInterface $callback
46+
* @param \Drupal\graphql\GraphQL\Resolver\ResolverInterface $callback
4747
*
4848
* @return \Drupal\graphql\GraphQL\Resolver\Tap
4949
*/
@@ -52,7 +52,7 @@ public function tap(ResolverInterface $callback) {
5252
}
5353

5454
/**
55-
* @param ResolverInterface $callback
55+
* @param \Drupal\graphql\GraphQL\Resolver\ResolverInterface $callback
5656
*
5757
* @return \Drupal\graphql\GraphQL\Resolver\Map
5858
*/

src/GraphQL/Utility/Introspection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class Introspection {
1616
*
1717
* @return array
1818
* The introspection result as an array.
19-
*
2019
*/
2120
public function introspect(ServerInterface $server) {
2221
$operation = new OperationParams();

src/GraphQL/Utility/JsonHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class JsonHelper {
1414
* The decoded values.
1515
*/
1616
public static function decodeParams(array $values = []) {
17-
return array_map(function($value) {
17+
return array_map(function ($value) {
1818
if (!is_string($value)) {
1919
return $value;
2020
}

0 commit comments

Comments
 (0)