Skip to content

Commit 48b7e83

Browse files
authored
Fixes PHPCS issues for phpstan v12.4 (#1085)
1 parent 34bef3f commit 48b7e83

File tree

254 files changed

+523
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+523
-560
lines changed

modules/apigee_edge_actions/apigee_edge_actions.tokens.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
*/
2525

2626

27-
use Drupal\apigee_edge\Entity\EdgeEntityInterface;
2827
use Drupal\Component\Utility\Html;
2928
use Drupal\Core\Render\BubbleableMetadata;
29+
use Drupal\apigee_edge\Entity\EdgeEntityInterface;
3030

3131
/**
3232
* Implements hook_token_info_alter().
@@ -79,7 +79,7 @@ function apigee_edge_actions_tokens($type, $tokens, array $data, array $options,
7979
$replacements = [];
8080

8181
if ($type == 'entity' && !empty($data['entity_type']) && !empty($data['entity']) && !empty($data['token_type'])) {
82-
/* @var \Drupal\Core\Entity\ContentEntityInterface $entity */
82+
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
8383
$entity = $data['entity'];
8484

8585
if ($entity instanceof EdgeEntityInterface) {

modules/apigee_edge_actions/modules/apigee_edge_actions_debug/src/EventSubscriber/ApigeeEdgeActionsDebugEventSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
namespace Drupal\apigee_edge_actions_debug\EventSubscriber;
2222

23+
use Drupal\Core\Logger\LoggerChannelInterface;
2324
use Drupal\apigee_edge_actions\Event\ApigeeEdgeActionsEventInterface;
2425
use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge;
25-
use Drupal\Core\Logger\LoggerChannelInterface;
2626
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2727

2828
/**

modules/apigee_edge_actions/src/ApigeeActionsEntityTypeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
namespace Drupal\apigee_edge_actions;
2222

23-
use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface;
2423
use Drupal\Core\Entity\EntityTypeInterface;
2524
use Drupal\Core\Entity\EntityTypeManagerInterface;
25+
use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface;
2626

2727
/**
2828
* Defines the apigee_edge_actions.edge_entity_type_manager service.

modules/apigee_edge_actions/src/Event/EdgeEntityEventBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* Base class for Edge events.
2727
*
28-
* TODO: Rules does not support non GenericEvent context.
28+
* @todo Rules does not support non GenericEvent context.
2929
*/
3030
abstract class EdgeEntityEventBase extends GenericEvent {
3131

modules/apigee_edge_actions/src/EventSubscriber/AppCredentialEventSubscriber.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
namespace Drupal\apigee_edge_actions\EventSubscriber;
2222

23-
use Drupal\apigee_edge\Entity\AppInterface;
24-
use Drupal\apigee_edge\Event\AppCredentialAddApiProductEvent;
25-
use Drupal\apigee_edge\Event\AppCredentialDeleteApiProductEvent;
26-
use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge;
2723
use Drupal\Component\Plugin\Exception\PluginException;
2824
use Drupal\Core\Entity\EntityTypeManagerInterface;
2925
use Drupal\Core\Logger\LoggerChannelInterface;
3026
use Drupal\Core\Session\AccountInterface;
27+
use Drupal\apigee_edge\Entity\AppInterface;
28+
use Drupal\apigee_edge\Event\AppCredentialAddApiProductEvent;
29+
use Drupal\apigee_edge\Event\AppCredentialDeleteApiProductEvent;
30+
use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge;
3131
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
3232
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
3333
use Symfony\Contracts\EventDispatcher\Event;
@@ -177,17 +177,17 @@ protected function dispatchRulesEvent(string $rules_event_name, Event $event, ar
177177
* The app with the provided name or null.
178178
*/
179179
protected function getAppByName(string $name, string $owner_id, string $app_type): ?AppInterface {
180-
/* @var \Drupal\apigee_edge\Entity\AppInterface $appClass */
180+
/** @var \Drupal\apigee_edge\Entity\AppInterface $appClass */
181181
$appClass = $this->entityTypeManger->getStorage("{$app_type}_app")->getEntityType()->getClass();
182182

183183
try {
184184
if ($app_type == 'developer') {
185-
/* @var \Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactoryInterface $controller */
185+
/** @var \Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactoryInterface $controller */
186186
$controller = \Drupal::service('apigee_edge.controller.developer_app_controller_factory');
187187
$edge_app = $controller->developerAppController($owner_id)->load($name);
188188
}
189189
else {
190-
/* @var \Drupal\apigee_edge_teams\Entity\Controller\TeamAppControllerFactory $controller */
190+
/** @var \Drupal\apigee_edge_teams\Entity\Controller\TeamAppControllerFactory $controller */
191191
$controller = \Drupal::service('apigee_edge_teams.controller.team_app_controller_factory');
192192
$edge_app = $controller->teamAppController($owner_id)->load($name);
193193
}

modules/apigee_edge_actions/src/Plugin/RulesAction/LogMessage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
namespace Drupal\apigee_edge_actions\Plugin\RulesAction;
2222

23-
use Drupal\Core\Annotation\ContextDefinition;
2423
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
25-
use Drupal\rules\Core\Annotation\RulesAction;
2624
use Drupal\rules\Core\RulesActionBase;
2725
use Psr\Log\LoggerInterface;
2826
use Symfony\Component\DependencyInjection\ContainerInterface;

modules/apigee_edge_actions/src/Plugin/RulesAction/SystemEmailToUsersOfRole.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static function create(ContainerInterface $container, array $configuratio
8181
/**
8282
* {@inheritdoc}
8383
*/
84-
protected function doExecute(array $roles, $subject, $message, $reply = NULL, LanguageInterface $language = NULL) {
84+
protected function doExecute(array $roles, $subject, $message, $reply = NULL, ?LanguageInterface $language = NULL) {
8585
// SystemMailToUsersOfRole::doExecute() expects an array of RoleInterface.
8686
// Upcast is done in RulesActionBase.
8787
parent::doExecute($roles, $subject, $message, $reply, $language);

modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
namespace Drupal\apigee_edge_actions\Plugin\RulesEvent;
2222

23+
use Drupal\Component\Plugin\Derivative\DeriverBase;
24+
use Drupal\Core\StringTranslation\StringTranslationTrait;
2325
use Drupal\apigee_edge\Entity\AppInterface;
2426
use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface;
2527
use Drupal\apigee_edge_actions\ApigeeActionsEntityTypeHelperInterface;
2628
use Drupal\apigee_edge_teams\Entity\TeamAppInterface;
27-
use Drupal\Component\Plugin\Derivative\DeriverBase;
28-
use Drupal\Core\StringTranslation\StringTranslationTrait;
2929
use Symfony\Component\DependencyInjection\ContainerInterface;
3030

3131
/**

modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
namespace Drupal\apigee_edge_actions\Plugin\RulesEvent;
2222

23-
use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface;
2423
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
24+
use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface;
2525

2626
/**
2727
* Provides an interface for Apigee Edge entity event deriver.

modules/apigee_edge_actions/src/TeamMembershipManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
namespace Drupal\apigee_edge_actions;
2222

23+
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
24+
use Drupal\Core\Entity\EntityTypeManagerInterface;
2325
use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface;
2426
use Drupal\apigee_edge\Entity\DeveloperCompaniesCacheInterface;
2527
use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge;
2628
use Drupal\apigee_edge_teams\CompanyMembersControllerFactoryInterface;
2729
use Drupal\apigee_edge_teams\TeamMembershipManagerInterface;
28-
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
29-
use Drupal\Core\Entity\EntityTypeManagerInterface;
3030
use Drupal\user\UserInterface;
3131
use Psr\Log\LoggerInterface;
3232
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -151,7 +151,7 @@ public function removeMembers(string $team, array $developers): void {
151151
/**
152152
* {@inheritdoc}
153153
*/
154-
public function getTeams(string $developer, string $team = NULL): array {
154+
public function getTeams(string $developer, ?string $team = NULL): array {
155155
return $this->inner->getTeams($developer, $team);
156156
}
157157

0 commit comments

Comments
 (0)