Skip to content

Commit 1a2b851

Browse files
authored
Fixes PHPCS issues (#262)
1 parent 8c02a94 commit 1a2b851

File tree

9 files changed

+15
-22
lines changed

9 files changed

+15
-22
lines changed

modules/apigee_graphql_doc/src/Controller/ApigeeGraphqlServerController.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
use Drupal\file\Entity\File;
3030
use Drupal\node\NodeInterface;
3131
use GraphQL\GraphQL;
32-
use GraphQL\Type\Definition\ObjectType;
33-
use GraphQL\Type\Definition\Type;
34-
use GraphQL\Type\Schema;
3532
use GraphQL\Utils\BuildSchema;
3633
use Symfony\Component\HttpFoundation\JsonResponse;
3734

@@ -55,7 +52,7 @@ public function build(NodeInterface $node) {
5552
$field_graphql_spec = $node->get('field_graphql_spec');
5653

5754
if ($field_graphql_spec && $field_graphql_spec->target_id) {
58-
/* @var \Drupal\file\Entity\File $file */
55+
/** @var \Drupal\file\Entity\File $file */
5956
$file = File::load($field_graphql_spec->target_id);
6057

6158
if ($file) {

modules/apigee_graphql_doc/src/Plugin/Field/FieldFormatter/GraphiqlFormatter.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ private function attachLibraries(array $element, array $graphql_urls) {
9292
'apigeeGraphqlDocFormatter' => [
9393
$this->fieldDefinition->getName() => [
9494
'graphqlUrls' => $graphql_urls,
95-
]
96-
]
97-
]
95+
],
96+
],
97+
],
9898
];
9999
}
100100
return $element;

src/Entity/Form/ApiDocReimportSpecForm.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
namespace Drupal\apigee_api_catalog\Entity\Form;
2121

22-
use Drupal\apigee_api_catalog\SpecFetcherInterface;
2322
use Drupal\Component\Datetime\TimeInterface;
2423
use Drupal\Core\Access\AccessResult;
2524
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
@@ -30,6 +29,7 @@
3029
use Drupal\Core\Routing\RouteMatchInterface;
3130
use Drupal\Core\Session\AccountInterface;
3231
use Drupal\Core\Url;
32+
use Drupal\apigee_api_catalog\SpecFetcherInterface;
3333
use Symfony\Component\DependencyInjection\ContainerInterface;
3434

3535
/**
@@ -135,7 +135,7 @@ public function getDescription() {
135135
* {@inheritdoc}
136136
*/
137137
public function submitForm(array &$form, FormStateInterface $form_state) {
138-
/* @var \Drupal\node\NodeInterface $entity */
138+
/** @var \Drupal\node\NodeInterface $entity */
139139
$entity = $this->getEntity();
140140

141141
if ($entity->get('field_apidoc_spec_file_source')->value != SpecFetcherInterface::SPEC_AS_URL) {

src/Plugin/Field/FieldFormatter/SmartDocsFormatter.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919

2020
namespace Drupal\apigee_api_catalog\Plugin\Field\FieldFormatter;
2121

22-
use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
23-
use Drupal\Component\Serialization\Json;
2422
use Drupal\Core\Field\FieldDefinitionInterface;
2523
use Drupal\Core\Field\FieldItemListInterface;
2624
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
2725
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
28-
use Drupal\Core\Serialization\Yaml;
2926
use Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase;
3027
use Symfony\Component\DependencyInjection\ContainerInterface;
3128

@@ -133,7 +130,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
133130
'library' => [
134131
'apigee_api_catalog/js_yaml',
135132
'apigee_api_catalog/smartdocs_integration',
136-
'apigee_api_catalog/smartdocs'
133+
'apigee_api_catalog/smartdocs',
137134
],
138135
];
139136

src/Plugin/Validation/Constraint/ApiDocFileLinkConstraintValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function validate($items, Constraint $constraint) {
8888
];
8989

9090
// Perform only a HEAD method to save bandwidth.
91-
/* @var $response \Psr\Http\Message\ResponseInterface */
91+
/** @var \Psr\Http\Message\ResponseInterface $response */
9292
$response = $this->httpClient->head($url, $options);
9393
}
9494
catch (RequestException $request_exception) {

src/SpecFetcher.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
use GuzzleHttp\ClientInterface;
3333
use GuzzleHttp\Exception\GuzzleException;
3434
use GuzzleHttp\Psr7\Request;
35-
use Psr\Log\LoggerInterface;
3635
use Psr\Log\LogLevel;
36+
use Psr\Log\LoggerInterface;
3737

3838
/**
3939
* Class SpecFetcher.
@@ -108,7 +108,7 @@ public function fetchSpec(NodeInterface $apidoc): string {
108108
if ($apidoc->get('field_apidoc_spec_file_source')->value === static::SPEC_AS_URL) {
109109

110110
// If the file_link field is empty, return without changes.
111-
// TODO: The file link shouldn't be empty. Consider throwing an error.
111+
// @todo The file link shouldn't be empty. Consider throwing an error.
112112
if ($apidoc->get('field_apidoc_file_link')->isEmpty()) {
113113
return FALSE;
114114
}

src/UpdateService.php

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface;
2929
use Drupal\Core\Entity\EntityTypeManagerInterface;
3030
use Drupal\Core\Extension\ModuleHandlerInterface;
31-
use Drupal\Core\Field\BaseFieldDefinition;
3231
use Drupal\Core\Utility\UpdateException;
3332
use Drupal\field\Entity\FieldConfig;
3433
use Drupal\field\Entity\FieldStorageConfig;

tests/src/Functional/ApiDocsAdminTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
use Drupal\Component\Render\FormattableMarkup;
2424
use Drupal\Core\Url;
25-
use Drupal\file\Entity\File;
26-
use Drupal\file\FileInterface;
2725
use Drupal\Tests\BrowserTestBase;
2826
use Drupal\Tests\TestFileCreationTrait;
27+
use Drupal\file\Entity\File;
28+
use Drupal\file\FileInterface;
2929

3030
/**
3131
* Simple test to ensure that main page loads with module enabled.
@@ -50,7 +50,7 @@ class ApiDocsAdminTest extends BrowserTestBase {
5050
'views',
5151
'apigee_api_catalog',
5252
'block',
53-
'field_ui'
53+
'field_ui',
5454
];
5555

5656
/**
@@ -144,7 +144,7 @@ public function testApiDocAdministration() {
144144
$assert->pageTextContains(new FormattableMarkup(
145145
'OpenAPI Doc @name has been created.',
146146
[
147-
'@name' => $random_name
147+
'@name' => $random_name,
148148
]
149149
)
150150
);

tests/src/Kernel/ApidocEntityTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function testEntity() {
114114
* Test revisioning functionality on an apidocs entity.
115115
*/
116116
public function testRevisions() {
117-
/* @var \Drupal\node\NodeInterface $entity */
117+
/** @var \Drupal\node\NodeInterface $entity */
118118

119119
$description_v1 = 'Test API';
120120
$entity = $this->nodeStorage->create([

0 commit comments

Comments
 (0)