From 48b7e83ea2ace2b7011755278e9c8a2cecb15913 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Tue, 1 Oct 2024 15:43:21 +0530 Subject: [PATCH] Fixes PHPCS issues for phpstan v12.4 (#1085) --- .../apigee_edge_actions.tokens.inc | 4 ++-- .../ApigeeEdgeActionsDebugEventSubscriber.php | 2 +- .../src/ApigeeActionsEntityTypeHelper.php | 2 +- .../src/Event/EdgeEntityEventBase.php | 2 +- .../AppCredentialEventSubscriber.php | 14 +++++------ .../src/Plugin/RulesAction/LogMessage.php | 2 -- .../RulesAction/SystemEmailToUsersOfRole.php | 2 +- .../RulesEvent/EdgeEntityEventDeriverBase.php | 4 ++-- .../EdgeEntityEventDeriverInterface.php | 2 +- .../src/TeamMembershipManager.php | 6 ++--- .../ApigeeEdgeActionsRulesKernelTestBase.php | 4 ++-- .../SystemEmailToUsersOfRoleTest.php | 2 +- .../EdgeEntityAddMemberEventTest.php | 2 +- .../EdgeEntityAddProductEventTest.php | 4 ++-- .../RulesEvent/EdgeEntityDeleteEventTest.php | 2 +- .../RulesEvent/EdgeEntityInsertEventTest.php | 2 +- .../EdgeEntityRemoveMemberEventTest.php | 2 +- .../EdgeEntityRemoveProductEventTest.php | 2 +- .../RulesEvent/EdgeEntityUpdateEventTest.php | 2 +- .../src/ApiProductController.php | 6 ++--- .../src/ApiProductStorage.php | 4 ++-- .../ApiProductRoleBasedAccessTestBase.php | 2 +- .../DebugMessageFormatterPluginManager.php | 4 ++-- .../apigee_edge_debug/src/Form/ConfigForm.php | 2 +- .../ApiClientProfiler.php | 4 ++-- .../DevelKintApiClientProfiler.php | 3 +-- .../apigee_edge_debug/src/SDKConnector.php | 4 ++-- .../src/Access/ManageTeamMembersAccess.php | 4 ++-- .../src/Access/TeamAppListByTeamAccess.php | 6 ++--- .../src/AppGroupMembersController.php | 3 --- .../src/AppGroupMembershipObjectCache.php | 2 +- .../src/Commands/ApigeeEdgeCommands.php | 3 +-- .../src/CompanyMembersController.php | 1 - .../src/CompanyMembershipObjectCache.php | 4 ++-- .../Controller/TeamMemberSyncController.php | 4 ++-- .../src/Controller/TeamMembersList.php | 14 +++++------ .../src/DefaultTeamPermissionsProvider.php | 2 +- .../src/Entity/AppGroupCache.php | 2 +- .../src/Entity/Controller/TeamController.php | 4 ++-- .../src/Entity/Form/TeamAppCreateForm.php | 2 +- .../src/Entity/Form/TeamAppCreateFormBase.php | 6 ++--- .../Entity/Form/TeamAppCreateFormForTeam.php | 4 ++-- .../src/Entity/Form/TeamAppEditForm.php | 10 ++++---- .../src/Entity/Form/TeamAppFormTrait.php | 6 ++--- .../src/Entity/Form/TeamForm.php | 14 +++++------ .../Entity/Form/TeamInvitationAcceptForm.php | 2 +- .../Entity/Form/TeamInvitationDeclineForm.php | 2 +- .../Entity/Form/TeamInvitationDeleteForm.php | 4 ++-- .../Entity/Form/TeamInvitationFormBase.php | 4 ++-- .../Entity/Form/TeamInvitationResendForm.php | 5 ++-- .../Entity/ListBuilder/TeamAppListByTeam.php | 6 ++--- .../Entity/ListBuilder/TeamListBuilder.php | 6 ++--- .../src/Entity/Storage/TeamAppStorage.php | 8 +++---- .../Entity/Storage/TeamInvitationStorage.php | 6 ++--- .../Entity/Storage/TeamMemberRoleStorage.php | 20 ++++++++-------- .../TeamMemberRoleStorageInterface.php | 4 ++-- .../src/Entity/Storage/TeamRoleStorage.php | 2 +- .../src/Entity/Storage/TeamStorage.php | 14 +++++------ modules/apigee_edge_teams/src/Entity/Team.php | 2 +- .../src/Entity/TeamAccessHandler.php | 4 ++-- .../apigee_edge_teams/src/Entity/TeamApp.php | 2 +- .../src/Entity/TeamAppAccessHandler.php | 6 ++--- .../src/Entity/TeamAppRouteProvider.php | 2 +- .../src/Entity/TeamInvitation.php | 3 +-- .../TeamInvitationAccessControlHandler.php | 2 +- .../Entity/TeamInvitationTitleProvider.php | 6 ++--- .../TeamInvitationTitleProviderInterface.php | 6 ++--- .../src/Entity/TeamMemberRole.php | 2 +- .../src/Entity/TeamRouteProvider.php | 2 +- .../src/Entity/TeamTitleProvider.php | 4 ++-- .../src/Entity/TeamViewBuilder.php | 4 ++-- ...AppFieldConfigListAlterEventSubscriber.php | 2 +- .../TeamInactiveStatusSubscriber.php | 4 ++-- .../TeamInvitationQueryAccessSubscriber.php | 2 +- .../TeamInvitationSubscriber.php | 10 ++++---- .../TeamStatusWarningSubscriber.php | 4 ++-- .../ValidateApigeeXTeamEnabledSubscriber.php | 4 ++-- .../src/Form/AddTeamMembersForm.php | 6 ++--- .../src/Form/EditTeamMemberForm.php | 6 ++--- .../src/Form/RemoveTeamMemberForm.php | 8 +++---- .../src/Form/TeamAliasForm.php | 2 +- .../src/Form/TeamAppApiKeyAddForm.php | 4 ++-- .../src/Form/TeamMemberSyncForm.php | 4 ++-- .../src/Form/TeamMembersFormBase.php | 2 +- .../src/Form/TeamPermissionsForm.php | 2 +- .../ParamConverter/TeamAppNameConverter.php | 2 +- .../Plugin/Block/TeamContextSwitcherBlock.php | 4 ++-- .../TeamMembersSelection.php | 6 ++--- .../Plugin/Menu/AddAppForTeamLocalAction.php | 2 +- .../src/Plugin/Menu/TeamAppsLocalTask.php | 2 +- .../Plugin/views/access/TeamPermission.php | 4 ++-- ...eamContextSwitcherRouteAlterSubscriber.php | 2 +- .../src/TeamInvitationNotifierEmail.php | 2 +- .../src/TeamMemberApiProductAccessHandler.php | 6 ++--- ...MemberApiProductAccessHandlerInterface.php | 4 ++-- .../src/TeamMembershipManager.php | 10 ++++---- .../src/TeamPermissionHandler.php | 8 +++---- .../src/TeamPermissionHandlerInterface.php | 2 +- ...nchronousPostUserDeleteActionPerformer.php | 4 ++-- .../TeamInvitationSubscriber.php | 1 - .../src/TestTeamPermissions.php | 4 ++-- .../tests/src/Functional/AccessTest.php | 2 +- .../src/Functional/ApigeeX/AccessTest.php | 4 ++-- .../ApigeeEdgeTeamsFunctionalTestBase.php | 2 +- .../ApigeeX/TeamInvitationsTest.php | 3 +-- .../ApigeeX/TeamListBuilderTest.php | 2 +- .../ApigeeX/TeamMembershipManagerTest.php | 3 +-- .../Functional/TeamApiProductAccessTest.php | 4 ++-- .../src/Functional/TeamInvitationsTest.php | 2 +- .../src/Functional/TeamListBuilderTest.php | 2 +- .../ManageTeamAppsApiProductAccessTest.php | 2 +- .../ApigeeX/Entity/TeamViewBuilderTest.php | 2 +- .../Event/TeamInvitationEventsTest.php | 5 ++-- .../src/Kernel/Entity/TeamViewBuilderTest.php | 2 +- .../Kernel/Event/TeamInvitationEventsTest.php | 5 ++-- src/Annotation/EdgeEntityType.php | 2 +- src/Commands/ApigeeEdgeCommands.php | 2 +- ...DeveloperAppViewControllerForDeveloper.php | 2 +- src/Controller/DeveloperSyncController.php | 4 ++-- .../EdgeEntityFieldConfigListController.php | 4 ++-- src/Credentials.php | 2 +- src/CredentialsInterface.php | 2 +- src/Entity/App.php | 1 - src/Entity/AppTitleProvider.php | 4 ++-- src/Entity/AppViewBuilder.php | 3 --- ...AttributesAwareFieldableEdgeEntityBase.php | 2 +- src/Entity/Controller/AppController.php | 14 +++++------ .../AppCredentialControllerBase.php | 6 ++--- .../Cache/DeveloperAppCacheFactory.php | 2 +- .../Cache/DeveloperAppNameCacheFactory.php | 2 +- ...aginatedEntityIdListingControllerTrait.php | 2 +- ...dPaginatedEntityListingControllerTrait.php | 2 +- .../DeveloperAppEdgeEntityControllerProxy.php | 1 - src/Entity/Developer.php | 7 ++---- src/Entity/DeveloperApp.php | 2 +- src/Entity/DeveloperAppRouteProvider.php | 2 +- src/Entity/DeveloperCompaniesCache.php | 2 +- src/Entity/EdgeEntityBase.php | 2 +- src/Entity/EdgeEntityTitleProvider.php | 8 +++---- src/Entity/EdgeEntityType.php | 4 ++-- src/Entity/Enhancer/AppRouteEnhancer.php | 2 +- src/Entity/FieldableEdgeEntityBase.php | 2 +- src/Entity/Form/AppCreateForm.php | 6 ++--- src/Entity/Form/AppEditForm.php | 6 ++--- src/Entity/Form/AppForm.php | 6 ++--- src/Entity/Form/DeveloperAppCreateForm.php | 6 ++--- .../Form/DeveloperAppCreateFormBase.php | 2 +- .../DeveloperAppCreateFormForDeveloper.php | 2 +- src/Entity/Form/DeveloperAppEditForm.php | 6 ++--- src/Entity/Form/DeveloperAppFormTrait.php | 4 ++-- src/Entity/Form/FieldableEdgeEntityForm.php | 2 +- src/Entity/ListBuilder/AppListBuilder.php | 6 ++--- .../DeveloperAppListBuilderForDeveloper.php | 8 +++---- .../ListBuilder/EdgeEntityListBuilder.php | 2 +- src/Entity/Query/AppQueryBase.php | 2 +- src/Entity/Storage/ApiProductStorage.php | 10 ++++---- src/Entity/Storage/AppStorage.php | 14 +++++------ src/Entity/Storage/DeveloperAppStorage.php | 12 +++++----- src/Entity/Storage/DeveloperStorage.php | 16 ++++++------- src/Entity/Storage/EdgeEntityStorageBase.php | 16 ++++++------- .../FieldableEdgeEntityStorageBase.php | 6 ++--- .../ApiProductEntityAccessCacheReset.php | 2 +- ...AppFieldConfigListAlterEventSubscriber.php | 2 +- .../DeveloperStatusWarningSubscriber.php | 2 +- .../EdgeExceptionSubscriber.php | 4 ++-- .../AuthenticationKeyNotFoundException.php | 2 +- ...thenticationKeyValueMalformedException.php | 2 +- .../DeveloperDoesNotExistException.php | 2 +- ...oUserConversationInvalidValueException.php | 2 +- .../DeveloperUpdateFailedException.php | 2 +- .../KeyProviderRequirementsException.php | 2 +- src/Exception/UserDoesNotExistWithEmail.php | 2 +- src/FieldAttributeConverter.php | 4 ++-- src/Form/AppAnalyticsFormBase.php | 8 +++---- src/Form/AppAnalyticsSettingsForm.php | 2 +- src/Form/AppApiKeyAddFormBase.php | 4 ++-- src/Form/AppApiKeyConfirmFormBase.php | 4 ++-- src/Form/AppApiKeyRevokeFormBase.php | 2 +- src/Form/AuthenticationForm.php | 4 ++-- src/Form/DeveloperAppAnalyticsForm.php | 2 +- .../DeveloperAppAnalyticsFormForDeveloper.php | 2 +- src/Form/DeveloperAppApiKeyAddForm.php | 4 ++-- src/Form/DeveloperAttributesSettingsForm.php | 4 ++-- src/Form/DeveloperSyncForm.php | 2 +- src/Form/EdgeEntityDisplaySettingsForm.php | 10 ++++---- src/Job/DeveloperCreateUpdate.php | 2 +- src/Job/EdgeJob.php | 2 +- src/Job/UserCreateUpdate.php | 4 ++-- src/Job/UserDeveloperSyncJobTrait.php | 4 ++-- src/JobExecutor.php | 4 ++-- src/KeyEntityFormEnhancer.php | 16 ++++++------- src/OauthAuthentication.php | 2 +- src/OauthCredentials.php | 2 +- src/OauthTokenFileStorage.php | 4 ++-- src/OauthTokenStorageInterface.php | 2 +- .../DeveloperAppNameConverter.php | 4 ++-- .../DynamicAddEntityLocalActions.php | 2 +- src/Plugin/EdgeKeyTypeBase.php | 2 +- .../StatusPropertyFormatter.php | 4 ++-- .../ApigeeEdgeDeveloperIdFieldItem.php | 2 +- src/Plugin/FieldStorageFormatManager.php | 2 +- src/Plugin/KeyInput/ApigeeAuthKeyInput.php | 4 ++-- .../EnvironmentVariablesKeyProvider.php | 2 +- .../KeyProviderRequirementsBase.php | 4 ++-- .../KeyProvider/PrivateFileKeyProvider.php | 2 +- src/Plugin/KeyType/ApigeeAuthKeyType.php | 2 +- .../Menu/AddAppForDeveloperLocalAction.php | 2 +- src/Plugin/QueueWorker/JobQueueWorker.php | 4 ++-- .../DeveloperEmailUniqueValidator.php | 2 +- .../LowercaseEmailConstraintValidator.php | 2 +- ...geEntityFieldConfigListRouteSubscriber.php | 4 ++-- src/SDKConnector.php | 15 ++++++------ src/SDKConnectorInterface.php | 3 +-- src/UserDeveloperConverter.php | 4 ++-- .../src/Entity/OverriddenDeveloperApp.php | 4 ++-- .../apigee_edge_test/src/SDKConnector.php | 4 ++-- .../src/UserDeveloperConverter.php | 4 ++-- .../EventSubscriber/CreateDeleteAppKey.php | 4 ++-- .../OverrideAppKeysOnGenerate.php | 6 ++--- .../ApigeeMockApiClientServiceProvider.php | 2 +- .../Traits/ApigeeMockApiClientHelperTrait.php | 8 +++---- .../ApigeeEdgeFunctionalTestBase.php | 4 ++-- .../ApigeeX/ApigeeEdgeFunctionalTestBase.php | 4 ++-- tests/src/Functional/ApigeeX/EmailTest.php | 6 +---- .../Functional/DeveloperAppAnalyticsTest.php | 4 ++-- .../src/Functional/DeveloperAppApiKeyTest.php | 5 ++-- .../DeveloperAppApiKeysPermissionTest.php | 2 +- .../src/Functional/DeveloperAppFieldTest.php | 20 ++++++++-------- .../Functional/DeveloperAppPermissionTest.php | 4 ++-- tests/src/Functional/DeveloperAppUITest.php | 14 +++++------ .../Functional/DeveloperAppUITestTrait.php | 8 +++---- tests/src/Functional/DeveloperSyncTest.php | 24 +++++++++---------- tests/src/Functional/DeveloperTest.php | 2 +- tests/src/Functional/EmailTest.php | 4 ++-- tests/src/Functional/StatusReportTest.php | 2 +- .../ApiProductAccessTest.php | 4 ++-- ...ApigeeEdgeFunctionalJavascriptTestBase.php | 2 +- tests/src/FunctionalJavascript/CacheTest.php | 2 +- .../Form/AuthenticationFormJsTest.php | 13 +++++----- tests/src/Kernel/ApigeeEdgeKernelTestBase.php | 2 +- .../ApigeeX/ApigeeEdgeKernelTestBase.php | 2 +- .../Kernel/Entity/AppWarningsCheckerTest.php | 6 ++--- .../Entity/ListBuilder/AppListBuilderTest.php | 8 +++---- .../ListBuilder/EntityListBuilderTest.php | 4 ++-- .../EdgeEntityDisplaySettingsFormTest.php | 2 +- .../src/Kernel/OauthTokenFileStorageTest.php | 4 ++-- tests/src/Kernel/TestFrameworkKernelTest.php | 3 +-- tests/src/Kernel/UserAgentTest.php | 1 - .../Traits/ApigeeEdgeFunctionalTestTrait.php | 6 ++--- .../ApigeeEdgeManagementCliServiceTest.php | 2 +- .../Unit/Commands/ApigeeEdgeCommandsTest.php | 2 +- tests/src/Unit/ConditionTest.php | 2 +- tests/src/Unit/Entity/ApiProductTest.php | 2 +- .../EdgeExceptionSubscriberTest.php | 4 ++-- 254 files changed, 523 insertions(+), 560 deletions(-) diff --git a/modules/apigee_edge_actions/apigee_edge_actions.tokens.inc b/modules/apigee_edge_actions/apigee_edge_actions.tokens.inc index a5e70643..e28c43b9 100644 --- a/modules/apigee_edge_actions/apigee_edge_actions.tokens.inc +++ b/modules/apigee_edge_actions/apigee_edge_actions.tokens.inc @@ -24,9 +24,9 @@ */ -use Drupal\apigee_edge\Entity\EdgeEntityInterface; use Drupal\Component\Utility\Html; use Drupal\Core\Render\BubbleableMetadata; +use Drupal\apigee_edge\Entity\EdgeEntityInterface; /** * Implements hook_token_info_alter(). @@ -79,7 +79,7 @@ function apigee_edge_actions_tokens($type, $tokens, array $data, array $options, $replacements = []; if ($type == 'entity' && !empty($data['entity_type']) && !empty($data['entity']) && !empty($data['token_type'])) { - /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ $entity = $data['entity']; if ($entity instanceof EdgeEntityInterface) { diff --git a/modules/apigee_edge_actions/modules/apigee_edge_actions_debug/src/EventSubscriber/ApigeeEdgeActionsDebugEventSubscriber.php b/modules/apigee_edge_actions/modules/apigee_edge_actions_debug/src/EventSubscriber/ApigeeEdgeActionsDebugEventSubscriber.php index 9365c61f..9cdc384d 100644 --- a/modules/apigee_edge_actions/modules/apigee_edge_actions_debug/src/EventSubscriber/ApigeeEdgeActionsDebugEventSubscriber.php +++ b/modules/apigee_edge_actions/modules/apigee_edge_actions_debug/src/EventSubscriber/ApigeeEdgeActionsDebugEventSubscriber.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_actions_debug\EventSubscriber; +use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\apigee_edge_actions\Event\ApigeeEdgeActionsEventInterface; use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge; -use Drupal\Core\Logger\LoggerChannelInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** diff --git a/modules/apigee_edge_actions/src/ApigeeActionsEntityTypeHelper.php b/modules/apigee_edge_actions/src/ApigeeActionsEntityTypeHelper.php index a246ac1d..7a181172 100644 --- a/modules/apigee_edge_actions/src/ApigeeActionsEntityTypeHelper.php +++ b/modules/apigee_edge_actions/src/ApigeeActionsEntityTypeHelper.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_actions; -use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface; /** * Defines the apigee_edge_actions.edge_entity_type_manager service. diff --git a/modules/apigee_edge_actions/src/Event/EdgeEntityEventBase.php b/modules/apigee_edge_actions/src/Event/EdgeEntityEventBase.php index 293302d9..4653090b 100644 --- a/modules/apigee_edge_actions/src/Event/EdgeEntityEventBase.php +++ b/modules/apigee_edge_actions/src/Event/EdgeEntityEventBase.php @@ -25,7 +25,7 @@ /** * Base class for Edge events. * - * TODO: Rules does not support non GenericEvent context. + * @todo Rules does not support non GenericEvent context. */ abstract class EdgeEntityEventBase extends GenericEvent { diff --git a/modules/apigee_edge_actions/src/EventSubscriber/AppCredentialEventSubscriber.php b/modules/apigee_edge_actions/src/EventSubscriber/AppCredentialEventSubscriber.php index 14340e2b..a6ffb603 100644 --- a/modules/apigee_edge_actions/src/EventSubscriber/AppCredentialEventSubscriber.php +++ b/modules/apigee_edge_actions/src/EventSubscriber/AppCredentialEventSubscriber.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_actions\EventSubscriber; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Event\AppCredentialAddApiProductEvent; -use Drupal\apigee_edge\Event\AppCredentialDeleteApiProductEvent; -use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge; use Drupal\Component\Plugin\Exception\PluginException; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Event\AppCredentialAddApiProductEvent; +use Drupal\apigee_edge\Event\AppCredentialDeleteApiProductEvent; +use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Contracts\EventDispatcher\Event; @@ -177,17 +177,17 @@ protected function dispatchRulesEvent(string $rules_event_name, Event $event, ar * The app with the provided name or null. */ protected function getAppByName(string $name, string $owner_id, string $app_type): ?AppInterface { - /* @var \Drupal\apigee_edge\Entity\AppInterface $appClass */ + /** @var \Drupal\apigee_edge\Entity\AppInterface $appClass */ $appClass = $this->entityTypeManger->getStorage("{$app_type}_app")->getEntityType()->getClass(); try { if ($app_type == 'developer') { - /* @var \Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactoryInterface $controller */ + /** @var \Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactoryInterface $controller */ $controller = \Drupal::service('apigee_edge.controller.developer_app_controller_factory'); $edge_app = $controller->developerAppController($owner_id)->load($name); } else { - /* @var \Drupal\apigee_edge_teams\Entity\Controller\TeamAppControllerFactory $controller */ + /** @var \Drupal\apigee_edge_teams\Entity\Controller\TeamAppControllerFactory $controller */ $controller = \Drupal::service('apigee_edge_teams.controller.team_app_controller_factory'); $edge_app = $controller->teamAppController($owner_id)->load($name); } diff --git a/modules/apigee_edge_actions/src/Plugin/RulesAction/LogMessage.php b/modules/apigee_edge_actions/src/Plugin/RulesAction/LogMessage.php index 60cd1e05..507b7524 100644 --- a/modules/apigee_edge_actions/src/Plugin/RulesAction/LogMessage.php +++ b/modules/apigee_edge_actions/src/Plugin/RulesAction/LogMessage.php @@ -20,9 +20,7 @@ namespace Drupal\apigee_edge_actions\Plugin\RulesAction; -use Drupal\Core\Annotation\ContextDefinition; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\rules\Core\Annotation\RulesAction; use Drupal\rules\Core\RulesActionBase; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/modules/apigee_edge_actions/src/Plugin/RulesAction/SystemEmailToUsersOfRole.php b/modules/apigee_edge_actions/src/Plugin/RulesAction/SystemEmailToUsersOfRole.php index 3afccf88..95c5f662 100644 --- a/modules/apigee_edge_actions/src/Plugin/RulesAction/SystemEmailToUsersOfRole.php +++ b/modules/apigee_edge_actions/src/Plugin/RulesAction/SystemEmailToUsersOfRole.php @@ -81,7 +81,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - protected function doExecute(array $roles, $subject, $message, $reply = NULL, LanguageInterface $language = NULL) { + protected function doExecute(array $roles, $subject, $message, $reply = NULL, ?LanguageInterface $language = NULL) { // SystemMailToUsersOfRole::doExecute() expects an array of RoleInterface. // Upcast is done in RulesActionBase. parent::doExecute($roles, $subject, $message, $reply, $language); diff --git a/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverBase.php b/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverBase.php index 6451b1f5..27535354 100644 --- a/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverBase.php +++ b/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverBase.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge_actions\Plugin\RulesEvent; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\apigee_edge\Entity\AppInterface; use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface; use Drupal\apigee_edge_actions\ApigeeActionsEntityTypeHelperInterface; use Drupal\apigee_edge_teams\Entity\TeamAppInterface; -use Drupal\Component\Plugin\Derivative\DeriverBase; -use Drupal\Core\StringTranslation\StringTranslationTrait; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverInterface.php b/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverInterface.php index 1ea24d90..115845a4 100644 --- a/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverInterface.php +++ b/modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityEventDeriverInterface.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_actions\Plugin\RulesEvent; -use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; +use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface; /** * Provides an interface for Apigee Edge entity event deriver. diff --git a/modules/apigee_edge_actions/src/TeamMembershipManager.php b/modules/apigee_edge_actions/src/TeamMembershipManager.php index 7d57f779..469b83e0 100644 --- a/modules/apigee_edge_actions/src/TeamMembershipManager.php +++ b/modules/apigee_edge_actions/src/TeamMembershipManager.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_actions; +use Drupal\Core\Cache\CacheTagsInvalidatorInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface; use Drupal\apigee_edge\Entity\DeveloperCompaniesCacheInterface; use Drupal\apigee_edge_actions\Event\EdgeEntityEventEdge; use Drupal\apigee_edge_teams\CompanyMembersControllerFactoryInterface; use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; -use Drupal\Core\Cache\CacheTagsInvalidatorInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\user\UserInterface; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -151,7 +151,7 @@ public function removeMembers(string $team, array $developers): void { /** * {@inheritdoc} */ - public function getTeams(string $developer, string $team = NULL): array { + public function getTeams(string $developer, ?string $team = NULL): array { return $this->inner->getTeams($developer, $team); } diff --git a/modules/apigee_edge_actions/tests/src/Kernel/ApigeeEdgeActionsRulesKernelTestBase.php b/modules/apigee_edge_actions/tests/src/Kernel/ApigeeEdgeActionsRulesKernelTestBase.php index 6df089a1..ee8b7235 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/ApigeeEdgeActionsRulesKernelTestBase.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/ApigeeEdgeActionsRulesKernelTestBase.php @@ -20,11 +20,11 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\Core\Database\Database; -use Drupal\dblog\Controller\DbLogController; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\Tests\rules\Kernel\RulesKernelTestBase; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; +use Drupal\dblog\Controller\DbLogController; use Drupal\user\Entity\User; use Symfony\Component\HttpFoundation\Response; diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesAction/SystemEmailToUsersOfRoleTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesAction/SystemEmailToUsersOfRoleTest.php index 12729a8a..81ac2e5b 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesAction/SystemEmailToUsersOfRoleTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesAction/SystemEmailToUsersOfRoleTest.php @@ -20,8 +20,8 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesAction; -use Drupal\rules\Context\ContextConfig; use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; +use Drupal\rules\Context\ContextConfig; /** * Tests Edge entity add_member event. diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddMemberEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddMemberEventTest.php index 283d8585..93d7194e 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddMemberEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddMemberEventTest.php @@ -20,8 +20,8 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; -use Drupal\rules\Context\ContextConfig; use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; +use Drupal\rules\Context\ContextConfig; /** * Tests Edge entity add_member event. diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddProductEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddProductEventTest.php index 73e36d3d..fc2a1272 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddProductEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddProductEventTest.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; +use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\rules\Context\ContextConfig; -use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; /** * Tests Edge entity add_product event. @@ -103,7 +103,7 @@ public function testEvent() { $this->queueDeveloperResponse($this->account); $this->stack->queueMockResponse([ 'get_developer_apps' => [ - 'apps' => [$developer_app] + 'apps' => [$developer_app], ], ]); diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityDeleteEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityDeleteEventTest.php index 7c86bfd2..4fcd0435 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityDeleteEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityDeleteEventTest.php @@ -20,8 +20,8 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; -use Drupal\rules\Context\ContextConfig; use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; +use Drupal\rules\Context\ContextConfig; /** * Tests Edge entity delete event. diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityInsertEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityInsertEventTest.php index 3942b2fd..6b67b486 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityInsertEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityInsertEventTest.php @@ -20,8 +20,8 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; -use Drupal\rules\Context\ContextConfig; use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; +use Drupal\rules\Context\ContextConfig; /** * Tests Edge entity insert event. diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveMemberEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveMemberEventTest.php index 0a1e1169..8be976ec 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveMemberEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveMemberEventTest.php @@ -20,8 +20,8 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; -use Drupal\rules\Context\ContextConfig; use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; +use Drupal\rules\Context\ContextConfig; /** * Tests Edge entity remove_member event. diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveProductEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveProductEventTest.php index 3f5cc8f9..f46a72ff 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveProductEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveProductEventTest.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; +use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\rules\Context\ContextConfig; -use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; /** * Tests Edge entity remove_product event. diff --git a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityUpdateEventTest.php b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityUpdateEventTest.php index fcfcedf7..f02bd35d 100644 --- a/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityUpdateEventTest.php +++ b/modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityUpdateEventTest.php @@ -20,8 +20,8 @@ namespace Drupal\Tests\apigee_edge_actions\Kernel\Plugin\RulesEvent; -use Drupal\rules\Context\ContextConfig; use Drupal\Tests\apigee_edge_actions\Kernel\ApigeeEdgeActionsRulesKernelTestBase; +use Drupal\rules\Context\ContextConfig; /** * Tests Edge entity update event. diff --git a/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductController.php b/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductController.php index 743a3385..9eee5045 100644 --- a/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductController.php +++ b/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductController.php @@ -27,8 +27,8 @@ use Apigee\Edge\Exception\ApiException; use Apigee\Edge\Structure\AttributesProperty; use Apigee\Edge\Structure\PagerInterface; -use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; use Drupal\Core\State\StateInterface; +use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; /** * API product controller that reads and writes attributes from/to States API. @@ -139,7 +139,7 @@ public function delete(string $entity_id): EntityInterface { /** * {@inheritdoc} */ - public function getEntities(PagerInterface $pager = NULL, string $key_provider = 'id'): array { + public function getEntities(?PagerInterface $pager = NULL, string $key_provider = 'id'): array { /** @var \Drupal\apigee_edge\Entity\ApiProductInterface $entity */ $ids = array_map(function ($id) { return $this->generateApiProductStateKey($id); @@ -255,7 +255,7 @@ public function createPager(int $limit = 0, ?string $startKey = NULL): PagerInte /** * {@inheritdoc} */ - public function getEntityIds(PagerInterface $pager = NULL): array { + public function getEntityIds(?PagerInterface $pager = NULL): array { return $this->innerService->getEntityIds($pager); } diff --git a/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductStorage.php b/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductStorage.php index b1d5ccd6..f709532c 100644 --- a/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductStorage.php +++ b/modules/apigee_edge_apiproduct_rbac/tests/modules/apigee_edge_apiproduct_rbac_test/src/ApiProductStorage.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_apiproduct_rbac_test; -use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; -use Drupal\apigee_edge\Entity\Storage\ApiProductStorage as OriginalApiProductStorage; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\State\StateInterface; +use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; +use Drupal\apigee_edge\Entity\Storage\ApiProductStorage as OriginalApiProductStorage; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessTestBase.php b/modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessTestBase.php index 42cb6142..6855302d 100644 --- a/modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessTestBase.php +++ b/modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessTestBase.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge_apiproduct_rbac\FunctionalJavascript; -use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\Core\Url; use Drupal\Tests\apigee_edge\FunctionalJavascript\ApiProductAccessTest; +use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\user\UserInterface; /** diff --git a/modules/apigee_edge_debug/src/DebugMessageFormatterPluginManager.php b/modules/apigee_edge_debug/src/DebugMessageFormatterPluginManager.php index 3f2fd958..e422d3c4 100644 --- a/modules/apigee_edge_debug/src/DebugMessageFormatterPluginManager.php +++ b/modules/apigee_edge_debug/src/DebugMessageFormatterPluginManager.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge_debug; -use Drupal\apigee_edge_debug\Annotation\DebugMessageFormatter; -use Drupal\apigee_edge_debug\Plugin\DebugMessageFormatter\DebugMessageFormatterPluginInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\DefaultPluginManager; +use Drupal\apigee_edge_debug\Annotation\DebugMessageFormatter; +use Drupal\apigee_edge_debug\Plugin\DebugMessageFormatter\DebugMessageFormatterPluginInterface; /** * Provides a debug message formatter plugin manager. diff --git a/modules/apigee_edge_debug/src/Form/ConfigForm.php b/modules/apigee_edge_debug/src/Form/ConfigForm.php index a8d62fad..c3bad216 100644 --- a/modules/apigee_edge_debug/src/Form/ConfigForm.php +++ b/modules/apigee_edge_debug/src/Form/ConfigForm.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge_debug\Form; -use Drupal\apigee_edge_debug\DebugMessageFormatterPluginManager; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_debug\DebugMessageFormatterPluginManager; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_debug/src/HttpClientMiddleware/ApiClientProfiler.php b/modules/apigee_edge_debug/src/HttpClientMiddleware/ApiClientProfiler.php index 1ebfcd9d..89003209 100644 --- a/modules/apigee_edge_debug/src/HttpClientMiddleware/ApiClientProfiler.php +++ b/modules/apigee_edge_debug/src/HttpClientMiddleware/ApiClientProfiler.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_debug\HttpClientMiddleware; +use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\apigee_edge_debug\DebugMessageFormatterPluginManager; use Drupal\apigee_edge_debug\SDKConnector; -use Drupal\Core\Config\ConfigFactoryInterface; use GuzzleHttp\RequestOptions; use GuzzleHttp\TransferStats; use Psr\Http\Message\RequestInterface; -use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; +use Psr\Log\LoggerInterface; /** * Http client middleware that profiles Apigee Edge API calls. diff --git a/modules/apigee_edge_debug/src/HttpClientMiddleware/DevelKintApiClientProfiler.php b/modules/apigee_edge_debug/src/HttpClientMiddleware/DevelKintApiClientProfiler.php index bba36278..07291a33 100644 --- a/modules/apigee_edge_debug/src/HttpClientMiddleware/DevelKintApiClientProfiler.php +++ b/modules/apigee_edge_debug/src/HttpClientMiddleware/DevelKintApiClientProfiler.php @@ -20,12 +20,11 @@ namespace Drupal\apigee_edge_debug\HttpClientMiddleware; -use Drupal\apigee_edge_debug\DebugMessageFormatterPluginManager; -use Drupal\apigee_edge_debug\SDKConnector; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_debug\DebugMessageFormatterPluginManager; use GuzzleHttp\RequestOptions; use GuzzleHttp\TransferStats; use Psr\Http\Message\RequestInterface; diff --git a/modules/apigee_edge_debug/src/SDKConnector.php b/modules/apigee_edge_debug/src/SDKConnector.php index bcb05f0b..f843327a 100644 --- a/modules/apigee_edge_debug/src/SDKConnector.php +++ b/modules/apigee_edge_debug/src/SDKConnector.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_debug; -use Drupal\apigee_edge\SDKConnector as OriginalSDKConnector; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\InfoParserInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Http\ClientFactory; +use Drupal\apigee_edge\SDKConnector as OriginalSDKConnector; +use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\key\KeyRepositoryInterface; /** diff --git a/modules/apigee_edge_teams/src/Access/ManageTeamMembersAccess.php b/modules/apigee_edge_teams/src/Access/ManageTeamMembersAccess.php index acb777eb..f66d0653 100644 --- a/modules/apigee_edge_teams/src/Access/ManageTeamMembersAccess.php +++ b/modules/apigee_edge_teams/src/Access/ManageTeamMembersAccess.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_teams\Access; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultAllowed; use Drupal\Core\Access\AccessResultForbidden; use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; /** * Check access on manage team members routes. diff --git a/modules/apigee_edge_teams/src/Access/TeamAppListByTeamAccess.php b/modules/apigee_edge_teams/src/Access/TeamAppListByTeamAccess.php index 81d14958..2f00e950 100644 --- a/modules/apigee_edge_teams/src/Access/TeamAppListByTeamAccess.php +++ b/modules/apigee_edge_teams/src/Access/TeamAppListByTeamAccess.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_teams\Access; -use Drupal\apigee_edge_teams\Entity\TeamAppPermissionProvider; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_teams\Entity\TeamAppPermissionProvider; +use Drupal\apigee_edge_teams\Entity\TeamInterface; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; /** * Check access on Team app list by team route. diff --git a/modules/apigee_edge_teams/src/AppGroupMembersController.php b/modules/apigee_edge_teams/src/AppGroupMembersController.php index b2938efa..56519ca3 100644 --- a/modules/apigee_edge_teams/src/AppGroupMembersController.php +++ b/modules/apigee_edge_teams/src/AppGroupMembersController.php @@ -22,12 +22,9 @@ use Apigee\Edge\Api\ApigeeX\Controller\AppGroupMembersController as ApigeeXAppGroupMembersController; use Apigee\Edge\Api\ApigeeX\Structure\AppGroupMembership; -use Drupal\apigee_edge\Entity\Controller\OrganizationController; use Drupal\apigee_edge\SDKConnectorInterface; -use Drupal\apigee_edge_teams\Entity\Form\TeamForm; use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface; -use Drupal\Component\Serialization\Json; /** * Definition of the AppGroup members controller service. diff --git a/modules/apigee_edge_teams/src/AppGroupMembershipObjectCache.php b/modules/apigee_edge_teams/src/AppGroupMembershipObjectCache.php index ac5440a8..4cc1bc66 100644 --- a/modules/apigee_edge_teams/src/AppGroupMembershipObjectCache.php +++ b/modules/apigee_edge_teams/src/AppGroupMembershipObjectCache.php @@ -21,12 +21,12 @@ namespace Drupal\apigee_edge_teams; use Apigee\Edge\Api\ApigeeX\Structure\AppGroupMembership; -use Drupal\apigee_edge\MemoryCacheFactoryInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheFactoryInterface; use Drupal\Core\Cache\CacheTagsInvalidatorInterface; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\apigee_edge\MemoryCacheFactoryInterface; /** * Providers a persistent & non-persistent cache for appgroup membership objects. diff --git a/modules/apigee_edge_teams/src/Commands/ApigeeEdgeCommands.php b/modules/apigee_edge_teams/src/Commands/ApigeeEdgeCommands.php index d1b4fc09..bb4f675e 100644 --- a/modules/apigee_edge_teams/src/Commands/ApigeeEdgeCommands.php +++ b/modules/apigee_edge_teams/src/Commands/ApigeeEdgeCommands.php @@ -19,7 +19,6 @@ namespace Drupal\apigee_edge_teams\Commands; -use Consolidation\AnnotatedCommand\CommandData; use Drupal\apigee_edge_teams\CliServiceInterface; use Drush\Commands\DrushCommands; @@ -41,7 +40,7 @@ class ApigeeEdgeCommands extends DrushCommands { * @param \Drupal\apigee_edge_teams\CliServiceInterface $cli_service * The CLI service which allows interoperability. */ - public function __construct(CliServiceInterface $cli_service = NULL) { + public function __construct(?CliServiceInterface $cli_service = NULL) { parent::__construct(); $this->cliService = $cli_service; } diff --git a/modules/apigee_edge_teams/src/CompanyMembersController.php b/modules/apigee_edge_teams/src/CompanyMembersController.php index f2c379b4..e720e867 100644 --- a/modules/apigee_edge_teams/src/CompanyMembersController.php +++ b/modules/apigee_edge_teams/src/CompanyMembersController.php @@ -22,7 +22,6 @@ use Apigee\Edge\Api\Management\Controller\CompanyMembersController as EdgeCompanyMembersController; use Apigee\Edge\Api\Management\Structure\CompanyMembership; -use Drupal\apigee_edge\Entity\Controller\OrganizationController; use Drupal\apigee_edge\SDKConnectorInterface; /** diff --git a/modules/apigee_edge_teams/src/CompanyMembershipObjectCache.php b/modules/apigee_edge_teams/src/CompanyMembershipObjectCache.php index 0fd61c9f..07381133 100644 --- a/modules/apigee_edge_teams/src/CompanyMembershipObjectCache.php +++ b/modules/apigee_edge_teams/src/CompanyMembershipObjectCache.php @@ -21,12 +21,12 @@ namespace Drupal\apigee_edge_teams; use Apigee\Edge\Api\Management\Structure\CompanyMembership; -use Drupal\apigee_edge\MemoryCacheFactoryInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheFactoryInterface; use Drupal\Core\Cache\CacheTagsInvalidatorInterface; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\apigee_edge\MemoryCacheFactoryInterface; /** * Providers a persistent & non-persistent cache for company membership objects. @@ -87,7 +87,7 @@ final class CompanyMembershipObjectCache implements CompanyMembershipObjectCache */ public function __construct(CacheFactoryInterface $cache_factory, MemoryCacheFactoryInterface $memory_cache_factory, ConfigFactoryInterface $config, TimeInterface $time) { $this->persistentCacheBackend = $cache_factory->get(self::DEFAULT_CACHE_BIN); - // TODO Should we introduce dedicated cache expiration configuration for + // @todo Should we introduce dedicated cache expiration configuration for // this? $this->persistentCacheExpiration = $config->get('apigee_edge_teams.team_settings')->get('cache_expiration'); $this->memoryCache = $memory_cache_factory->get('company_membership_object'); diff --git a/modules/apigee_edge_teams/src/Controller/TeamMemberSyncController.php b/modules/apigee_edge_teams/src/Controller/TeamMemberSyncController.php index d823d778..9b50914c 100644 --- a/modules/apigee_edge_teams/src/Controller/TeamMemberSyncController.php +++ b/modules/apigee_edge_teams/src/Controller/TeamMemberSyncController.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge_teams\Controller; +use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\Messenger\MessengerInterface; use Drupal\apigee_edge\Job\Job; use Drupal\apigee_edge\JobExecutorInterface; use Drupal\apigee_edge_teams\Job\TeamMemberSync; -use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Messenger\MessengerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/modules/apigee_edge_teams/src/Controller/TeamMembersList.php b/modules/apigee_edge_teams/src/Controller/TeamMembersList.php index 5082ab85..e3ee1e81 100644 --- a/modules/apigee_edge_teams/src/Controller/TeamMembersList.php +++ b/modules/apigee_edge_teams/src/Controller/TeamMembersList.php @@ -20,8 +20,11 @@ namespace Drupal\apigee_edge_teams\Controller; -use Apigee\Edge\Api\ApigeeX\Structure\AppGroupMembership; -use Apigee\Edge\Api\Management\Structure\CompanyMembership; +use Drupal\Component\Utility\Html; +use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\apigee_edge_teams\AppGroupMembershipObjectCacheInterface; use Drupal\apigee_edge_teams\CompanyMembershipObjectCacheInterface; @@ -29,11 +32,6 @@ use Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; -use Drupal\Component\Utility\Html; -use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Url; use Drupal\user\UserInterface; use Drupal\views\Views; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -101,7 +99,7 @@ class TeamMembersList extends ControllerBase { * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller * The organization controller service. */ - public function __construct(TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler = NULL, CompanyMembershipObjectCacheInterface $company_membership_object_cache, AppGroupMembershipObjectCacheInterface $appgroup_membership_object_cache, OrganizationControllerInterface $org_controller) { + public function __construct(TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ?ModuleHandlerInterface $module_handler = NULL, CompanyMembershipObjectCacheInterface $company_membership_object_cache, AppGroupMembershipObjectCacheInterface $appgroup_membership_object_cache, OrganizationControllerInterface $org_controller) { if (!$module_handler) { @trigger_error('Calling ' . __METHOD__ . ' without the $module_handler is deprecated in apigee_edge:8-x-1.19 and is required before apigee_edge:8.x-2.0. See https://github.com/apigee/apigee-edge-drupal/pull/518.', E_USER_DEPRECATED); $module_handler = \Drupal::moduleHandler(); diff --git a/modules/apigee_edge_teams/src/DefaultTeamPermissionsProvider.php b/modules/apigee_edge_teams/src/DefaultTeamPermissionsProvider.php index e47fb548..2dd7f525 100644 --- a/modules/apigee_edge_teams/src/DefaultTeamPermissionsProvider.php +++ b/modules/apigee_edge_teams/src/DefaultTeamPermissionsProvider.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge_teams; -use Drupal\apigee_edge_teams\Structure\TeamPermission; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\apigee_edge_teams\Structure\TeamPermission; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Entity/AppGroupCache.php b/modules/apigee_edge_teams/src/Entity/AppGroupCache.php index 113db292..0cbc1dc7 100644 --- a/modules/apigee_edge_teams/src/Entity/AppGroupCache.php +++ b/modules/apigee_edge_teams/src/Entity/AppGroupCache.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Entity; -use Drupal\apigee_edge\MemoryCacheFactoryInterface; use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\apigee_edge\MemoryCacheFactoryInterface; /** * Default non-persistent developer appgroup membership cache implementation. diff --git a/modules/apigee_edge_teams/src/Entity/Controller/TeamController.php b/modules/apigee_edge_teams/src/Entity/Controller/TeamController.php index 8b147912..3b273ae4 100644 --- a/modules/apigee_edge_teams/src/Entity/Controller/TeamController.php +++ b/modules/apigee_edge_teams/src/Entity/Controller/TeamController.php @@ -238,7 +238,7 @@ public function delete(string $entity_id): EntityInterface { /** * {@inheritdoc} */ - public function getEntities(PagerInterface $pager = NULL, string $key_provider = 'id'): array { + public function getEntities(?PagerInterface $pager = NULL, string $key_provider = 'id'): array { $queryparam = []; if ($this->orgController->isOrganizationApigeeX()) { // Getting the channelId & filter enable check from Config form. @@ -248,7 +248,7 @@ public function getEntities(PagerInterface $pager = NULL, string $key_provider = if ($channelfilter) { $channelid = $channelid ? $channelid : TeamAliasForm::originalChannelId(); $queryparam = [ - 'filter' => 'channelId=' . $channelid + 'filter' => 'channelId=' . $channelid, ]; } } diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateForm.php index 43436d9b..60c99a67 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateForm.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * General form handler for the team app create. diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormBase.php b/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormBase.php index dfa3731d..f844b52d 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormBase.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormBase.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_teams\Entity\Form; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Drupal\apigee_edge\Entity\Form\AppCreateForm; use Drupal\apigee_edge_teams\Entity\Controller\TeamAppCredentialControllerFactoryInterface; use Drupal\apigee_edge_teams\TeamMemberApiProductAccessHandlerInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormForTeam.php b/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormForTeam.php index f82e097a..cad9e690 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormForTeam.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamAppCreateFormForTeam.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * Team app create form for a team. @@ -38,7 +38,7 @@ class TeamAppCreateFormForTeam extends TeamAppCreateFormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?TeamInterface $team = NULL) { // This is the only place where we can grab additional route parameters. // See implementation in parent. $this->team = $team; diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamAppEditForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamAppEditForm.php index 128a3432..a5e88e16 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamAppEditForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamAppEditForm.php @@ -20,15 +20,15 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; -use Drupal\apigee_edge\Entity\Form\AppEditForm; -use Drupal\apigee_edge_teams\Entity\Controller\TeamAppCredentialControllerFactoryInterface; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; +use Drupal\apigee_edge\Entity\Form\AppEditForm; +use Drupal\apigee_edge_teams\Entity\Controller\TeamAppCredentialControllerFactoryInterface; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -64,7 +64,7 @@ class TeamAppEditForm extends AppEditForm { * @param \Drupal\apigee_edge_teams\TeamPermissionHandlerInterface $team_permission_handler * The team permission handler. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, TeamAppCredentialControllerFactoryInterface $app_credential_controller_factory, TeamPermissionHandlerInterface $team_permission_handler = NULL) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, TeamAppCredentialControllerFactoryInterface $app_credential_controller_factory, ?TeamPermissionHandlerInterface $team_permission_handler = NULL) { if (!$team_permission_handler) { $team_permission_handler = \Drupal::service('apigee_edge_teams.team_permissions'); } diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php b/modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php index fb0e230f..3e522a58 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php @@ -22,15 +22,15 @@ use Apigee\Edge\Exception\ApiException; use Apigee\Edge\Exception\ClientErrorException; -use Drupal\apigee_edge\Entity\ApiProductInterface; -use Drupal\apigee_edge_teams\TeamMemberApiProductAccessHandlerInterface; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ImmutableConfig; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\ApiProductInterface; +use Drupal\apigee_edge_teams\TeamMemberApiProductAccessHandlerInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; /** * Helper trait that contains team app (create/edit) form specific tweaks. diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamForm.php index 436de1fa..cbaef2bd 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamForm.php @@ -21,18 +21,18 @@ namespace Drupal\apigee_edge_teams\Entity\Form; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; -use Drupal\apigee_edge\Entity\Form\EdgeEntityFormInterface; -use Drupal\apigee_edge\Entity\Form\FieldableEdgeEntityForm; -use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\apigee_edge_teams\Form\TeamAliasForm; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; +use Drupal\apigee_edge\Entity\Form\EdgeEntityFormInterface; +use Drupal\apigee_edge\Entity\Form\FieldableEdgeEntityForm; +use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; +use Drupal\apigee_edge_teams\Form\TeamAliasForm; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -268,7 +268,7 @@ public function save(array $form, FormStateInterface $form_state) { try { if (!$this->orgController->isOrganizationApigeeX()) { $this->teamMembershipManager->addMembers($team->id(), [ - $this->currentUser->getEmail() + $this->currentUser->getEmail(), ]); } diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationAcceptForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationAcceptForm.php index f53f55f3..046d1111 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationAcceptForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationAcceptForm.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; /** * Provides the accept form for team_invitation. diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeclineForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeclineForm.php index c3d52c16..46b74d8f 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeclineForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeclineForm.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; /** * Provides the decline form for team_invitation. diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeleteForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeleteForm.php index 27db281c..eadc1729 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeleteForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationDeleteForm.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Entity\ContentEntityDeleteForm; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * Provides the delete form for team_invitation. @@ -56,7 +56,7 @@ public function getCancelUrl() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?TeamInterface $team = NULL) { $this->team = $team; return parent::buildForm($form, $form_state); } diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationFormBase.php b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationFormBase.php index 39b3367b..3e36721b 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationFormBase.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationFormBase.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Entity\ContentEntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * Provides a base class for updating status for a team_invitation. @@ -67,7 +67,7 @@ public function getCancelText() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?TeamInterface $team = NULL) { $this->team = $team; if ($this->handleExpired && $this->entity->isExpired()) { diff --git a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationResendForm.php b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationResendForm.php index a5524828..8c0c9fb4 100644 --- a/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationResendForm.php +++ b/modules/apigee_edge_teams/src/Entity/Form/TeamInvitationResendForm.php @@ -20,13 +20,12 @@ namespace Drupal\apigee_edge_teams\Entity\Form; -use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; -use Drupal\apigee_edge_teams\TeamInvitationNotifierInterface; use Drupal\Component\Datetime\TimeInterface; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; +use Drupal\apigee_edge_teams\TeamInvitationNotifierInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php index 039f3fe2..3510dec7 100644 --- a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php +++ b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php @@ -20,8 +20,6 @@ namespace Drupal\apigee_edge_teams\Entity\ListBuilder; -use Drupal\apigee_edge\Entity\AppWarningsCheckerInterface; -use Drupal\apigee_edge\Entity\ListBuilder\AppListBuilder; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; @@ -31,6 +29,8 @@ use Drupal\Core\Render\RendererInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\apigee_edge\Entity\AppWarningsCheckerInterface; +use Drupal\apigee_edge\Entity\ListBuilder\AppListBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -66,7 +66,7 @@ class TeamAppListByTeam extends AppListBuilder implements ContainerInjectionInte * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker * The app warnings checker service. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } diff --git a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamListBuilder.php b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamListBuilder.php index a1a04e3a..0b4ab871 100644 --- a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamListBuilder.php +++ b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamListBuilder.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge_teams\Entity\ListBuilder; -use Drupal\apigee_edge\Element\StatusPropertyElement; -use Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Element\StatusPropertyElement; +use Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * General entity listing builder for teams. diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamAppStorage.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamAppStorage.php index f465d543..c507e343 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamAppStorage.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamAppStorage.php @@ -20,6 +20,10 @@ namespace Drupal\apigee_edge_teams\Entity\Storage; +use Drupal\Component\Datetime\TimeInterface; +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; +use Drupal\Core\Entity\EntityTypeInterface; use Drupal\apigee_edge\Entity\AppInterface; use Drupal\apigee_edge\Entity\Controller\AppControllerInterface; use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; @@ -28,10 +32,6 @@ use Drupal\apigee_edge_teams\Entity\Controller\TeamAppApigeeXEntityControllerProxy; use Drupal\apigee_edge_teams\Entity\Controller\TeamAppControllerFactoryInterface; use Drupal\apigee_edge_teams\Entity\Controller\TeamAppEdgeEntityControllerProxy; -use Drupal\Component\Datetime\TimeInterface; -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; -use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamInvitationStorage.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamInvitationStorage.php index 330050f8..58d4521b 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamInvitationStorage.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamInvitationStorage.php @@ -20,9 +20,6 @@ namespace Drupal\apigee_edge_teams\Entity\Storage; -use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; -use Drupal\apigee_edge_teams\Event\TeamInvitationEvent; -use Drupal\apigee_edge_teams\Event\TeamInvitationEvents; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; @@ -34,6 +31,9 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\Sql\SqlContentEntityStorage; use Drupal\Core\Language\LanguageManagerInterface; +use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; +use Drupal\apigee_edge_teams\Event\TeamInvitationEvent; +use Drupal\apigee_edge_teams\Event\TeamInvitationEvents; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php index 11de4f27..cfa27ddd 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php @@ -20,11 +20,6 @@ namespace Drupal\apigee_edge_teams\Entity\Storage; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface; -use Drupal\apigee_edge_teams\Exception\InvalidArgumentException; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; @@ -39,6 +34,11 @@ use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; +use Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface; +use Drupal\apigee_edge_teams\Exception\InvalidArgumentException; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -94,7 +94,7 @@ class TeamMemberRoleStorage extends SqlContentEntityStorage implements TeamMembe * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller * The organization controller service. */ - public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityFieldManagerInterface $entity_field_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, MemoryCacheInterface $memory_cache, TeamMembershipManagerInterface $team_membership_manager, LoggerInterface $logger, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, EntityTypeManagerInterface $entity_type_manager = NULL, OrganizationControllerInterface $org_controller) { + public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityFieldManagerInterface $entity_field_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, MemoryCacheInterface $memory_cache, TeamMembershipManagerInterface $team_membership_manager, LoggerInterface $logger, ?EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, ?EntityTypeManagerInterface $entity_type_manager = NULL, OrganizationControllerInterface $org_controller) { parent::__construct($entity_type, $database, $entity_field_manager, $cache, $language_manager, $memory_cache, $entity_type_bundle_info, $entity_type_manager); $this->teamMembershipManager = $team_membership_manager; $this->logger = $logger; @@ -159,7 +159,7 @@ public function addTeamRoles(AccountInterface $account, TeamInterface $team, arr if ($account->isAnonymous()) { throw new InvalidArgumentException('Anonymous user can not be member of a team.'); } - // TODO : Implement this check for ApigeeX. + // @todo Implement this check for ApigeeX. // DB is empty durning Team syncronization for 1st time, so $developer_team_ids // is always empty which cause issue for member update in DB. if (!$this->orgController->isOrganizationApigeeX()) { @@ -181,7 +181,7 @@ public function addTeamRoles(AccountInterface $account, TeamInterface $team, arr if ($team_member_roles === NULL) { $team_member_roles = $this->create([ 'uid' => ['target_id' => $account->id()], - 'team' => ['target_id' => $team->id()] + 'team' => ['target_id' => $team->id()], ]); } // Make sure we only store unique values in the field. @@ -203,7 +203,7 @@ public function addTeamRoles(AccountInterface $account, TeamInterface $team, arr }, $team_member_roles->roles->getValue()); // Updating the members role in __apigee_reserved__developer_details attribute for ApigeeX. $this->teamMembershipManager->addMembers($team->id(), [ - $account->getEmail() => $updated_roles + $account->getEmail() => $updated_roles, ]); } $team_member_roles->save(); @@ -265,7 +265,7 @@ public function removeTeamRoles(AccountInterface $account, TeamInterface $team, }, $team_member_roles->roles->getValue()); // Updating the members role in __apigee_reserved__developer_details attribute for ApigeeX. $this->teamMembershipManager->addMembers($team->id(), [ - $account->getEmail() => $updated_roles + $account->getEmail() => $updated_roles, ]); } $team_member_roles->save(); diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorageInterface.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorageInterface.php index 1aaa815b..d633bd2f 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorageInterface.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorageInterface.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge_teams\Entity\Storage; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface; use Drupal\Core\Entity\ContentEntityStorageInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; +use Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface; /** * Defines an interface for team member role entity storage classes. diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamRoleStorage.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamRoleStorage.php index d71c72e9..79eafa81 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamRoleStorage.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamRoleStorage.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Entity\Storage; -use Drupal\apigee_edge_teams\Exception\InvalidArgumentException; use Drupal\Core\Config\Entity\ConfigEntityStorage; +use Drupal\apigee_edge_teams\Exception\InvalidArgumentException; /** * Team role entity storage. diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamStorage.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamStorage.php index 59f02f77..d9b77ff0 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamStorage.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamStorage.php @@ -21,12 +21,6 @@ namespace Drupal\apigee_edge_teams\Entity\Storage; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Entity\Controller\CachedManagementApiEdgeEntityControllerProxy; -use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; -use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; -use Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy; -use Drupal\apigee_edge\Entity\Storage\AttributesAwareFieldableEdgeEntityStorageBase; -use Drupal\apigee_edge_teams\Entity\Controller\TeamControllerInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; @@ -36,6 +30,12 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Controller\CachedManagementApiEdgeEntityControllerProxy; +use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; +use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; +use Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy; +use Drupal\apigee_edge\Entity\Storage\AttributesAwareFieldableEdgeEntityStorageBase; +use Drupal\apigee_edge_teams\Entity\Controller\TeamControllerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -128,7 +128,7 @@ protected function doSave($id, EntityInterface $entity) { $result = parent::doSave($id, $entity); // Change the status of the team (company) in Apigee Edge. - // TODO Only change it if it has changed. + // @todo Only change it if it has changed. try { $this->teamController->setStatus($entity->id(), $team_status); } diff --git a/modules/apigee_edge_teams/src/Entity/Team.php b/modules/apigee_edge_teams/src/Entity/Team.php index 51246adb..fb055968 100644 --- a/modules/apigee_edge_teams/src/Entity/Team.php +++ b/modules/apigee_edge_teams/src/Entity/Team.php @@ -24,8 +24,8 @@ use Apigee\Edge\Api\Management\Entity\Company; use Apigee\Edge\Entity\EntityInterface; use Apigee\Edge\Structure\AttributesProperty; -use Drupal\apigee_edge\Entity\AttributesAwareFieldableEdgeEntityBase; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\AttributesAwareFieldableEdgeEntityBase; /** * Defines the Team entity class. diff --git a/modules/apigee_edge_teams/src/Entity/TeamAccessHandler.php b/modules/apigee_edge_teams/src/Entity/TeamAccessHandler.php index 14b60def..1c594d3f 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamAccessHandler.php +++ b/modules/apigee_edge_teams/src/Entity/TeamAccessHandler.php @@ -20,8 +20,6 @@ namespace Drupal\apigee_edge_teams\Entity; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityHandlerInterface; @@ -29,6 +27,8 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Entity/TeamApp.php b/modules/apigee_edge_teams/src/Entity/TeamApp.php index e45dfd22..593dbe6f 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamApp.php +++ b/modules/apigee_edge_teams/src/Entity/TeamApp.php @@ -23,8 +23,8 @@ use Apigee\Edge\Api\ApigeeX\Entity\AppGroupApp; use Apigee\Edge\Api\Management\Entity\CompanyApp; use Apigee\Edge\Entity\EntityInterface as EdgeEntityInterface; -use Drupal\apigee_edge\Entity\App; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\App; /** * Defines the Team (company) app entity class. diff --git a/modules/apigee_edge_teams/src/Entity/TeamAppAccessHandler.php b/modules/apigee_edge_teams/src/Entity/TeamAppAccessHandler.php index 7d4643d0..1aae5505 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamAppAccessHandler.php +++ b/modules/apigee_edge_teams/src/Entity/TeamAppAccessHandler.php @@ -20,8 +20,6 @@ namespace Drupal\apigee_edge_teams\Entity; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Entity\EntityAccessControlHandler; @@ -31,6 +29,8 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -198,7 +198,7 @@ private function checkAccessByTeamMemberPermissions(TeamInterface $team, string 'analytics', 'add_api_key', 'delete_api_key', - 'revoke_api_key' + 'revoke_api_key', ]; if (!in_array($operation, $covered_operations)) { return AccessResult::neutral("Team membership based access check does not support {$operation} operation on team apps."); diff --git a/modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php b/modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php index ddcb0504..f2064f3d 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php +++ b/modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php @@ -20,6 +20,7 @@ namespace Drupal\apigee_edge_teams\Entity; +use Drupal\Core\Entity\EntityTypeInterface; use Drupal\apigee_edge\Entity\AppRouteProvider; use Drupal\apigee_edge\Entity\AppTitleProvider; use Drupal\apigee_edge_teams\Controller\TeamAppKeysController; @@ -27,7 +28,6 @@ use Drupal\apigee_edge_teams\Form\TeamAppApiKeyAddForm; use Drupal\apigee_edge_teams\Form\TeamAppApiKeyDeleteForm; use Drupal\apigee_edge_teams\Form\TeamAppApiKeyRevokeForm; -use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\Routing\Route; /** diff --git a/modules/apigee_edge_teams/src/Entity/TeamInvitation.php b/modules/apigee_edge_teams/src/Entity/TeamInvitation.php index ab4dd484..a9f0008d 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamInvitation.php +++ b/modules/apigee_edge_teams/src/Entity/TeamInvitation.php @@ -26,7 +26,6 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\user\EntityOwnerTrait; -use Drupal\user\UserInterface; /** * Defines the team invitation entity. @@ -287,7 +286,7 @@ public function preSave(EntityStorageInterface $storage) { '@team' => $this->getTeam()->label(), '@roles' => implode(', ', array_map(function (TeamRoleInterface $team_role) { return $team_role->label(); - }, $this->getTeamRoles())) + }, $this->getTeamRoles())), ])); } diff --git a/modules/apigee_edge_teams/src/Entity/TeamInvitationAccessControlHandler.php b/modules/apigee_edge_teams/src/Entity/TeamInvitationAccessControlHandler.php index fe7c2891..6784d6fc 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamInvitationAccessControlHandler.php +++ b/modules/apigee_edge_teams/src/Entity/TeamInvitationAccessControlHandler.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge_teams\Entity; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityHandlerInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\entity\EntityAccessControlHandler; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProvider.php b/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProvider.php index 4fbbd86b..78d8c3f0 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProvider.php +++ b/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProvider.php @@ -32,7 +32,7 @@ class TeamInvitationTitleProvider extends EntityController implements TeamInvita /** * {@inheritdoc} */ - public function acceptTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function acceptTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('Accept %label', ['%label' => $entity->label()]); } @@ -41,7 +41,7 @@ public function acceptTitle(RouteMatchInterface $route_match, EntityInterface $_ /** * {@inheritdoc} */ - public function declineTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function declineTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('Decline %label', ['%label' => $entity->label()]); } @@ -50,7 +50,7 @@ public function declineTitle(RouteMatchInterface $route_match, EntityInterface $ /** * {@inheritdoc} */ - public function resendTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function resendTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('Resend %label', ['%label' => $entity->label()]); } diff --git a/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProviderInterface.php b/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProviderInterface.php index 23517420..6973e025 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProviderInterface.php +++ b/modules/apigee_edge_teams/src/Entity/TeamInvitationTitleProviderInterface.php @@ -39,7 +39,7 @@ interface TeamInvitationTitleProviderInterface { * @return string|null * The title for the entity accept page. */ - public function acceptTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL); + public function acceptTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL); /** * Provides the decline title for a team_invitation. @@ -52,7 +52,7 @@ public function acceptTitle(RouteMatchInterface $route_match, EntityInterface $_ * @return string|null * The title for the entity decline page. */ - public function declineTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL); + public function declineTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL); /** * Provides the resend title for a team_invitation. @@ -65,6 +65,6 @@ public function declineTitle(RouteMatchInterface $route_match, EntityInterface $ * @return string|null * The title for the entity resend page. */ - public function resendTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL); + public function resendTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL); } diff --git a/modules/apigee_edge_teams/src/Entity/TeamMemberRole.php b/modules/apigee_edge_teams/src/Entity/TeamMemberRole.php index b19eddfb..dacb5d40 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamMemberRole.php +++ b/modules/apigee_edge_teams/src/Entity/TeamMemberRole.php @@ -64,7 +64,7 @@ final class TeamMemberRole extends ContentEntityBase implements TeamMemberRoleIn /** * {@inheritdoc} */ - public function access($operation, AccountInterface $account = NULL, $return_as_object = FALSE) { + public function access($operation, ?AccountInterface $account = NULL, $return_as_object = FALSE) { if (!$account) { // If we have hit this without an account return forbidden. return AccessResult::forbidden(); diff --git a/modules/apigee_edge_teams/src/Entity/TeamRouteProvider.php b/modules/apigee_edge_teams/src/Entity/TeamRouteProvider.php index 6957faa3..bb763a6d 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamRouteProvider.php +++ b/modules/apigee_edge_teams/src/Entity/TeamRouteProvider.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_teams\Entity; +use Drupal\Core\Entity\EntityTypeInterface; use Drupal\apigee_edge\Entity\EdgeEntityRouteProvider; use Drupal\apigee_edge_teams\Controller\TeamMembersList; use Drupal\apigee_edge_teams\Form\AddTeamMembersForm; use Drupal\apigee_edge_teams\Form\EditTeamMemberForm; use Drupal\apigee_edge_teams\Form\RemoveTeamMemberForm; use Drupal\apigee_edge_teams\TeamContextManagerInterface; -use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\Routing\Route; /** diff --git a/modules/apigee_edge_teams/src/Entity/TeamTitleProvider.php b/modules/apigee_edge_teams/src/Entity/TeamTitleProvider.php index ad838240..458d5887 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamTitleProvider.php +++ b/modules/apigee_edge_teams/src/Entity/TeamTitleProvider.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams\Entity; -use Drupal\apigee_edge\Entity\EdgeEntityTitleProvider; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\apigee_edge\Entity\EdgeEntityTitleProvider; /** * Team specific title additions and overrides. @@ -40,7 +40,7 @@ class TeamTitleProvider extends EdgeEntityTitleProvider { * @return string|null * The title for the team members listing page, null if an entity was found. */ - public function teamMembersList(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function teamMembersList(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('@entity_type Members', [ '@entity_type' => ucfirst($this->entityTypeManager->getDefinition($entity->getEntityTypeId())->getSingularLabel()), diff --git a/modules/apigee_edge_teams/src/Entity/TeamViewBuilder.php b/modules/apigee_edge_teams/src/Entity/TeamViewBuilder.php index 41eaae5c..0400e350 100644 --- a/modules/apigee_edge_teams/src/Entity/TeamViewBuilder.php +++ b/modules/apigee_edge_teams/src/Entity/TeamViewBuilder.php @@ -20,7 +20,6 @@ namespace Drupal\apigee_edge_teams\Entity; -use Drupal\apigee_edge\Entity\EdgeEntityViewBuilder; use Drupal\Core\Config\Config; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Entity\EntityInterface; @@ -28,6 +27,7 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Theme\Registry; +use Drupal\apigee_edge\Entity\EdgeEntityViewBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -58,7 +58,7 @@ class TeamViewBuilder extends EdgeEntityViewBuilder { * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface|null $entity_display_repository * The entity display repository. */ - public function __construct(EntityTypeInterface $entity_type, EntityRepositoryInterface $entity_repository, LanguageManagerInterface $language_manager, Config $config, Registry $theme_registry = NULL, EntityDisplayRepositoryInterface $entity_display_repository = NULL) { + public function __construct(EntityTypeInterface $entity_type, EntityRepositoryInterface $entity_repository, LanguageManagerInterface $language_manager, Config $config, ?Registry $theme_registry = NULL, ?EntityDisplayRepositoryInterface $entity_display_repository = NULL) { parent::__construct($entity_type, $entity_repository, $language_manager, $theme_registry, $entity_display_repository); $this->config = $config; } diff --git a/modules/apigee_edge_teams/src/EventSubscriber/TeamAppFieldConfigListAlterEventSubscriber.php b/modules/apigee_edge_teams/src/EventSubscriber/TeamAppFieldConfigListAlterEventSubscriber.php index 0e6ec00e..75697144 100644 --- a/modules/apigee_edge_teams/src/EventSubscriber/TeamAppFieldConfigListAlterEventSubscriber.php +++ b/modules/apigee_edge_teams/src/EventSubscriber/TeamAppFieldConfigListAlterEventSubscriber.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams\EventSubscriber; +use Drupal\Core\Form\FormBuilderInterface; use Drupal\apigee_edge\Event\EdgeEntityFieldConfigListAlterEvent; use Drupal\apigee_edge_teams\Form\TeamAppBaseFieldConfigForm; -use Drupal\Core\Form\FormBuilderInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** diff --git a/modules/apigee_edge_teams/src/EventSubscriber/TeamInactiveStatusSubscriber.php b/modules/apigee_edge_teams/src/EventSubscriber/TeamInactiveStatusSubscriber.php index e0e1c7a9..d966ab7d 100644 --- a/modules/apigee_edge_teams/src/EventSubscriber/TeamInactiveStatusSubscriber.php +++ b/modules/apigee_edge_teams/src/EventSubscriber/TeamInactiveStatusSubscriber.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge_teams\EventSubscriber; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\DependencyInjection\ClassResolverInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\apigee_edge_teams\Entity\TeamInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\ResponseEvent; @@ -116,7 +116,7 @@ public function onRespond(ResponseEvent $event) { ]; $renderer = $this->classResolver->getInstanceFromDefinition($this->mainContentRenderers['html']); - /* @var \Symfony\Component\HttpFoundation\Response $response */ + /** @var \Symfony\Component\HttpFoundation\Response $response */ $response = $renderer->renderResponse($content, $event->getRequest(), $this->routeMatch); $response->setStatusCode(Response::HTTP_FORBIDDEN); diff --git a/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationQueryAccessSubscriber.php b/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationQueryAccessSubscriber.php index c66f168c..e6372493 100644 --- a/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationQueryAccessSubscriber.php +++ b/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationQueryAccessSubscriber.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\EventSubscriber; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\entity\QueryAccess\QueryAccessEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationSubscriber.php b/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationSubscriber.php index 30005fae..97c4e1f4 100644 --- a/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationSubscriber.php +++ b/modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationSubscriber.php @@ -20,6 +20,9 @@ namespace Drupal\apigee_edge_teams\EventSubscriber; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Logger\LoggerChannelInterface; +use Drupal\Core\Utility\Error; use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\apigee_edge_teams\Entity\TeamRole; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; @@ -27,9 +30,6 @@ use Drupal\apigee_edge_teams\Event\TeamInvitationEvents; use Drupal\apigee_edge_teams\TeamInvitationNotifierInterface; use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Logger\LoggerChannelInterface; -use Drupal\Core\Utility\Error; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -158,12 +158,12 @@ public function onAccepted(TeamInvitationEventInterface $event) { // attribute we can store the roles as well. if ($this->orgController->isOrganizationApigeeX()) { $this->teamMembershipManager->addMembers($team->id(), [ - $team_invitation->getRecipient() => $selected_roles + $team_invitation->getRecipient() => $selected_roles, ]); } else { $this->teamMembershipManager->addMembers($team->id(), [ - $team_invitation->getRecipient() + $team_invitation->getRecipient(), ]); } diff --git a/modules/apigee_edge_teams/src/EventSubscriber/TeamStatusWarningSubscriber.php b/modules/apigee_edge_teams/src/EventSubscriber/TeamStatusWarningSubscriber.php index bace71dc..accba51f 100644 --- a/modules/apigee_edge_teams/src/EventSubscriber/TeamStatusWarningSubscriber.php +++ b/modules/apigee_edge_teams/src/EventSubscriber/TeamStatusWarningSubscriber.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_teams\EventSubscriber; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; diff --git a/modules/apigee_edge_teams/src/EventSubscriber/ValidateApigeeXTeamEnabledSubscriber.php b/modules/apigee_edge_teams/src/EventSubscriber/ValidateApigeeXTeamEnabledSubscriber.php index 2b2129f9..561cbbac 100644 --- a/modules/apigee_edge_teams/src/EventSubscriber/ValidateApigeeXTeamEnabledSubscriber.php +++ b/modules/apigee_edge_teams/src/EventSubscriber/ValidateApigeeXTeamEnabledSubscriber.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge_teams\EventSubscriber; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; +use Drupal\apigee_edge\SDKConnectorInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; diff --git a/modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php b/modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php index 684d7490..31aae868 100644 --- a/modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php +++ b/modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge_teams\Form; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -90,7 +90,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?TeamInterface $team = NULL) { $this->team = $team; $role_options = $this->getRoleOptions(); diff --git a/modules/apigee_edge_teams/src/Form/EditTeamMemberForm.php b/modules/apigee_edge_teams/src/Form/EditTeamMemberForm.php index e6e6ad02..d0bf18b4 100644 --- a/modules/apigee_edge_teams/src/Form/EditTeamMemberForm.php +++ b/modules/apigee_edge_teams/src/Form/EditTeamMemberForm.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge_teams\Form; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Utility\Error; use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Utility\Error; /** * Edit team member form. @@ -48,7 +48,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL, DeveloperInterface $developer = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?TeamInterface $team = NULL, ?DeveloperInterface $developer = NULL) { $this->team = $team; $this->developer = $developer; $role_options = $this->getRoleOptions(); diff --git a/modules/apigee_edge_teams/src/Form/RemoveTeamMemberForm.php b/modules/apigee_edge_teams/src/Form/RemoveTeamMemberForm.php index c6ac8603..668c8a68 100644 --- a/modules/apigee_edge_teams/src/Form/RemoveTeamMemberForm.php +++ b/modules/apigee_edge_teams/src/Form/RemoveTeamMemberForm.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_teams\Form; -use Drupal\apigee_edge\Entity\DeveloperInterface; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\DeveloperInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -103,7 +103,7 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL, DeveloperInterface $developer = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?TeamInterface $team = NULL, ?DeveloperInterface $developer = NULL) { $this->team = $team; $this->developer = $developer; return parent::buildForm($form, $form_state); diff --git a/modules/apigee_edge_teams/src/Form/TeamAliasForm.php b/modules/apigee_edge_teams/src/Form/TeamAliasForm.php index cd785910..2d02fd99 100644 --- a/modules/apigee_edge_teams/src/Form/TeamAliasForm.php +++ b/modules/apigee_edge_teams/src/Form/TeamAliasForm.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Form; -use Drupal\apigee_edge\Form\EdgeEntityAliasConfigFormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Form\EdgeEntityAliasConfigFormBase; /** * Provides a form for changing Team aliases. diff --git a/modules/apigee_edge_teams/src/Form/TeamAppApiKeyAddForm.php b/modules/apigee_edge_teams/src/Form/TeamAppApiKeyAddForm.php index 8a91ff30..17052772 100644 --- a/modules/apigee_edge_teams/src/Form/TeamAppApiKeyAddForm.php +++ b/modules/apigee_edge_teams/src/Form/TeamAppApiKeyAddForm.php @@ -19,12 +19,12 @@ namespace Drupal\apigee_edge_teams\Form; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\AppInterface; use Drupal\apigee_edge\Form\AppApiKeyAddFormBase; use Drupal\apigee_edge_teams\Entity\Form\TeamAppFormTrait; use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides API key add form for team app. diff --git a/modules/apigee_edge_teams/src/Form/TeamMemberSyncForm.php b/modules/apigee_edge_teams/src/Form/TeamMemberSyncForm.php index 1fdded0a..82823fd1 100644 --- a/modules/apigee_edge_teams/src/Form/TeamMemberSyncForm.php +++ b/modules/apigee_edge_teams/src/Form/TeamMemberSyncForm.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge_teams\Form; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; +use Drupal\apigee_edge\SDKConnectorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Form/TeamMembersFormBase.php b/modules/apigee_edge_teams/src/Form/TeamMembersFormBase.php index 21eb2cbf..ad96de50 100644 --- a/modules/apigee_edge_teams/src/Form/TeamMembersFormBase.php +++ b/modules/apigee_edge_teams/src/Form/TeamMembersFormBase.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams\Form; -use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; +use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Form/TeamPermissionsForm.php b/modules/apigee_edge_teams/src/Form/TeamPermissionsForm.php index 78cb75ad..260ff240 100644 --- a/modules/apigee_edge_teams/src/Form/TeamPermissionsForm.php +++ b/modules/apigee_edge_teams/src/Form/TeamPermissionsForm.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge_teams\Form; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Component\Utility\Html; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/ParamConverter/TeamAppNameConverter.php b/modules/apigee_edge_teams/src/ParamConverter/TeamAppNameConverter.php index 2c002e18..bad26df6 100644 --- a/modules/apigee_edge_teams/src/ParamConverter/TeamAppNameConverter.php +++ b/modules/apigee_edge_teams/src/ParamConverter/TeamAppNameConverter.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge_teams\ParamConverter; -use Drupal\apigee_edge\Entity\Storage\AppStorage; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\ParamConverter\ParamConverterInterface; +use Drupal\apigee_edge\Entity\Storage\AppStorage; use Symfony\Component\Routing\Route; /** diff --git a/modules/apigee_edge_teams/src/Plugin/Block/TeamContextSwitcherBlock.php b/modules/apigee_edge_teams/src/Plugin/Block/TeamContextSwitcherBlock.php index 95d31132..c624a26d 100644 --- a/modules/apigee_edge_teams/src/Plugin/Block/TeamContextSwitcherBlock.php +++ b/modules/apigee_edge_teams/src/Plugin/Block/TeamContextSwitcherBlock.php @@ -20,8 +20,6 @@ namespace Drupal\apigee_edge_teams\Plugin\Block; -use Drupal\apigee_edge_teams\TeamContextManagerInterface; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; @@ -31,6 +29,8 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; +use Drupal\apigee_edge_teams\TeamContextManagerInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/src/Plugin/EntityReferenceSelection/TeamMembersSelection.php b/modules/apigee_edge_teams/src/Plugin/EntityReferenceSelection/TeamMembersSelection.php index 93b8c678..d08856fb 100644 --- a/modules/apigee_edge_teams/src/Plugin/EntityReferenceSelection/TeamMembersSelection.php +++ b/modules/apigee_edge_teams/src/Plugin/EntityReferenceSelection/TeamMembersSelection.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge_teams\Plugin\EntityReferenceSelection; -use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface; -use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface; +use Drupal\apigee_edge_teams\TeamMembershipManagerInterface; use Drupal\user\Plugin\EntityReferenceSelection\UserSelection; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -249,7 +249,7 @@ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTA $options = []; $entities = $this->entityTypeManager->getStorage($target_type)->loadMultiple($result); - /* @var \Drupal\user\UserInterface $entity */ + /** @var \Drupal\user\UserInterface $entity */ foreach ($entities as $id => $entity) { $options[$target_type][$id] = $entity->getEmail(); } diff --git a/modules/apigee_edge_teams/src/Plugin/Menu/AddAppForTeamLocalAction.php b/modules/apigee_edge_teams/src/Plugin/Menu/AddAppForTeamLocalAction.php index 4e213a9c..34ce170e 100644 --- a/modules/apigee_edge_teams/src/Plugin/Menu/AddAppForTeamLocalAction.php +++ b/modules/apigee_edge_teams/src/Plugin/Menu/AddAppForTeamLocalAction.php @@ -81,7 +81,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function getTitle(Request $request = NULL) { + public function getTitle(?Request $request = NULL) { return $this->t('Add @app', [ '@app' => mb_strtolower($this->teamAppEntity->getSingularLabel()), ]); diff --git a/modules/apigee_edge_teams/src/Plugin/Menu/TeamAppsLocalTask.php b/modules/apigee_edge_teams/src/Plugin/Menu/TeamAppsLocalTask.php index e0403a5f..5f159ee6 100644 --- a/modules/apigee_edge_teams/src/Plugin/Menu/TeamAppsLocalTask.php +++ b/modules/apigee_edge_teams/src/Plugin/Menu/TeamAppsLocalTask.php @@ -70,7 +70,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function getTitle(Request $request = NULL) { + public function getTitle(?Request $request = NULL) { // Display the current plural label of the Team app entity. return $this->teamAppDefinition->getCollectionLabel(); } diff --git a/modules/apigee_edge_teams/src/Plugin/views/access/TeamPermission.php b/modules/apigee_edge_teams/src/Plugin/views/access/TeamPermission.php index 5c5938d2..1b605b0f 100644 --- a/modules/apigee_edge_teams/src/Plugin/views/access/TeamPermission.php +++ b/modules/apigee_edge_teams/src/Plugin/views/access/TeamPermission.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge_teams\Plugin\views\access; -use Drupal\apigee_edge_teams\Structure\TeamPermission as TeamPermissionEntity; -use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_teams\Structure\TeamPermission as TeamPermissionEntity; +use Drupal\apigee_edge_teams\TeamPermissionHandlerInterface; use Drupal\views\Plugin\views\access\AccessPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Routing\Route; diff --git a/modules/apigee_edge_teams/src/Routing/TeamContextSwitcherRouteAlterSubscriber.php b/modules/apigee_edge_teams/src/Routing/TeamContextSwitcherRouteAlterSubscriber.php index 3ba43b00..d7e97bbc 100644 --- a/modules/apigee_edge_teams/src/Routing/TeamContextSwitcherRouteAlterSubscriber.php +++ b/modules/apigee_edge_teams/src/Routing/TeamContextSwitcherRouteAlterSubscriber.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams\Routing; -use Drupal\apigee_edge_teams\TeamContextManagerInterface; use Drupal\Core\Routing\RouteSubscriberBase; +use Drupal\apigee_edge_teams\TeamContextManagerInterface; use Symfony\Component\Routing\RouteCollection; /** diff --git a/modules/apigee_edge_teams/src/TeamInvitationNotifierEmail.php b/modules/apigee_edge_teams/src/TeamInvitationNotifierEmail.php index 87a8452f..e8183075 100644 --- a/modules/apigee_edge_teams/src/TeamInvitationNotifierEmail.php +++ b/modules/apigee_edge_teams/src/TeamInvitationNotifierEmail.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams; -use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Mail\MailManagerInterface; +use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; /** * Handles notifications for team_invitation via email. diff --git a/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandler.php b/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandler.php index f42cf6d3..316ea478 100644 --- a/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandler.php +++ b/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandler.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_teams; -use Drupal\apigee_edge\Entity\ApiProductInterface; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultForbidden; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge\Entity\ApiProductInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * Default team member API product access handler implementation. @@ -92,7 +92,7 @@ public function __construct(TeamMembershipManagerInterface $team_membership_mana /** * {@inheritdoc} */ - public function access(ApiProductInterface $api_product, string $operation, TeamInterface $team, AccountInterface $account = NULL, bool $return_as_object = FALSE) { + public function access(ApiProductInterface $api_product, string $operation, TeamInterface $team, ?AccountInterface $account = NULL, bool $return_as_object = FALSE) { if ($account === NULL) { $account = $this->currentUser; } diff --git a/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandlerInterface.php b/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandlerInterface.php index c4fc60fe..9e8c3aea 100644 --- a/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandlerInterface.php +++ b/modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandlerInterface.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge_teams; +use Drupal\Core\Session\AccountInterface; use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\Core\Session\AccountInterface; /** * Base definition of the team member API product access handler. @@ -56,7 +56,7 @@ interface TeamMemberApiProductAccessHandlerInterface { * returned, i.e. TRUE means access is explicitly allowed, FALSE means * access is either explicitly forbidden or "no opinion". */ - public function access(ApiProductInterface $api_product, string $operation, TeamInterface $team, AccountInterface $account = NULL, bool $return_as_object = FALSE); + public function access(ApiProductInterface $api_product, string $operation, TeamInterface $team, ?AccountInterface $account = NULL, bool $return_as_object = FALSE); /** * Clears all cached access checks. diff --git a/modules/apigee_edge_teams/src/TeamMembershipManager.php b/modules/apigee_edge_teams/src/TeamMembershipManager.php index 54c5c889..30ed61a9 100644 --- a/modules/apigee_edge_teams/src/TeamMembershipManager.php +++ b/modules/apigee_edge_teams/src/TeamMembershipManager.php @@ -22,16 +22,14 @@ use Apigee\Edge\Api\ApigeeX\Structure\AppGroupMembership; use Apigee\Edge\Api\Management\Structure\CompanyMembership; +use Drupal\Core\Cache\CacheTagsInvalidatorInterface; +use Drupal\Core\Entity\EntityStorageException; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface; use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\apigee_edge\Entity\DeveloperCompaniesCacheInterface; use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; -use Drupal\apigee_edge_teams\Entity\Form\TeamForm; -use Drupal\Core\Cache\CacheTagsInvalidatorInterface; -use Drupal\Core\Entity\EntityStorageException; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Session\AccountInterface; use Drupal\user\UserInterface; use Psr\Log\LoggerInterface; @@ -247,7 +245,7 @@ public function removeMembers(string $team, array $developers): void { /** * {@inheritdoc} */ - public function getTeams(string $developer, string $team = NULL): array { + public function getTeams(string $developer, ?string $team = NULL): array { /** @var \Drupal\apigee_edge\Entity\DeveloperInterface $entity */ $entity = $this->entityTypeManager->getStorage('developer')->load($developer); if ($entity === NULL) { diff --git a/modules/apigee_edge_teams/src/TeamPermissionHandler.php b/modules/apigee_edge_teams/src/TeamPermissionHandler.php index 5ab2d36e..75d36ca3 100644 --- a/modules/apigee_edge_teams/src/TeamPermissionHandler.php +++ b/modules/apigee_edge_teams/src/TeamPermissionHandler.php @@ -20,16 +20,16 @@ namespace Drupal\apigee_edge_teams; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\apigee_edge_teams\Exception\InvalidArgumentException; -use Drupal\apigee_edge_teams\Structure\TeamPermission; use Drupal\Core\DependencyInjection\ClassResolverInterface; use Drupal\Core\Discovery\YamlDiscovery; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\apigee_edge_teams\Entity\TeamInterface; +use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; +use Drupal\apigee_edge_teams\Exception\InvalidArgumentException; +use Drupal\apigee_edge_teams\Structure\TeamPermission; /** * Provides the available team permissions based on yml files. diff --git a/modules/apigee_edge_teams/src/TeamPermissionHandlerInterface.php b/modules/apigee_edge_teams/src/TeamPermissionHandlerInterface.php index 3383609d..63489026 100644 --- a/modules/apigee_edge_teams/src/TeamPermissionHandlerInterface.php +++ b/modules/apigee_edge_teams/src/TeamPermissionHandlerInterface.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge_teams; -use Drupal\apigee_edge_teams\Entity\TeamInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\apigee_edge_teams\Entity\TeamInterface; /** * Defines an interface to list available team permissions. diff --git a/modules/apigee_edge_teams/src/User/RemoveTeamRolesOfUserSynchronousPostUserDeleteActionPerformer.php b/modules/apigee_edge_teams/src/User/RemoveTeamRolesOfUserSynchronousPostUserDeleteActionPerformer.php index 286267c7..68dda1aa 100644 --- a/modules/apigee_edge_teams/src/User/RemoveTeamRolesOfUserSynchronousPostUserDeleteActionPerformer.php +++ b/modules/apigee_edge_teams/src/User/RemoveTeamRolesOfUserSynchronousPostUserDeleteActionPerformer.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge_teams\User; -use Drupal\apigee_edge\User\PostUserDeleteActionPerformerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\User\PostUserDeleteActionPerformerInterface; use Drupal\user\UserInterface; -use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; +use Psr\Log\LoggerInterface; /** * Ensures team roles of the removed user also get deleted. diff --git a/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_invitation_test/src/EventSubscriber/TeamInvitationSubscriber.php b/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_invitation_test/src/EventSubscriber/TeamInvitationSubscriber.php index 3431ea76..6c3765db 100644 --- a/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_invitation_test/src/EventSubscriber/TeamInvitationSubscriber.php +++ b/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_invitation_test/src/EventSubscriber/TeamInvitationSubscriber.php @@ -20,7 +20,6 @@ namespace Drupal\apigee_edge_teams_invitation_test\EventSubscriber; -use Drupal\apigee_edge_teams\Event\TeamInvitationEvent; use Drupal\apigee_edge_teams\Event\TeamInvitationEventInterface; use Drupal\apigee_edge_teams\Event\TeamInvitationEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/src/TestTeamPermissions.php b/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/src/TestTeamPermissions.php index 0df4eea2..afd8faff 100644 --- a/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/src/TestTeamPermissions.php +++ b/modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/src/TestTeamPermissions.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge_teams_test; -use Drupal\apigee_edge_teams\DynamicTeamPermissionProviderInterface; -use Drupal\apigee_edge_teams\Structure\TeamPermission; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\apigee_edge_teams\DynamicTeamPermissionProviderInterface; +use Drupal\apigee_edge_teams\Structure\TeamPermission; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/apigee_edge_teams/tests/src/Functional/AccessTest.php b/modules/apigee_edge_teams/tests/src/Functional/AccessTest.php index 31a78c45..d4d7f3e1 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/AccessTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/AccessTest.php @@ -19,8 +19,8 @@ namespace Drupal\Tests\apigee_edge_teams\Functional; -use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; use Drupal\Core\Url; +use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Route; diff --git a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/AccessTest.php b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/AccessTest.php index 3b32a940..79b3a070 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/AccessTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/AccessTest.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge_teams\Functional\ApigeeX; use Apigee\Edge\Structure\AttributesProperty; +use Drupal\Core\Url; use Drupal\apigee_edge_teams\Entity\TeamApp; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Core\Url; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Route; @@ -237,7 +237,7 @@ protected function setUp(): void { 'name' => mb_strtolower($this->getRandomGenerator()->name()), 'attributes' => new AttributesProperty([ 'name' => '__apigee_reserved__developer_details', - 'value' => '[{\"developer\":\"doe@example.com\",\"roles\":[\"admin\"]}]' + 'value' => '[{\"developer\":\"doe@example.com\",\"roles\":[\"admin\"]}]', ]), ]); $this->team->save(); diff --git a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/ApigeeEdgeTeamsFunctionalTestBase.php b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/ApigeeEdgeTeamsFunctionalTestBase.php index 253045ff..43ce44b6 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/ApigeeEdgeTeamsFunctionalTestBase.php +++ b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/ApigeeEdgeTeamsFunctionalTestBase.php @@ -19,8 +19,8 @@ namespace Drupal\Tests\apigee_edge_teams\Functional\ApigeeX; -use Drupal\apigee_edge\OauthTokenFileStorage; use Drupal\Tests\apigee_edge\Functional\ApigeeX\ApigeeEdgeFunctionalTestBase; +use Drupal\apigee_edge\OauthTokenFileStorage; /** * Base class for Apigee Edge Teams functional tests. diff --git a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php index aa7c0a55..ecfc7557 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php @@ -19,10 +19,9 @@ namespace Drupal\Tests\apigee_edge_teams\Functional\ApigeeX; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Core\Url; -use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\views\Views; /** diff --git a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamListBuilderTest.php b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamListBuilderTest.php index 022235c8..76bd5c89 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamListBuilderTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamListBuilderTest.php @@ -19,8 +19,8 @@ namespace Drupal\Tests\apigee_edge_teams\Functional\ApigeeX; -use Drupal\apigee_edge\Entity\Developer; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\Developer; use Symfony\Component\HttpFoundation\Response; /** diff --git a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamMembershipManagerTest.php b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamMembershipManagerTest.php index 8f36948e..2b855676 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamMembershipManagerTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamMembershipManagerTest.php @@ -21,7 +21,6 @@ use Apigee\Edge\Structure\AttributesProperty; use Drupal\Core\Session\UserSession; -use Drupal\user\Entity\User; /** * Team membership manager service test. @@ -94,7 +93,7 @@ protected function setUp(): void { 'name' => $this->getRandomGenerator()->name(), 'attributes' => new AttributesProperty([ 'name' => '__apigee_reserved__developer_details', - 'value' => '[{\"developer\":\"doe@example.com\",\"roles\":[\"admin\"]}]' + 'value' => '[{\"developer\":\"doe@example.com\",\"roles\":[\"admin\"]}]', ]), ]); $this->team->save(); diff --git a/modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php b/modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php index 83e195e8..dd98d33d 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php @@ -20,11 +20,11 @@ namespace Drupal\Tests\apigee_edge_teams\Functional; +use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\apigee_edge\Entity\DeveloperAppInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Url; /** * Team-level API product access test. diff --git a/modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php b/modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php index f366ff3a..1a2996cb 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php @@ -19,9 +19,9 @@ namespace Drupal\Tests\apigee_edge_teams\Functional; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Core\Url; use Drupal\views\Views; /** diff --git a/modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php b/modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php index d6d7b4e6..cf02b753 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php @@ -19,8 +19,8 @@ namespace Drupal\Tests\apigee_edge_teams\Functional; -use Drupal\apigee_edge\Entity\Developer; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\Developer; use Symfony\Component\HttpFoundation\Response; /** diff --git a/modules/apigee_edge_teams/tests/src/FunctionalJavascript/ManageTeamAppsApiProductAccessTest.php b/modules/apigee_edge_teams/tests/src/FunctionalJavascript/ManageTeamAppsApiProductAccessTest.php index bb05dbf5..76c51f00 100644 --- a/modules/apigee_edge_teams/tests/src/FunctionalJavascript/ManageTeamAppsApiProductAccessTest.php +++ b/modules/apigee_edge_teams/tests/src/FunctionalJavascript/ManageTeamAppsApiProductAccessTest.php @@ -20,10 +20,10 @@ namespace Drupal\Tests\apigee_edge_teams\FunctionalJavascript; -use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\Core\Url; use Drupal\FunctionalJavascriptTests\WebDriverWebAssert; use Drupal\Tests\apigee_edge\FunctionalJavascript\ApigeeEdgeFunctionalJavascriptTestBase; +use Drupal\apigee_edge\Entity\ApiProductInterface; /** * Extra validation for API product access on team app forms. diff --git a/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Entity/TeamViewBuilderTest.php b/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Entity/TeamViewBuilderTest.php index 79e69890..e2e1921c 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Entity/TeamViewBuilderTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Entity/TeamViewBuilderTest.php @@ -58,7 +58,7 @@ class TeamViewBuilderTest extends ApigeeEdgeKernelTestBase { 'apigee_mock_api_client', 'key', 'user', - 'options' + 'options', ]; /** diff --git a/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Event/TeamInvitationEventsTest.php b/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Event/TeamInvitationEventsTest.php index b824b15c..d3110ec4 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Event/TeamInvitationEventsTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/ApigeeX/Event/TeamInvitationEventsTest.php @@ -20,12 +20,11 @@ namespace Drupal\Tests\apigee_edge_teams\Kernel\ApigeeX; -use Drupal\apigee_edge_teams\Entity\Team; +use Drupal\Tests\apigee_edge\Kernel\ApigeeX\ApigeeEdgeKernelTestBase; +use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\apigee_edge_teams\Entity\TeamInvitation; use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Tests\apigee_edge\Kernel\ApigeeX\ApigeeEdgeKernelTestBase; -use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; /** * Tests team_invitation events. diff --git a/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php b/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php index c4dd0f4e..308d2d06 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/Entity/TeamViewBuilderTest.php @@ -58,7 +58,7 @@ class TeamViewBuilderTest extends ApigeeEdgeKernelTestBase { 'apigee_mock_api_client', 'key', 'user', - 'options' + 'options', ]; /** diff --git a/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php b/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php index ae0a63fe..33935698 100644 --- a/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php +++ b/modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php @@ -20,12 +20,11 @@ namespace Drupal\Tests\apigee_edge_teams\Kernel; -use Drupal\apigee_edge_teams\Entity\Team; +use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; +use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\apigee_edge_teams\Entity\TeamInvitation; use Drupal\apigee_edge_teams\Entity\TeamInvitationInterface; use Drupal\apigee_edge_teams\Entity\TeamRoleInterface; -use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; -use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; /** * Tests team_invitation events. diff --git a/src/Annotation/EdgeEntityType.php b/src/Annotation/EdgeEntityType.php index de7b6e28..aafa0784 100644 --- a/src/Annotation/EdgeEntityType.php +++ b/src/Annotation/EdgeEntityType.php @@ -19,9 +19,9 @@ namespace Drupal\apigee_edge\Annotation; -use Drupal\apigee_edge\Entity\EdgeEntityType as EntityEdgeEntityType; use Drupal\Core\Entity\Annotation\EntityType; use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\apigee_edge\Entity\EdgeEntityType as EntityEdgeEntityType; /** * Defines an Apigee Edge entity type annotation object. diff --git a/src/Commands/ApigeeEdgeCommands.php b/src/Commands/ApigeeEdgeCommands.php index 91ef47a4..17840487 100644 --- a/src/Commands/ApigeeEdgeCommands.php +++ b/src/Commands/ApigeeEdgeCommands.php @@ -41,7 +41,7 @@ class ApigeeEdgeCommands extends DrushCommands { * @param \Drupal\apigee_edge\CliServiceInterface $cli_service * The CLI service which allows interoperability. */ - public function __construct(CliServiceInterface $cli_service = NULL) { + public function __construct(?CliServiceInterface $cli_service = NULL) { parent::__construct(); $this->cliService = $cli_service; } diff --git a/src/Controller/DeveloperAppViewControllerForDeveloper.php b/src/Controller/DeveloperAppViewControllerForDeveloper.php index 78f0d3f5..eec1eda8 100644 --- a/src/Controller/DeveloperAppViewControllerForDeveloper.php +++ b/src/Controller/DeveloperAppViewControllerForDeveloper.php @@ -19,9 +19,9 @@ namespace Drupal\apigee_edge\Controller; -use Drupal\apigee_edge\Entity\DeveloperAppInterface; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\apigee_edge\Entity\DeveloperAppInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Controller/DeveloperSyncController.php b/src/Controller/DeveloperSyncController.php index fa01e2b5..0485a93c 100644 --- a/src/Controller/DeveloperSyncController.php +++ b/src/Controller/DeveloperSyncController.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge\Controller; +use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\Messenger\MessengerInterface; use Drupal\apigee_edge\Job\DeveloperSync; use Drupal\apigee_edge\Job\Job; use Drupal\apigee_edge\JobExecutorInterface; -use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Messenger\MessengerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Controller/EdgeEntityFieldConfigListController.php b/src/Controller/EdgeEntityFieldConfigListController.php index be3b406b..b5849411 100644 --- a/src/Controller/EdgeEntityFieldConfigListController.php +++ b/src/Controller/EdgeEntityFieldConfigListController.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge\Controller; -use Drupal\apigee_edge\Event\EdgeEntityFieldConfigListAlterEvent; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\apigee_edge\Event\EdgeEntityFieldConfigListAlterEvent; use Drupal\field_ui\Controller\FieldConfigListController; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -60,7 +60,7 @@ public static function create(ContainerInterface $container) { /** * {@inheritdoc} */ - public function listing($entity_type_id = NULL, $bundle = NULL, RouteMatchInterface $route_match = NULL) { + public function listing($entity_type_id = NULL, $bundle = NULL, ?RouteMatchInterface $route_match = NULL) { $page = parent::listing($entity_type_id, $bundle, $route_match); $event = new EdgeEntityFieldConfigListAlterEvent($entity_type_id, $page); $this->eventDispatcher->dispatch($event, EdgeEntityFieldConfigListAlterEvent::EVENT_NAME); diff --git a/src/Credentials.php b/src/Credentials.php index ee21acaa..44832007 100644 --- a/src/Credentials.php +++ b/src/Credentials.php @@ -26,7 +26,7 @@ /** * The API credentials. * - * @todo: move to \Drupal\apigee_edge\Connector namespace. + * @todo move to \Drupal\apigee_edge\Connector namespace. */ class Credentials implements CredentialsInterface { diff --git a/src/CredentialsInterface.php b/src/CredentialsInterface.php index 160b586b..f57cd186 100644 --- a/src/CredentialsInterface.php +++ b/src/CredentialsInterface.php @@ -26,7 +26,7 @@ /** * Defines an interface for credentials classes. * - * @todo: move to \Drupal\apigee_edge\Connector namespace. + * @todo move to \Drupal\apigee_edge\Connector namespace. */ interface CredentialsInterface { diff --git a/src/Entity/App.php b/src/Entity/App.php index f274ae9e..2983ba05 100644 --- a/src/Entity/App.php +++ b/src/Entity/App.php @@ -25,7 +25,6 @@ use Apigee\Edge\Structure\AttributesProperty; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\BaseFieldDefinition; -use Drupal\Core\Url; /** * Base class for App Drupal entities. diff --git a/src/Entity/AppTitleProvider.php b/src/Entity/AppTitleProvider.php index 3696c588..9abdaead 100644 --- a/src/Entity/AppTitleProvider.php +++ b/src/Entity/AppTitleProvider.php @@ -39,7 +39,7 @@ class AppTitleProvider extends EdgeEntityTitleProvider { * @return string|null * The title for the app analytics page, null if an entity was found. */ - public function analyticsTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function analyticsTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('Analytics of %label @entity_type', [ '%label' => $entity->label(), @@ -51,7 +51,7 @@ public function analyticsTitle(RouteMatchInterface $route_match, EntityInterface /** * {@inheritdoc} */ - protected function doGetEntity(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + protected function doGetEntity(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($_entity) { $entity = $_entity; } diff --git a/src/Entity/AppViewBuilder.php b/src/Entity/AppViewBuilder.php index c31ddb91..bd94be05 100644 --- a/src/Entity/AppViewBuilder.php +++ b/src/Entity/AppViewBuilder.php @@ -20,9 +20,6 @@ namespace Drupal\apigee_edge\Entity; -use Drupal\Core\Render\Element; -use Drupal\Core\Url; - /** * Common app view builder for developer- and company (team) apps. */ diff --git a/src/Entity/AttributesAwareFieldableEdgeEntityBase.php b/src/Entity/AttributesAwareFieldableEdgeEntityBase.php index 2219a550..d22080bb 100644 --- a/src/Entity/AttributesAwareFieldableEdgeEntityBase.php +++ b/src/Entity/AttributesAwareFieldableEdgeEntityBase.php @@ -22,9 +22,9 @@ use Apigee\Edge\Entity\EntityInterface; use Apigee\Edge\Entity\Property\AttributesPropertyInterface; +use Drupal\Core\Field\BaseFieldDefinition; use Drupal\apigee_edge\Exception\InvalidArgumentException; use Drupal\apigee_edge\FieldAttributeConverterInterface; -use Drupal\Core\Field\BaseFieldDefinition; /** * For fieldable Edge entities that can use attributes as field storage. diff --git a/src/Entity/Controller/AppController.php b/src/Entity/Controller/AppController.php index e7c546ff..216f29f3 100644 --- a/src/Entity/Controller/AppController.php +++ b/src/Entity/Controller/AppController.php @@ -131,7 +131,7 @@ public function loadAppGroup(string $app_id): AppInterface { /** * {@inheritdoc} */ - public function listAppIds(PagerInterface $pager = NULL): array { + public function listAppIds(?PagerInterface $pager = NULL): array { if ($this->appIdCache->isAllIdsInCache()) { if ($pager === NULL) { return $this->appIdCache->getIds(); @@ -150,7 +150,7 @@ public function listAppIds(PagerInterface $pager = NULL): array { /** * {@inheritdoc} */ - public function listApps(bool $include_credentials = FALSE, PagerInterface $pager = NULL): array { + public function listApps(bool $include_credentials = FALSE, ?PagerInterface $pager = NULL): array { // If all entities in the cache and apps with credentials should be // returned. if ($this->appCache->isAllEntitiesInCache() && $include_credentials === TRUE) { @@ -197,7 +197,7 @@ public function listApps(bool $include_credentials = FALSE, PagerInterface $page /** * {@inheritdoc} */ - public function listAppIdsByStatus(string $status, PagerInterface $pager = NULL): array { + public function listAppIdsByStatus(string $status, ?PagerInterface $pager = NULL): array { $apps_from_cache = $this->getAppsFromCacheByStatus($status, $pager); if ($apps_from_cache !== NULL) { return array_map(function (AppInterface $app) { @@ -211,7 +211,7 @@ public function listAppIdsByStatus(string $status, PagerInterface $pager = NULL) /** * {@inheritdoc} */ - public function listAppsByStatus(string $status, bool $include_credentials = TRUE, PagerInterface $pager = NULL): array { + public function listAppsByStatus(string $status, bool $include_credentials = TRUE, ?PagerInterface $pager = NULL): array { $apps_from_cache = $this->getAppsFromCacheByStatus($status, $pager); if ($apps_from_cache !== NULL) { return $apps_from_cache; @@ -239,7 +239,7 @@ public function listAppsByStatus(string $status, bool $include_credentials = TRU * If not all apps in the cache it returns null, otherwise it returns the * required amount of apps from the cache. */ - private function getAppsFromCacheByStatus(string $status, PagerInterface $pager = NULL): ?array { + private function getAppsFromCacheByStatus(string $status, ?PagerInterface $pager = NULL): ?array { $apps = NULL; if ($this->appCache->isAllEntitiesInCache()) { if ($pager === NULL) { @@ -260,14 +260,14 @@ private function getAppsFromCacheByStatus(string $status, PagerInterface $pager /** * {@inheritdoc} */ - public function listAppIdsByType(string $app_type, PagerInterface $pager = NULL): array { + public function listAppIdsByType(string $app_type, ?PagerInterface $pager = NULL): array { return $this->decorated()->listAppIdsByType($app_type, $pager); } /** * {@inheritdoc} */ - public function listAppIdsByFamily(string $app_family, PagerInterface $pager = NULL): array { + public function listAppIdsByFamily(string $app_family, ?PagerInterface $pager = NULL): array { return $this->decorated()->listAppIdsByFamily($app_family, $pager); } diff --git a/src/Entity/Controller/AppCredentialControllerBase.php b/src/Entity/Controller/AppCredentialControllerBase.php index aa9817dc..804a21e7 100644 --- a/src/Entity/Controller/AppCredentialControllerBase.php +++ b/src/Entity/Controller/AppCredentialControllerBase.php @@ -203,7 +203,7 @@ public function generate(array $api_products, AttributesProperty $app_attributes * {@inheritdoc} */ public function getAttribute(string $entity_id, string $name): string { - // TODO Get this from cache if available. + // @todo Get this from cache if available. return $this->decorated()->getAttribute($entity_id, $name); } @@ -211,7 +211,7 @@ public function getAttribute(string $entity_id, string $name): string { * {@inheritdoc} */ public function getAttributes(string $entity_id): AttributesProperty { - // TODO Get this from cache if available. + // @todo Get this from cache if available. return $this->decorated()->getAttributes($entity_id); } @@ -226,7 +226,7 @@ public function getOrganisationName(): string { * {@inheritdoc} */ public function load(string $consumer_key): AppCredentialInterface { - // TODO Get this from app cache if available. + // @todo Get this from app cache if available. return $this->decorated()->load($consumer_key); } diff --git a/src/Entity/Controller/Cache/DeveloperAppCacheFactory.php b/src/Entity/Controller/Cache/DeveloperAppCacheFactory.php index 5a4ee1cd..248ba254 100644 --- a/src/Entity/Controller/Cache/DeveloperAppCacheFactory.php +++ b/src/Entity/Controller/Cache/DeveloperAppCacheFactory.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge\Entity\Controller\Cache; -use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; /** * Developer specific app cache by app owner factory service. diff --git a/src/Entity/Controller/Cache/DeveloperAppNameCacheFactory.php b/src/Entity/Controller/Cache/DeveloperAppNameCacheFactory.php index 7f52ae91..8c531ea6 100644 --- a/src/Entity/Controller/Cache/DeveloperAppNameCacheFactory.php +++ b/src/Entity/Controller/Cache/DeveloperAppNameCacheFactory.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge\Entity\Controller\Cache; -use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; /** * Developer specific app name cache by app owner factory service. diff --git a/src/Entity/Controller/CachedPaginatedEntityIdListingControllerTrait.php b/src/Entity/Controller/CachedPaginatedEntityIdListingControllerTrait.php index 8d12c72c..12106ae3 100644 --- a/src/Entity/Controller/CachedPaginatedEntityIdListingControllerTrait.php +++ b/src/Entity/Controller/CachedPaginatedEntityIdListingControllerTrait.php @@ -57,7 +57,7 @@ abstract protected function extractSubsetOfAssociativeArray(array $assoc_array, /** * {@inheritdoc} */ - public function getEntityIds(PagerInterface $pager = NULL): array { + public function getEntityIds(?PagerInterface $pager = NULL): array { if ($this->entityIdCache()->isAllIdsInCache()) { if ($pager === NULL) { return $this->entityIdCache()->getIds(); diff --git a/src/Entity/Controller/CachedPaginatedEntityListingControllerTrait.php b/src/Entity/Controller/CachedPaginatedEntityListingControllerTrait.php index 190d5194..aec274ca 100644 --- a/src/Entity/Controller/CachedPaginatedEntityListingControllerTrait.php +++ b/src/Entity/Controller/CachedPaginatedEntityListingControllerTrait.php @@ -45,7 +45,7 @@ abstract protected function decorated(); /** * {@inheritdoc} */ - public function getEntities(PagerInterface $pager = NULL, string $key_provider = 'id'): array { + public function getEntities(?PagerInterface $pager = NULL, string $key_provider = 'id'): array { if ($this->entityCache()->isAllEntitiesInCache()) { if ($pager === NULL) { return $this->entityCache()->getEntities(); diff --git a/src/Entity/Controller/DeveloperAppEdgeEntityControllerProxy.php b/src/Entity/Controller/DeveloperAppEdgeEntityControllerProxy.php index a2198097..0269d570 100644 --- a/src/Entity/Controller/DeveloperAppEdgeEntityControllerProxy.php +++ b/src/Entity/Controller/DeveloperAppEdgeEntityControllerProxy.php @@ -23,7 +23,6 @@ use Apigee\Edge\Api\Management\Entity\AppInterface; use Apigee\Edge\Api\Management\Entity\DeveloperAppInterface; use Apigee\Edge\Entity\EntityInterface; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\apigee_edge\Exception\RuntimeException; /** diff --git a/src/Entity/Developer.php b/src/Entity/Developer.php index de023c58..53f1a1a4 100644 --- a/src/Entity/Developer.php +++ b/src/Entity/Developer.php @@ -24,12 +24,9 @@ use Apigee\Edge\Entity\EntityInterface as EdgeEntityInterface; use Apigee\Edge\Exception\ApiException; use Apigee\Edge\Structure\AttributesProperty; -use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; -use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\apigee_edge_teams\Entity\TeamMemberRole; use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Session\AccountInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; use Drupal\user\Entity\User; use Drupal\user\UserInterface; @@ -122,7 +119,7 @@ class Developer extends EdgeEntityBase implements DeveloperInterface { * @param \Apigee\Edge\Entity\EntityInterface|null $decorated * The SDK entity that this Drupal entity decorates. */ - public function __construct(array $values, ?string $entity_type = NULL, EdgeEntityInterface $decorated = NULL) { + public function __construct(array $values, ?string $entity_type = NULL, ?EdgeEntityInterface $decorated = NULL) { $entity_type = $entity_type ?? 'developer'; // Callers expect that the status is always either 'active' or 'inactive', // never null. diff --git a/src/Entity/DeveloperApp.php b/src/Entity/DeveloperApp.php index 11e195ba..6713ea3e 100644 --- a/src/Entity/DeveloperApp.php +++ b/src/Entity/DeveloperApp.php @@ -22,8 +22,8 @@ use Apigee\Edge\Api\Management\Entity\DeveloperApp as EdgeDeveloperApp; use Apigee\Edge\Entity\EntityInterface as EdgeEntityInterface; -use Drupal\apigee_edge\Exception\InvalidArgumentException; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Exception\InvalidArgumentException; use Drupal\user\Entity\User; use Drupal\user\UserInterface; diff --git a/src/Entity/DeveloperAppRouteProvider.php b/src/Entity/DeveloperAppRouteProvider.php index c815ee5a..d5458e9c 100644 --- a/src/Entity/DeveloperAppRouteProvider.php +++ b/src/Entity/DeveloperAppRouteProvider.php @@ -20,6 +20,7 @@ namespace Drupal\apigee_edge\Entity; +use Drupal\Core\Entity\EntityTypeInterface; use Drupal\apigee_edge\Access\AppsPageAccessCheck; use Drupal\apigee_edge\Controller\DeveloperAppKeysController; use Drupal\apigee_edge\Controller\DeveloperAppViewControllerForDeveloper; @@ -28,7 +29,6 @@ use Drupal\apigee_edge\Form\DeveloperAppApiKeyAddForm; use Drupal\apigee_edge\Form\DeveloperAppApiKeyDeleteForm; use Drupal\apigee_edge\Form\DeveloperAppApiKeyRevokeForm; -use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\Routing\Route; /** diff --git a/src/Entity/DeveloperCompaniesCache.php b/src/Entity/DeveloperCompaniesCache.php index 1e550e5b..c90f5e2f 100644 --- a/src/Entity/DeveloperCompaniesCache.php +++ b/src/Entity/DeveloperCompaniesCache.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge\Entity; -use Drupal\apigee_edge\MemoryCacheFactoryInterface; use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\apigee_edge\MemoryCacheFactoryInterface; /** * Default non-persistent developer company membership cache implementation. diff --git a/src/Entity/EdgeEntityBase.php b/src/Entity/EdgeEntityBase.php index b6f5499b..f0ae2af0 100644 --- a/src/Entity/EdgeEntityBase.php +++ b/src/Entity/EdgeEntityBase.php @@ -22,8 +22,8 @@ use Apigee\Edge\Entity\EntityInterface; use Apigee\Edge\Entity\Property\DisplayNamePropertyInterface; -use Drupal\apigee_edge\Exception\InvalidArgumentException; use Drupal\Core\Entity\EntityBase; +use Drupal\apigee_edge\Exception\InvalidArgumentException; /** * Base class for Apigee Edge entities in Drupal. diff --git a/src/Entity/EdgeEntityTitleProvider.php b/src/Entity/EdgeEntityTitleProvider.php index 981a528f..154a55a3 100644 --- a/src/Entity/EdgeEntityTitleProvider.php +++ b/src/Entity/EdgeEntityTitleProvider.php @@ -32,7 +32,7 @@ class EdgeEntityTitleProvider extends EntityController { /** * {@inheritdoc} */ - public function title(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function title(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('@label @entity_type', [ '@label' => $entity->label(), @@ -45,7 +45,7 @@ public function title(RouteMatchInterface $route_match, EntityInterface $_entity /** * {@inheritdoc} */ - public function editTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function editTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { return $this->t('Edit %label @entity_type', [ '%label' => $entity->label(), @@ -58,9 +58,9 @@ public function editTitle(RouteMatchInterface $route_match, EntityInterface $_en /** * {@inheritdoc} */ - public function deleteTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) { + public function deleteTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) { if ($entity = $this->doGetEntity($route_match, $_entity)) { - // TODO Investigate why entity delete forms (confirm forms) does not + // @todo Investigate why entity delete forms (confirm forms) does not // display this as a page title. This issue also existed before. return $this->t('Delete %label @entity_type', [ '%label' => $entity->label(), diff --git a/src/Entity/EdgeEntityType.php b/src/Entity/EdgeEntityType.php index 2d0cd61b..3f2ffcd9 100644 --- a/src/Entity/EdgeEntityType.php +++ b/src/Entity/EdgeEntityType.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge\Entity; -use Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder; -use Drupal\apigee_edge\Exception\RuntimeException; use Drupal\Core\Config\ImmutableConfig; use Drupal\Core\Entity\EntityType; use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder; +use Drupal\apigee_edge\Exception\RuntimeException; /** * Provides an implementation of an Apigee Edge entity type and its metadata. diff --git a/src/Entity/Enhancer/AppRouteEnhancer.php b/src/Entity/Enhancer/AppRouteEnhancer.php index 774a72ee..8b0c978f 100644 --- a/src/Entity/Enhancer/AppRouteEnhancer.php +++ b/src/Entity/Enhancer/AppRouteEnhancer.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge\Entity\Enhancer; -use Drupal\apigee_edge\Entity\AppInterface; use Drupal\Core\Routing\EnhancerInterface; +use Drupal\apigee_edge\Entity\AppInterface; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/Entity/FieldableEdgeEntityBase.php b/src/Entity/FieldableEdgeEntityBase.php index 431391d0..129d0f0e 100644 --- a/src/Entity/FieldableEdgeEntityBase.php +++ b/src/Entity/FieldableEdgeEntityBase.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\Entity; -use Drupal\apigee_edge\Exception\InvalidArgumentException; use Drupal\Core\Entity\EntityConstraintViolationList; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\apigee_edge\Exception\InvalidArgumentException; /** * Base field support for Apigee Entities without making them content entities. diff --git a/src/Entity/Form/AppCreateForm.php b/src/Entity/Form/AppCreateForm.php index 1fe8a8f2..1d3b2f37 100644 --- a/src/Entity/Form/AppCreateForm.php +++ b/src/Entity/Form/AppCreateForm.php @@ -21,9 +21,6 @@ namespace Drupal\apigee_edge\Entity\Form; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Entity\ApiProductInterface; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; @@ -31,6 +28,9 @@ use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Url; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\ApiProductInterface; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Entity/Form/AppEditForm.php b/src/Entity/Form/AppEditForm.php index f3f92533..50c0b9fe 100644 --- a/src/Entity/Form/AppEditForm.php +++ b/src/Entity/Form/AppEditForm.php @@ -22,14 +22,14 @@ use Apigee\Edge\Api\Management\Entity\AppCredentialInterface; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Element\StatusPropertyElement; -use Drupal\apigee_edge\Entity\ApiProductInterface; -use Drupal\apigee_edge\Entity\AppInterface; use Drupal\Component\Utility\Xss; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Element\StatusPropertyElement; +use Drupal\apigee_edge\Entity\ApiProductInterface; +use Drupal\apigee_edge\Entity\AppInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Entity/Form/AppForm.php b/src/Entity/Form/AppForm.php index ea74d7e5..6283ff1d 100644 --- a/src/Entity/Form/AppForm.php +++ b/src/Entity/Form/AppForm.php @@ -20,9 +20,6 @@ namespace Drupal\apigee_edge\Entity\Form; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; -use Drupal\apigee_edge\Entity\Storage\EdgeEntityStorageBase; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -31,6 +28,9 @@ use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Url; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; +use Drupal\apigee_edge\Entity\Storage\EdgeEntityStorageBase; /** * Base entity form for developer- and team (company) app create/edit forms. diff --git a/src/Entity/Form/DeveloperAppCreateForm.php b/src/Entity/Form/DeveloperAppCreateForm.php index 5df56267..6e0bba99 100644 --- a/src/Entity/Form/DeveloperAppCreateForm.php +++ b/src/Entity/Form/DeveloperAppCreateForm.php @@ -20,14 +20,14 @@ namespace Drupal\apigee_edge\Entity\Form; -use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; -use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; -use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\RendererInterface; +use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; +use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; +use Drupal\apigee_edge\Entity\Controller\DeveloperControllerInterface; use Drupal\user\UserInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Entity/Form/DeveloperAppCreateFormBase.php b/src/Entity/Form/DeveloperAppCreateFormBase.php index fd342070..e551dfe1 100644 --- a/src/Entity/Form/DeveloperAppCreateFormBase.php +++ b/src/Entity/Form/DeveloperAppCreateFormBase.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge\Entity\Form; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Entity/Form/DeveloperAppCreateFormForDeveloper.php b/src/Entity/Form/DeveloperAppCreateFormForDeveloper.php index 9cd88bab..ba06a11f 100644 --- a/src/Entity/Form/DeveloperAppCreateFormForDeveloper.php +++ b/src/Entity/Form/DeveloperAppCreateFormForDeveloper.php @@ -38,7 +38,7 @@ class DeveloperAppCreateFormForDeveloper extends DeveloperAppCreateFormBase { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, UserInterface $user = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, ?UserInterface $user = NULL) { // This is the only place where we can grab additional route parameters. // See implementation in parent. $this->user = $user; diff --git a/src/Entity/Form/DeveloperAppEditForm.php b/src/Entity/Form/DeveloperAppEditForm.php index baf78777..d79a63b7 100644 --- a/src/Entity/Form/DeveloperAppEditForm.php +++ b/src/Entity/Form/DeveloperAppEditForm.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\Entity\Form; -use Drupal\apigee_edge\Entity\ApiProductInterface; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; -use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\RendererInterface; +use Drupal\apigee_edge\Entity\ApiProductInterface; +use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; +use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Entity/Form/DeveloperAppFormTrait.php b/src/Entity/Form/DeveloperAppFormTrait.php index 7792556d..a9e8f530 100644 --- a/src/Entity/Form/DeveloperAppFormTrait.php +++ b/src/Entity/Form/DeveloperAppFormTrait.php @@ -22,11 +22,11 @@ use Apigee\Edge\Exception\ApiException; use Apigee\Edge\Exception\ClientErrorException; -use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\ApiProductInterface; /** * Helper trait that contains developer app (create/edit) form specific tweaks. @@ -48,7 +48,7 @@ public static function appExists(string $name, array $element, FormStateInterfac } // Return TRUE if developer account has not been found for this Drupal user. - // TODO Make sure that DeveloperAppCreateEditFormForDeveloper can be + // @todo Make sure that DeveloperAppCreateEditFormForDeveloper can be // used only if the Drupal user in the route has a developer account // in Apigee Edge. if ($form_state->getValue('owner') === NULL) { diff --git a/src/Entity/Form/FieldableEdgeEntityForm.php b/src/Entity/Form/FieldableEdgeEntityForm.php index e57332ea..e1c31c16 100644 --- a/src/Entity/Form/FieldableEdgeEntityForm.php +++ b/src/Entity/Form/FieldableEdgeEntityForm.php @@ -65,7 +65,7 @@ public function form(array $form, FormStateInterface $form_state) { /** * {@inheritdoc} * - * TODO Add missing return type-hint in 2.x. + * @todo Add missing return type-hint in 2.x. */ public function validateForm(array &$form, FormStateInterface $form_state) { parent::validateForm($form, $form_state); diff --git a/src/Entity/ListBuilder/AppListBuilder.php b/src/Entity/ListBuilder/AppListBuilder.php index c1263f6e..85e3c178 100644 --- a/src/Entity/ListBuilder/AppListBuilder.php +++ b/src/Entity/ListBuilder/AppListBuilder.php @@ -20,8 +20,6 @@ namespace Drupal\apigee_edge\Entity\ListBuilder; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\AppWarningsCheckerInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\NestedArray; @@ -32,6 +30,8 @@ use Drupal\Core\Link; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\AppWarningsCheckerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -94,7 +94,7 @@ class AppListBuilder extends EdgeEntityListBuilder { * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker * The app warnings checker service. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } diff --git a/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php b/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php index afe9cd00..051aa51b 100644 --- a/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php +++ b/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php @@ -20,9 +20,6 @@ namespace Drupal\apigee_edge\Entity\ListBuilder; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\AppWarningsCheckerInterface; -use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Drupal\Component\Datetime\TimeInterface; use Drupal\Component\Utility\Html; use Drupal\Core\Config\ConfigFactoryInterface; @@ -37,6 +34,9 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\AppWarningsCheckerInterface; +use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RequestStack; @@ -89,7 +89,7 @@ class DeveloperAppListBuilderForDeveloper extends AppListBuilder implements Cont * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker * The app warnings checker service. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } diff --git a/src/Entity/ListBuilder/EdgeEntityListBuilder.php b/src/Entity/ListBuilder/EdgeEntityListBuilder.php index aefbed1d..7fdc0be8 100644 --- a/src/Entity/ListBuilder/EdgeEntityListBuilder.php +++ b/src/Entity/ListBuilder/EdgeEntityListBuilder.php @@ -69,7 +69,7 @@ class EdgeEntityListBuilder extends EntityListBuilder { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory = NULL) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, ?ConfigFactoryInterface $config_factory = NULL) { parent::__construct($entity_type, $entity_type_manager->getStorage($entity_type->id())); $this->entityTypeManager = $entity_type_manager; diff --git a/src/Entity/Query/AppQueryBase.php b/src/Entity/Query/AppQueryBase.php index c1357a67..c9a8a410 100644 --- a/src/Entity/Query/AppQueryBase.php +++ b/src/Entity/Query/AppQueryBase.php @@ -90,7 +90,7 @@ protected function getFromStorage(): array { } } } - // TODO Add support to IN conditions (multiple app names) when it + // @todo Add support to IN conditions (multiple app names) when it // becomes necessary. elseif ($condition['field'] === 'name' && in_array($condition['operator'], [NULL, '='])) { $app_name_found = FALSE; diff --git a/src/Entity/Storage/ApiProductStorage.php b/src/Entity/Storage/ApiProductStorage.php index c579bd64..1b9dfd87 100644 --- a/src/Entity/Storage/ApiProductStorage.php +++ b/src/Entity/Storage/ApiProductStorage.php @@ -19,16 +19,16 @@ namespace Drupal\apigee_edge\Entity\Storage; -use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; -use Drupal\apigee_edge\Entity\Controller\CachedManagementApiEdgeEntityControllerProxy; -use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; -use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; -use Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\Controller\ApiProductControllerInterface; +use Drupal\apigee_edge\Entity\Controller\CachedManagementApiEdgeEntityControllerProxy; +use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; +use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; +use Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Entity/Storage/AppStorage.php b/src/Entity/Storage/AppStorage.php index f16d5d89..a8ade75d 100644 --- a/src/Entity/Storage/AppStorage.php +++ b/src/Entity/Storage/AppStorage.php @@ -20,16 +20,16 @@ namespace Drupal\apigee_edge\Entity\Storage; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Controller\AppControllerInterface; -use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; -use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Controller\AppControllerInterface; +use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; +use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -106,7 +106,7 @@ public function loadUnchanged($id) { * @return \Drupal\apigee_edge\Entity\AppInterface|null * The unchanged entity, or NULL if the entity cannot be loaded. * - * @TODO: this method should be also available in the AppStorageInterface, but + * @todo this method should be also available in the AppStorageInterface, but * that would be a breaking change, so we can only add that in the next * major version of the module. */ @@ -138,7 +138,7 @@ protected function initFieldValues(FieldableEdgeEntityInterface $entity, array $ /** * {@inheritdoc} */ - protected function getFromStorage(array $ids = NULL) { + protected function getFromStorage(?array $ids = NULL) { // Try to load entities from the entity controller's static cache. if (!empty($ids)) { // If $ids are developer app ids (UUIDs) let's check whether all (SDK) @@ -208,7 +208,7 @@ abstract protected function getCacheTagsByOwner(AppInterface $app): array; /** * {@inheritdoc} */ - public function resetCache(array $ids = NULL) { + public function resetCache(?array $ids = NULL) { parent::resetCache($ids); if ($this->entityType->isStaticallyCacheable() && $ids) { $tags = []; diff --git a/src/Entity/Storage/DeveloperAppStorage.php b/src/Entity/Storage/DeveloperAppStorage.php index 62e63416..2f1fdf63 100644 --- a/src/Entity/Storage/DeveloperAppStorage.php +++ b/src/Entity/Storage/DeveloperAppStorage.php @@ -20,18 +20,18 @@ namespace Drupal\apigee_edge\Entity\Storage; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Controller\AppControllerInterface; -use Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactoryInterface; -use Drupal\apigee_edge\Entity\Controller\DeveloperAppEdgeEntityControllerProxy; -use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; -use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\MemoryCache\MemoryCacheInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Controller\AppControllerInterface; +use Drupal\apigee_edge\Entity\Controller\DeveloperAppControllerFactoryInterface; +use Drupal\apigee_edge\Entity\Controller\DeveloperAppEdgeEntityControllerProxy; +use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; +use Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Entity/Storage/DeveloperStorage.php b/src/Entity/Storage/DeveloperStorage.php index 0955b339..6b72330e 100644 --- a/src/Entity/Storage/DeveloperStorage.php +++ b/src/Entity/Storage/DeveloperStorage.php @@ -21,11 +21,6 @@ use Apigee\Edge\Api\Management\Controller\DeveloperControllerInterface; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Entity\Controller\CachedManagementApiEdgeEntityControllerProxy; -use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; -use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; -use Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy; -use Drupal\apigee_edge\Entity\DeveloperCompaniesCacheInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; @@ -34,6 +29,11 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\Controller\CachedManagementApiEdgeEntityControllerProxy; +use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; +use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; +use Drupal\apigee_edge\Entity\Controller\ManagementApiEdgeEntityControllerProxy; +use Drupal\apigee_edge\Entity\DeveloperCompaniesCacheInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -116,7 +116,7 @@ protected function entityController(): EdgeEntityControllerInterface { * * @see \Drupal\Core\Entity\EntityStorageBase::loadMultiple() */ - public function loadMultiple(array $ids = NULL) { + public function loadMultiple(?array $ids = NULL) { $entities = parent::loadMultiple($ids); if ($ids) { $entities_by_developer_id = array_reduce($entities, function ($carry, $item) { @@ -156,7 +156,7 @@ protected function doSave($id, EntityInterface $entity) { $entity->resetOriginalEmail(); } // Change the status of the developer in Apigee Edge. - // TODO Only change it if it has changed. + // @todo Only change it if it has changed. try { $this->developerController->setStatus($entity->id(), $developer_status); } @@ -248,7 +248,7 @@ protected function setPersistentCache(array $entities) { /** * {@inheritdoc} */ - public function resetCache(array $ids = NULL) { + public function resetCache(?array $ids = NULL) { parent::resetCache($ids); // Ensure that if ids contains email addresses we also invalidate cache diff --git a/src/Entity/Storage/EdgeEntityStorageBase.php b/src/Entity/Storage/EdgeEntityStorageBase.php index 0fe6193e..6283a5de 100644 --- a/src/Entity/Storage/EdgeEntityStorageBase.php +++ b/src/Entity/Storage/EdgeEntityStorageBase.php @@ -22,9 +22,6 @@ use Apigee\Edge\Entity\EntityInterface as SdkEntityInterface; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; -use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; -use Drupal\apigee_edge\Entity\EdgeEntityInterface as DrupalEdgeEntityInterface; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; @@ -33,6 +30,9 @@ use Drupal\Core\Entity\EntityStorageBase as DrupalEntityStorageBase; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\Controller\EdgeEntityControllerInterface; +use Drupal\apigee_edge\Entity\Controller\EntityCacheAwareControllerInterface; +use Drupal\apigee_edge\Entity\EdgeEntityInterface as DrupalEdgeEntityInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -107,7 +107,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI /** * {@inheritdoc} */ - protected function doLoadMultiple(array $ids = NULL) { + protected function doLoadMultiple(?array $ids = NULL) { // Attempt to load entities from the persistent cache. This will remove IDs // that were loaded from $ids. $entities_from_cache = $this->getFromPersistentCache($ids); @@ -248,7 +248,7 @@ protected function createNewInstance(SdkEntityInterface $sdk_entity): DrupalEdge * * @throws \Drupal\Core\Entity\EntityStorageException */ - protected function getFromStorage(array $ids = NULL) { + protected function getFromStorage(?array $ids = NULL) { $entities = []; // If ids is an empty array there is nothing to do. @@ -262,7 +262,7 @@ protected function getFromStorage(array $ids = NULL) { $tmp = []; // Speed up things by loading only one entity. if ($ids !== NULL && count($ids) === 1) { - // TODO When user's email changes do not ask Apigee Edge 3 times + // @todo When user's email changes do not ask Apigee Edge 3 times // whether a developer exists with the new email address or not. try { $entity = $controller->load(reset($ids)); @@ -358,7 +358,7 @@ protected function invokeStorageLoadHook(array &$entities) { * @return \Drupal\Core\Entity\EntityInterface[] * Array of entities from the persistent cache. */ - protected function getFromPersistentCache(array &$ids = NULL) { + protected function getFromPersistentCache(?array &$ids = NULL) { if (!$this->entityType->isPersistentlyCacheable() || empty($ids)) { return []; } @@ -450,7 +450,7 @@ protected function buildCacheId($id) { /** * {@inheritdoc} */ - public function resetCache(array $ids = NULL) { + public function resetCache(?array $ids = NULL) { if ($this->entityType->isStaticallyCacheable() && $ids) { $cids = []; foreach ($ids as $id) { diff --git a/src/Entity/Storage/FieldableEdgeEntityStorageBase.php b/src/Entity/Storage/FieldableEdgeEntityStorageBase.php index cfac289e..f9a06e82 100644 --- a/src/Entity/Storage/FieldableEdgeEntityStorageBase.php +++ b/src/Entity/Storage/FieldableEdgeEntityStorageBase.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\Entity\Storage; -use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface; -use Drupal\apigee_edge\Exception\InvalidArgumentException; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\apigee_edge\Entity\FieldableEdgeEntityInterface; +use Drupal\apigee_edge\Exception\InvalidArgumentException; /** * Base class for fieldable Apigee Edge entities. @@ -81,7 +81,7 @@ public function onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, ar /** * {@inheritdoc} */ - public function onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array &$sandbox = NULL) { + public function onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, ?array &$sandbox = NULL) { } /** diff --git a/src/EventSubscriber/ApiProductEntityAccessCacheReset.php b/src/EventSubscriber/ApiProductEntityAccessCacheReset.php index 99698c7e..dd3be3b7 100644 --- a/src/EventSubscriber/ApiProductEntityAccessCacheReset.php +++ b/src/EventSubscriber/ApiProductEntityAccessCacheReset.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\EventSubscriber; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\apigee_edge\Event\AppCredentialAddApiProductEvent; use Drupal\apigee_edge\Event\AppCredentialCreateEvent; use Drupal\apigee_edge\Event\AppCredentialDeleteApiProductEvent; use Drupal\apigee_edge\Event\AppCredentialDeleteEvent; use Drupal\apigee_edge\Event\AppCredentialGenerateEvent; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Contracts\EventDispatcher\Event; diff --git a/src/EventSubscriber/DeveloperAppFieldConfigListAlterEventSubscriber.php b/src/EventSubscriber/DeveloperAppFieldConfigListAlterEventSubscriber.php index 7ab1e68b..6a33efeb 100644 --- a/src/EventSubscriber/DeveloperAppFieldConfigListAlterEventSubscriber.php +++ b/src/EventSubscriber/DeveloperAppFieldConfigListAlterEventSubscriber.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge\EventSubscriber; +use Drupal\Core\Form\FormBuilderInterface; use Drupal\apigee_edge\Event\EdgeEntityFieldConfigListAlterEvent; use Drupal\apigee_edge\Form\DeveloperAppBaseFieldConfigForm; -use Drupal\Core\Form\FormBuilderInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** diff --git a/src/EventSubscriber/DeveloperStatusWarningSubscriber.php b/src/EventSubscriber/DeveloperStatusWarningSubscriber.php index 3af0c09d..5d13caec 100644 --- a/src/EventSubscriber/DeveloperStatusWarningSubscriber.php +++ b/src/EventSubscriber/DeveloperStatusWarningSubscriber.php @@ -20,7 +20,6 @@ namespace Drupal\apigee_edge\EventSubscriber; -use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Routing\RouteMatchInterface; @@ -28,6 +27,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\DeveloperInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; diff --git a/src/EventSubscriber/EdgeExceptionSubscriber.php b/src/EventSubscriber/EdgeExceptionSubscriber.php index a1f309ba..59141d53 100644 --- a/src/EventSubscriber/EdgeExceptionSubscriber.php +++ b/src/EventSubscriber/EdgeExceptionSubscriber.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge\EventSubscriber; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Controller\ErrorPageController; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\DependencyInjection\ClassResolverInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Routing\RouteMatch; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Controller\ErrorPageController; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ExceptionEvent; @@ -136,7 +136,7 @@ public function onException(ExceptionEvent $event) { $routeMatch = new RouteMatch('apigee_edge.error_page', new Route('/api-communication-error')); $renderer = $this->classResolver->getInstanceFromDefinition($this->mainContentRenderers['html']); - /* @var \Symfony\Component\HttpFoundation\Response $response */ + /** @var \Symfony\Component\HttpFoundation\Response $response */ $response = $renderer->renderResponse($content, $event->getRequest(), $routeMatch); $response->setStatusCode(503); diff --git a/src/Exception/AuthenticationKeyNotFoundException.php b/src/Exception/AuthenticationKeyNotFoundException.php index 19be8171..9f0a3e12 100644 --- a/src/Exception/AuthenticationKeyNotFoundException.php +++ b/src/Exception/AuthenticationKeyNotFoundException.php @@ -44,7 +44,7 @@ class AuthenticationKeyNotFoundException extends AuthenticationKeyException { * @param \Throwable|null $previous * Previous exception. */ - public function __construct(string $key_id, string $message = 'Authentication key not found with "@id" id.', int $code = 0, \Throwable $previous = NULL) { + public function __construct(string $key_id, string $message = 'Authentication key not found with "@id" id.', int $code = 0, ?\Throwable $previous = NULL) { $this->keyId = $key_id; $message = strtr($message, ['@id' => $key_id]); parent::__construct($message, $code, $previous); diff --git a/src/Exception/AuthenticationKeyValueMalformedException.php b/src/Exception/AuthenticationKeyValueMalformedException.php index 99564dd7..f4b7651a 100644 --- a/src/Exception/AuthenticationKeyValueMalformedException.php +++ b/src/Exception/AuthenticationKeyValueMalformedException.php @@ -28,7 +28,7 @@ class AuthenticationKeyValueMalformedException extends AuthenticationKeyExceptio * @param \Throwable|null $previous * Previous exception. */ - public function __construct($problematic_field, $message = 'Apigee Edge API authentication key is malformed or not readable.', $code = 0, \Throwable $previous = NULL) { + public function __construct($problematic_field, $message = 'Apigee Edge API authentication key is malformed or not readable.', $code = 0, ?\Throwable $previous = NULL) { $this->problematicField = $problematic_field; $message = strtr($message, ['@field' => $problematic_field]); parent::__construct($message, $code, $previous); diff --git a/src/Exception/DeveloperDoesNotExistException.php b/src/Exception/DeveloperDoesNotExistException.php index 16d9682c..db20043e 100644 --- a/src/Exception/DeveloperDoesNotExistException.php +++ b/src/Exception/DeveloperDoesNotExistException.php @@ -45,7 +45,7 @@ class DeveloperDoesNotExistException extends ApiException implements ApigeeEdgeE * @param \Throwable|null $previous * Previous exception. */ - public function __construct(string $email, string $message = 'Developer with @email email address not found. Running the developer sync could fix this.', int $code = 0, \Throwable $previous = NULL) { + public function __construct(string $email, string $message = 'Developer with @email email address not found. Running the developer sync could fix this.', int $code = 0, ?\Throwable $previous = NULL) { $this->email = $email; $message = strtr($message, ['@email' => $email]); parent::__construct($message, $code, $previous); diff --git a/src/Exception/DeveloperToUserConversationInvalidValueException.php b/src/Exception/DeveloperToUserConversationInvalidValueException.php index d92c902d..b5e2a436 100644 --- a/src/Exception/DeveloperToUserConversationInvalidValueException.php +++ b/src/Exception/DeveloperToUserConversationInvalidValueException.php @@ -20,8 +20,8 @@ namespace Drupal\apigee_edge\Exception; -use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\Core\TypedData\Plugin\DataType\ItemList; +use Drupal\apigee_edge\Entity\DeveloperInterface; use Symfony\Component\Validator\ConstraintViolationInterface; /** diff --git a/src/Exception/DeveloperUpdateFailedException.php b/src/Exception/DeveloperUpdateFailedException.php index 49e7144e..4896c3a9 100644 --- a/src/Exception/DeveloperUpdateFailedException.php +++ b/src/Exception/DeveloperUpdateFailedException.php @@ -45,7 +45,7 @@ final class DeveloperUpdateFailedException extends ApiException implements Apige * @param \Throwable|null $previous * Previous exception. */ - public function __construct(string $email, string $message = 'Developer @email profile update failed.', int $code = 0, \Throwable $previous = NULL) { + public function __construct(string $email, string $message = 'Developer @email profile update failed.', int $code = 0, ?\Throwable $previous = NULL) { $this->email = $email; $message = strtr($message, ['@email' => $email]); parent::__construct($message, $code, $previous); diff --git a/src/Exception/KeyProviderRequirementsException.php b/src/Exception/KeyProviderRequirementsException.php index 745c7b9f..8e8da0dc 100644 --- a/src/Exception/KeyProviderRequirementsException.php +++ b/src/Exception/KeyProviderRequirementsException.php @@ -50,7 +50,7 @@ class KeyProviderRequirementsException extends RuntimeException { * @param \Throwable|null $previous * The previous throwable used for the exception chaining. */ - public function __construct(string $message, TranslatableMarkup $translatable_markup_message = NULL, int $code = 0, \Throwable $previous = NULL) { + public function __construct(string $message, ?TranslatableMarkup $translatable_markup_message = NULL, int $code = 0, ?\Throwable $previous = NULL) { $this->translatableMarkupMessage = $translatable_markup_message; parent::__construct($message, $code, $previous); } diff --git a/src/Exception/UserDoesNotExistWithEmail.php b/src/Exception/UserDoesNotExistWithEmail.php index 0334e107..616e2556 100644 --- a/src/Exception/UserDoesNotExistWithEmail.php +++ b/src/Exception/UserDoesNotExistWithEmail.php @@ -44,7 +44,7 @@ class UserDoesNotExistWithEmail extends \RuntimeException implements ApigeeEdgeE * @param \Throwable|null $previous * Previous exception. */ - public function __construct(string $email, string $message = 'User with @email email address not found.', int $code = 0, \Throwable $previous = NULL) { + public function __construct(string $email, string $message = 'User with @email email address not found.', int $code = 0, ?\Throwable $previous = NULL) { $this->email = $email; $message = strtr($message, ['@email' => $email]); parent::__construct($message, $code, $previous); diff --git a/src/FieldAttributeConverter.php b/src/FieldAttributeConverter.php index ff65cc05..82db1d3b 100644 --- a/src/FieldAttributeConverter.php +++ b/src/FieldAttributeConverter.php @@ -21,10 +21,10 @@ namespace Drupal\apigee_edge; use Apigee\Edge\Structure\AttributesProperty; -use Drupal\apigee_edge\Plugin\FieldStorageFormatInterface; -use Drupal\apigee_edge\Plugin\FieldStorageFormatManagerInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; +use Drupal\apigee_edge\Plugin\FieldStorageFormatInterface; +use Drupal\apigee_edge\Plugin\FieldStorageFormatManagerInterface; /** * Default field-attribute converter service implementation. diff --git a/src/Form/AppAnalyticsFormBase.php b/src/Form/AppAnalyticsFormBase.php index 2d6393cc..d579cba0 100644 --- a/src/Form/AppAnalyticsFormBase.php +++ b/src/Form/AppAnalyticsFormBase.php @@ -22,8 +22,6 @@ use Apigee\Edge\Api\Management\Controller\StatsController; use Apigee\Edge\Api\Management\Query\StatsQuery; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Component\Utility\Crypt; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -33,6 +31,8 @@ use Drupal\Core\TempStore\PrivateTempStoreFactory; use Drupal\Core\Url; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\SDKConnectorInterface; use League\Period\Period; use Moment\MomentException; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -166,7 +166,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ?AppInter ], '#default_value' => 'avg(total_response_time)', '#title' => t('Metrics'), - '#title_display' => 'invisible' + '#title_display' => 'invisible', ]; $form['controls']['since'] = [ @@ -199,7 +199,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ?AppInter 'custom' => $this->t('Custom range'), ], '#title' => t('Date range'), - '#title_display' => 'invisible' + '#title_display' => 'invisible', ]; $form['controls']['submit'] = [ diff --git a/src/Form/AppAnalyticsSettingsForm.php b/src/Form/AppAnalyticsSettingsForm.php index f2ca94f6..1468d2b6 100644 --- a/src/Form/AppAnalyticsSettingsForm.php +++ b/src/Form/AppAnalyticsSettingsForm.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge\Form; use Apigee\Edge\Api\Management\Controller\EnvironmentController; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\SDKConnectorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Form/AppApiKeyAddFormBase.php b/src/Form/AppApiKeyAddFormBase.php index 80741c0b..3d31b2a3 100644 --- a/src/Form/AppApiKeyAddFormBase.php +++ b/src/Form/AppApiKeyAddFormBase.php @@ -21,12 +21,12 @@ use Apigee\Edge\Api\Management\Entity\AppCredentialInterface; use Apigee\Edge\Structure\CredentialProductInterface; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; /** * Provides app API key add base form. diff --git a/src/Form/AppApiKeyConfirmFormBase.php b/src/Form/AppApiKeyConfirmFormBase.php index f8270252..40c56696 100644 --- a/src/Form/AppApiKeyConfirmFormBase.php +++ b/src/Form/AppApiKeyConfirmFormBase.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge\Form; use Apigee\Edge\Api\Management\Entity\AppCredential; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** diff --git a/src/Form/AppApiKeyRevokeFormBase.php b/src/Form/AppApiKeyRevokeFormBase.php index 380e1e2e..90295b15 100644 --- a/src/Form/AppApiKeyRevokeFormBase.php +++ b/src/Form/AppApiKeyRevokeFormBase.php @@ -19,9 +19,9 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; /** * Provides revoke confirmation base form for app API key. diff --git a/src/Form/AuthenticationForm.php b/src/Form/AuthenticationForm.php index 76db1eea..cf42c930 100644 --- a/src/Form/AuthenticationForm.php +++ b/src/Form/AuthenticationForm.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; -use Drupal\apigee_edge\Plugin\KeyProviderRequirementsInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; +use Drupal\apigee_edge\Plugin\KeyProviderRequirementsInterface; use Drupal\key\Form\KeyEditForm; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Form/DeveloperAppAnalyticsForm.php b/src/Form/DeveloperAppAnalyticsForm.php index b8339cad..74d7d988 100644 --- a/src/Form/DeveloperAppAnalyticsForm.php +++ b/src/Form/DeveloperAppAnalyticsForm.php @@ -19,8 +19,8 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\Entity\AppInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Entity\AppInterface; /** * Displays the analytics page of a developer app on the UI. diff --git a/src/Form/DeveloperAppAnalyticsFormForDeveloper.php b/src/Form/DeveloperAppAnalyticsFormForDeveloper.php index 417c5a6b..3d8f7bd5 100644 --- a/src/Form/DeveloperAppAnalyticsFormForDeveloper.php +++ b/src/Form/DeveloperAppAnalyticsFormForDeveloper.php @@ -19,8 +19,8 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\Entity\AppInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Entity\AppInterface; /** * Displays the analytics page of a developer app for a given user on the UI. diff --git a/src/Form/DeveloperAppApiKeyAddForm.php b/src/Form/DeveloperAppApiKeyAddForm.php index dfdac439..ba02ba0f 100644 --- a/src/Form/DeveloperAppApiKeyAddForm.php +++ b/src/Form/DeveloperAppApiKeyAddForm.php @@ -19,10 +19,10 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Form\DeveloperAppFormTrait; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Form\DeveloperAppFormTrait; use Drupal\user\UserInterface; /** diff --git a/src/Form/DeveloperAttributesSettingsForm.php b/src/Form/DeveloperAttributesSettingsForm.php index 29029c4b..fee7a04b 100644 --- a/src/Form/DeveloperAttributesSettingsForm.php +++ b/src/Form/DeveloperAttributesSettingsForm.php @@ -19,13 +19,13 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\FieldAttributeConverter; -use Drupal\apigee_edge\Plugin\FieldStorageFormatManagerInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\FieldAttributeConverter; +use Drupal\apigee_edge\Plugin\FieldStorageFormatManagerInterface; use Drupal\field\Entity\FieldConfig; use Drupal\field\FieldConfigInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Form/DeveloperSyncForm.php b/src/Form/DeveloperSyncForm.php index 6a59bb02..f81d7166 100644 --- a/src/Form/DeveloperSyncForm.php +++ b/src/Form/DeveloperSyncForm.php @@ -19,10 +19,10 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\SDKConnectorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Form/EdgeEntityDisplaySettingsForm.php b/src/Form/EdgeEntityDisplaySettingsForm.php index 1a3ef275..73c08c3c 100644 --- a/src/Form/EdgeEntityDisplaySettingsForm.php +++ b/src/Form/EdgeEntityDisplaySettingsForm.php @@ -20,7 +20,6 @@ namespace Drupal\apigee_edge\Form; -use Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -30,6 +29,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\ListBuilder\EdgeEntityListBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -171,7 +171,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t ]; $display_modes = [ - 'default' => $this->t('Default') + 'default' => $this->t('Default'), ]; foreach ($this->entityDisplayRepository->getViewModes($entity_type->id()) as $name => $view_mode) { $display_modes[$name] = $view_mode['label']; @@ -194,13 +194,13 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t [ '#markup' => $this->t('Click here to configure the display.', [ ':uri' => Url::fromRoute("entity.entity_view_display.{$entity_type->id()}.default")->toString(), - ]) + ]), ], [ '#markup' => $this->t('Click here to add a new display mode.', [ ':uri' => Url::fromRoute('entity.entity_view_mode.collection')->toString(), - ]) - ] + ]), + ], ], ]; } diff --git a/src/Job/DeveloperCreateUpdate.php b/src/Job/DeveloperCreateUpdate.php index 56a62b51..191ff6df 100644 --- a/src/Job/DeveloperCreateUpdate.php +++ b/src/Job/DeveloperCreateUpdate.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\Job; +use Drupal\Core\Utility\Error; use Drupal\apigee_edge\Exception\UserDeveloperConversionException; use Drupal\apigee_edge\Exception\UserDeveloperConversionNoStorageFormatterFoundException; use Drupal\apigee_edge\Exception\UserDeveloperConversionUserFieldDoesNotExistException; use Drupal\apigee_edge\Exception\UserDoesNotExistWithEmail; use Drupal\apigee_edge\Structure\UserToDeveloperConversionResult; -use Drupal\Core\Utility\Error; use Drupal\user\UserInterface; /** diff --git a/src/Job/EdgeJob.php b/src/Job/EdgeJob.php index f9bb221e..18a16801 100644 --- a/src/Job/EdgeJob.php +++ b/src/Job/EdgeJob.php @@ -92,7 +92,7 @@ abstract protected function executeRequest(); * {@inheritdoc} */ public function renderArray(): array { - // TODO visualize Journal. + // @todo visualize Journal. return []; } diff --git a/src/Job/UserCreateUpdate.php b/src/Job/UserCreateUpdate.php index d570bc4b..df51748d 100644 --- a/src/Job/UserCreateUpdate.php +++ b/src/Job/UserCreateUpdate.php @@ -20,6 +20,8 @@ namespace Drupal\apigee_edge\Job; +use Drupal\Core\TypedData\Plugin\DataType\ItemList; +use Drupal\Core\Utility\Error; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Drupal\apigee_edge\Exception\DeveloperToUserConversationInvalidValueException; @@ -28,8 +30,6 @@ use Drupal\apigee_edge\Exception\UserDeveloperConversionNoStorageFormatterFoundException; use Drupal\apigee_edge\Exception\UserDeveloperConversionUserFieldDoesNotExistException; use Drupal\apigee_edge\Structure\DeveloperToUserConversionResult; -use Drupal\Core\TypedData\Plugin\DataType\ItemList; -use Drupal\Core\Utility\Error; /** * Base class for user create/update sync jobs. diff --git a/src/Job/UserDeveloperSyncJobTrait.php b/src/Job/UserDeveloperSyncJobTrait.php index c6447ed8..729d1081 100644 --- a/src/Job/UserDeveloperSyncJobTrait.php +++ b/src/Job/UserDeveloperSyncJobTrait.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge\Job; +use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\apigee_edge\Exception\UserDeveloperConversionException; use Drupal\apigee_edge\FieldAttributeConverterInterface; use Drupal\apigee_edge\UserDeveloperConverterInterface; -use Drupal\Core\Logger\LoggerChannelInterface; /** * Base trait for developer- and user create and update sync jobs. @@ -77,7 +77,7 @@ protected function logConversionProblems(array $problems, array $context = []) : /** * Logs an entity conversation problems encountered meanwhile syncing. * - * TODO Consider to add a translatable operation to message logged by + * @todo Consider to add a translatable operation to message logged by * recordMessage() if we actually start using that method something. * * @param \Drupal\apigee_edge\Exception\UserDeveloperConversionException $problem diff --git a/src/JobExecutor.php b/src/JobExecutor.php index 60a98186..bacc1c5d 100644 --- a/src/JobExecutor.php +++ b/src/JobExecutor.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge; -use Drupal\apigee_edge\Job\Job; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Queue\QueueFactory; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Job\Job; /** * Job executor service. @@ -120,7 +120,7 @@ public function load(string $id): ?Job { * {@inheritdoc} */ public function select(?string $tag = NULL): ?Job { - // TODO handle race conditions. + // @todo handle race conditions. $query = $this->connection->select('apigee_edge_job', 'j') ->fields('j', ['job']) ->orderBy('updated') diff --git a/src/KeyEntityFormEnhancer.php b/src/KeyEntityFormEnhancer.php index a46cd1f2..804cdd05 100644 --- a/src/KeyEntityFormEnhancer.php +++ b/src/KeyEntityFormEnhancer.php @@ -20,16 +20,10 @@ namespace Drupal\apigee_edge; -use Apigee\Edge\Exception\ApigeeOnGcpOauth2AuthenticationException; use Apigee\Edge\Exception\ApiRequestException; +use Apigee\Edge\Exception\ApigeeOnGcpOauth2AuthenticationException; use Apigee\Edge\Exception\OauthAuthenticationException; use Apigee\Edge\HttpClient\Plugin\Authentication\Oauth; -use Drupal\apigee_edge\Exception\AuthenticationKeyException; -use Drupal\apigee_edge\Exception\InvalidArgumentException; -use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; -use Drupal\apigee_edge\Plugin\KeyProviderRequirementsInterface; -use Drupal\apigee_edge\Plugin\KeyType\ApigeeAuthKeyType; use Drupal\Component\Render\MarkupInterface; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Component\Utility\Random; @@ -41,6 +35,12 @@ use Drupal\Core\Render\Element\StatusMessages; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Exception\AuthenticationKeyException; +use Drupal\apigee_edge\Exception\InvalidArgumentException; +use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; +use Drupal\apigee_edge\Plugin\KeyProviderRequirementsInterface; +use Drupal\apigee_edge\Plugin\KeyType\ApigeeAuthKeyType; use Drupal\key\Form\KeyFormBase; use Drupal\key\KeyInterface; use Drupal\key\Plugin\KeyProviderSettableValueInterface; @@ -544,7 +544,7 @@ private function createSuggestion(\Exception $exception, KeyInterface $key): Mar // authentication). else { // Invalid credentials. - // TODO Remove the second condition which is a workaround for a + // @todo Remove the second condition which is a workaround for a // regression bug in the Apigee Edge for Public Cloud 19.03.01 release. If // valid organization name and username provided with an invalid password // the MGMT server returns HTTP 500 with an error instead of HTTP 401. diff --git a/src/OauthAuthentication.php b/src/OauthAuthentication.php index 48a833c7..35965455 100644 --- a/src/OauthAuthentication.php +++ b/src/OauthAuthentication.php @@ -27,7 +27,7 @@ /** * Decorator for OAuth authentication plugin. * - * @todo: move to \Drupal\apigee_edge\Connector namespace. + * @todo move to \Drupal\apigee_edge\Connector namespace. */ class OauthAuthentication extends Oauth { diff --git a/src/OauthCredentials.php b/src/OauthCredentials.php index 5d1b8ada..b9e8e9e1 100644 --- a/src/OauthCredentials.php +++ b/src/OauthCredentials.php @@ -27,7 +27,7 @@ /** * The API credentials for OAuth. * - * @todo: move to \Drupal\apigee_edge\Connector namespace. + * @todo move to \Drupal\apigee_edge\Connector namespace. */ class OauthCredentials extends Credentials { diff --git a/src/OauthTokenFileStorage.php b/src/OauthTokenFileStorage.php index db808e13..2f8c33cf 100644 --- a/src/OauthTokenFileStorage.php +++ b/src/OauthTokenFileStorage.php @@ -19,17 +19,17 @@ namespace Drupal\apigee_edge; -use Drupal\apigee_edge\Exception\OauthTokenStorageException; use Drupal\Component\Serialization\Json; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\File\Exception\FileException; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Logger\LoggerChannelInterface; +use Drupal\apigee_edge\Exception\OauthTokenStorageException; /** * Stores OAuth token data in a file. * - * @todo: move to \Drupal\apigee_edge\Connector namespace. + * @todo move to \Drupal\apigee_edge\Connector namespace. */ final class OauthTokenFileStorage implements OauthTokenStorageInterface { diff --git a/src/OauthTokenStorageInterface.php b/src/OauthTokenStorageInterface.php index 682adeea..7ca76116 100644 --- a/src/OauthTokenStorageInterface.php +++ b/src/OauthTokenStorageInterface.php @@ -25,7 +25,7 @@ /** * Base definition of the OAuth token storage service implementations. * - * @todo: move to \Drupal\apigee_edge\Connector namespace. + * @todo move to \Drupal\apigee_edge\Connector namespace. */ interface OauthTokenStorageInterface extends EdgeOauthTokenStorageInterface { diff --git a/src/ParamConverter/DeveloperAppNameConverter.php b/src/ParamConverter/DeveloperAppNameConverter.php index d74d39fa..511c52a7 100644 --- a/src/ParamConverter/DeveloperAppNameConverter.php +++ b/src/ParamConverter/DeveloperAppNameConverter.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge\ParamConverter; -use Drupal\apigee_edge\Entity\Storage\AppStorage; -use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\ParamConverter\ParamConverterInterface; +use Drupal\apigee_edge\Entity\Storage\AppStorage; +use Drupal\apigee_edge\Exception\DeveloperDoesNotExistException; use Symfony\Component\Routing\Route; /** diff --git a/src/Plugin/Derivative/DynamicAddEntityLocalActions.php b/src/Plugin/Derivative/DynamicAddEntityLocalActions.php index 310273e7..62831232 100644 --- a/src/Plugin/Derivative/DynamicAddEntityLocalActions.php +++ b/src/Plugin/Derivative/DynamicAddEntityLocalActions.php @@ -20,12 +20,12 @@ namespace Drupal\apigee_edge\Plugin\Derivative; -use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface; use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\apigee_edge\Entity\EdgeEntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Plugin/EdgeKeyTypeBase.php b/src/Plugin/EdgeKeyTypeBase.php index a98a5efd..10175587 100644 --- a/src/Plugin/EdgeKeyTypeBase.php +++ b/src/Plugin/EdgeKeyTypeBase.php @@ -22,8 +22,8 @@ use Apigee\Edge\Client; use Apigee\Edge\ClientInterface; use Apigee\Edge\HttpClient\Plugin\Authentication\Oauth; -use Drupal\apigee_edge\Exception\AuthenticationKeyValueMalformedException; use Drupal\Component\Serialization\Json; +use Drupal\apigee_edge\Exception\AuthenticationKeyValueMalformedException; use Drupal\key\KeyInterface; use Drupal\key\Plugin\KeyTypeBase; diff --git a/src/Plugin/Field/FieldFormatter/StatusPropertyFormatter.php b/src/Plugin/Field/FieldFormatter/StatusPropertyFormatter.php index 219c189d..a4f3a0f3 100644 --- a/src/Plugin/Field/FieldFormatter/StatusPropertyFormatter.php +++ b/src/Plugin/Field/FieldFormatter/StatusPropertyFormatter.php @@ -19,12 +19,12 @@ namespace Drupal\apigee_edge\Plugin\Field\FieldFormatter; -use Drupal\apigee_edge\Element\StatusPropertyElement; -use Drupal\apigee_edge\Entity\EdgeEntityInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Element\StatusPropertyElement; +use Drupal\apigee_edge\Entity\EdgeEntityInterface; /** * Plugin implementation of the 'status_property' formatter. diff --git a/src/Plugin/Field/FieldType/ApigeeEdgeDeveloperIdFieldItem.php b/src/Plugin/Field/FieldType/ApigeeEdgeDeveloperIdFieldItem.php index d7ca5e07..86575d8d 100644 --- a/src/Plugin/Field/FieldType/ApigeeEdgeDeveloperIdFieldItem.php +++ b/src/Plugin/Field/FieldType/ApigeeEdgeDeveloperIdFieldItem.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge\Plugin\Field\FieldType; -use Drupal\apigee_edge\Entity\Developer; use Drupal\Core\Field\FieldItemList; use Drupal\Core\TypedData\ComputedItemListTrait; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Developer; /** * Definition of Apigee Edge Developer ID computed field for User entity. diff --git a/src/Plugin/FieldStorageFormatManager.php b/src/Plugin/FieldStorageFormatManager.php index fa3e8581..70895986 100644 --- a/src/Plugin/FieldStorageFormatManager.php +++ b/src/Plugin/FieldStorageFormatManager.php @@ -19,10 +19,10 @@ namespace Drupal\apigee_edge\Plugin; -use Drupal\apigee_edge\Annotation\ApigeeFieldStorageFormat; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\DefaultPluginManager; +use Drupal\apigee_edge\Annotation\ApigeeFieldStorageFormat; /** * Provides a FieldStorageFormat plugin manager. diff --git a/src/Plugin/KeyInput/ApigeeAuthKeyInput.php b/src/Plugin/KeyInput/ApigeeAuthKeyInput.php index f14961f5..70087bc0 100644 --- a/src/Plugin/KeyInput/ApigeeAuthKeyInput.php +++ b/src/Plugin/KeyInput/ApigeeAuthKeyInput.php @@ -21,10 +21,10 @@ use Apigee\Edge\ClientInterface; use Apigee\Edge\HttpClient\Plugin\Authentication\Oauth; -use Drupal\apigee_edge\Connector\GceServiceAccountAuthentication; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\Component\Serialization\Json; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Connector\GceServiceAccountAuthentication; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\key\Plugin\KeyInputBase; use Http\Client\Exception; diff --git a/src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php b/src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php index ffd2394e..8ed25d75 100644 --- a/src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php +++ b/src/Plugin/KeyProvider/EnvironmentVariablesKeyProvider.php @@ -19,9 +19,9 @@ namespace Drupal\apigee_edge\Plugin\KeyProvider; -use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; use Drupal\Component\Serialization\Json; use Drupal\Core\Form\FormStateInterface; +use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; use Drupal\key\KeyInterface; use Drupal\key\Plugin\KeyPluginFormInterface; diff --git a/src/Plugin/KeyProvider/KeyProviderRequirementsBase.php b/src/Plugin/KeyProvider/KeyProviderRequirementsBase.php index 96440f17..8b0684c7 100644 --- a/src/Plugin/KeyProvider/KeyProviderRequirementsBase.php +++ b/src/Plugin/KeyProvider/KeyProviderRequirementsBase.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge\Plugin\KeyProvider; -use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; -use Drupal\apigee_edge\Plugin\KeyProviderRequirementsInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; +use Drupal\apigee_edge\Plugin\KeyProviderRequirementsInterface; use Drupal\key\KeyInterface; use Drupal\key\Plugin\KeyProviderBase; use Psr\Log\LoggerInterface; diff --git a/src/Plugin/KeyProvider/PrivateFileKeyProvider.php b/src/Plugin/KeyProvider/PrivateFileKeyProvider.php index 95c0be21..f8fdd619 100644 --- a/src/Plugin/KeyProvider/PrivateFileKeyProvider.php +++ b/src/Plugin/KeyProvider/PrivateFileKeyProvider.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge\Plugin\KeyProvider; -use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; use Drupal\Core\File\Exception\FileException; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Exception\KeyProviderRequirementsException; use Drupal\key\KeyInterface; use Drupal\key\Plugin\KeyPluginFormInterface; use Drupal\key\Plugin\KeyProviderSettableValueInterface; diff --git a/src/Plugin/KeyType/ApigeeAuthKeyType.php b/src/Plugin/KeyType/ApigeeAuthKeyType.php index f3b694b3..98621bc7 100644 --- a/src/Plugin/KeyType/ApigeeAuthKeyType.php +++ b/src/Plugin/KeyType/ApigeeAuthKeyType.php @@ -19,12 +19,12 @@ namespace Drupal\apigee_edge\Plugin\KeyType; +use Drupal\Core\Form\FormStateInterface; use Drupal\apigee_edge\Connector\GceServiceAccountAuthentication; use Drupal\apigee_edge\Connector\HybridAuthentication; use Drupal\apigee_edge\OauthAuthentication; use Drupal\apigee_edge\Plugin\EdgeKeyTypeBase; use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; -use Drupal\Core\Form\FormStateInterface; use Drupal\key\KeyInterface; use Http\Message\Authentication; use Http\Message\Authentication\BasicAuth; diff --git a/src/Plugin/Menu/AddAppForDeveloperLocalAction.php b/src/Plugin/Menu/AddAppForDeveloperLocalAction.php index 87be60e4..081ec568 100644 --- a/src/Plugin/Menu/AddAppForDeveloperLocalAction.php +++ b/src/Plugin/Menu/AddAppForDeveloperLocalAction.php @@ -81,7 +81,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function getTitle(Request $request = NULL) { + public function getTitle(?Request $request = NULL) { return $this->t('Add @app', ['@app' => mb_strtolower($this->developerAppEntity->getSingularLabel())]); } diff --git a/src/Plugin/QueueWorker/JobQueueWorker.php b/src/Plugin/QueueWorker/JobQueueWorker.php index f96af23a..89eda92f 100644 --- a/src/Plugin/QueueWorker/JobQueueWorker.php +++ b/src/Plugin/QueueWorker/JobQueueWorker.php @@ -19,11 +19,11 @@ namespace Drupal\apigee_edge\Plugin\QueueWorker; -use Drupal\apigee_edge\Job\Job; -use Drupal\apigee_edge\JobExecutorInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Queue\QueueFactory; use Drupal\Core\Queue\QueueWorkerBase; +use Drupal\apigee_edge\Job\Job; +use Drupal\apigee_edge\JobExecutorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/src/Plugin/Validation/Constraint/DeveloperEmailUniqueValidator.php b/src/Plugin/Validation/Constraint/DeveloperEmailUniqueValidator.php index 537105b7..31da0f9c 100644 --- a/src/Plugin/Validation/Constraint/DeveloperEmailUniqueValidator.php +++ b/src/Plugin/Validation/Constraint/DeveloperEmailUniqueValidator.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge\Plugin\Validation\Constraint; -use Drupal\apigee_edge\Entity\Developer; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\apigee_edge\Entity\Developer; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; diff --git a/src/Plugin/Validation/Constraint/LowercaseEmailConstraintValidator.php b/src/Plugin/Validation/Constraint/LowercaseEmailConstraintValidator.php index d195c0c9..77c48664 100644 --- a/src/Plugin/Validation/Constraint/LowercaseEmailConstraintValidator.php +++ b/src/Plugin/Validation/Constraint/LowercaseEmailConstraintValidator.php @@ -20,9 +20,9 @@ namespace Drupal\apigee_edge\Plugin\Validation\Constraint; +use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\apigee_edge\Entity\Controller\OrganizationController; use Drupal\apigee_edge\SDKConnectorInterface; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; diff --git a/src/Routing/EdgeEntityFieldConfigListRouteSubscriber.php b/src/Routing/EdgeEntityFieldConfigListRouteSubscriber.php index 652d2979..00f29748 100644 --- a/src/Routing/EdgeEntityFieldConfigListRouteSubscriber.php +++ b/src/Routing/EdgeEntityFieldConfigListRouteSubscriber.php @@ -20,11 +20,11 @@ namespace Drupal\apigee_edge\Routing; -use Drupal\apigee_edge\Controller\EdgeEntityFieldConfigListController; -use Drupal\apigee_edge\Entity\EdgeEntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\RouteBuildEvent; use Drupal\Core\Routing\RoutingEvents; +use Drupal\apigee_edge\Controller\EdgeEntityFieldConfigListController; +use Drupal\apigee_edge\Entity\EdgeEntityInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** diff --git a/src/SDKConnector.php b/src/SDKConnector.php index f0dbee4b..5bb97cde 100644 --- a/src/SDKConnector.php +++ b/src/SDKConnector.php @@ -23,17 +23,16 @@ use Apigee\Edge\Client; use Apigee\Edge\ClientInterface; use Apigee\Edge\HttpClient\Utility\Builder; -use Drupal\apigee_edge\Connector\HybridCredentials; -use Drupal\apigee_edge\Entity\Controller\OrganizationController as EdgeOrganizationController; -use Drupal\apigee_edge\Exception\AuthenticationKeyException; -use Drupal\apigee_edge\Exception\AuthenticationKeyNotFoundException; -use Drupal\apigee_edge\Exception\InvalidArgumentException; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\InfoParserInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Http\ClientFactory; +use Drupal\apigee_edge\Connector\HybridCredentials; +use Drupal\apigee_edge\Exception\AuthenticationKeyException; +use Drupal\apigee_edge\Exception\AuthenticationKeyNotFoundException; +use Drupal\apigee_edge\Exception\InvalidArgumentException; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\key\KeyInterface; use Drupal\key\KeyRepositoryInterface; use Http\Adapter\Guzzle7\Client as GuzzleClientAdapter; @@ -272,7 +271,7 @@ protected function userAgentPrefix(): string { /** * {@inheritdoc} */ - public function testConnection(KeyInterface $key = NULL) { + public function testConnection(?KeyInterface $key = NULL) { if ($key !== NULL) { $credentials = $this->buildCredentials($key); $client = $this->buildClient($credentials->getAuthentication(), $credentials->getKeyType()->getEndpoint($credentials->getKey())); @@ -285,7 +284,7 @@ public function testConnection(KeyInterface $key = NULL) { try { // We use the original, non-decorated organization controller here. $oc = new OrganizationController($client); - /* @var \Apigee\Edge\Api\Management\Entity\Organization $org */ + /** @var \Apigee\Edge\Api\Management\Entity\Organization $org */ $org = $oc->load($credentials->getKeyType()->getOrganization($credentials->getKey())); // Calling an invalid endpoint under some circumstances might return an diff --git a/src/SDKConnectorInterface.php b/src/SDKConnectorInterface.php index 081f250c..402174ef 100644 --- a/src/SDKConnectorInterface.php +++ b/src/SDKConnectorInterface.php @@ -20,7 +20,6 @@ namespace Drupal\apigee_edge; use Apigee\Edge\ClientInterface; -use Drupal\apigee_edge\Entity\Controller\OrganizationController; use Drupal\key\KeyInterface; use Http\Message\Authentication; @@ -54,7 +53,7 @@ public function getClient(): ClientInterface; * * @throws \Exception */ - public function testConnection(KeyInterface $key = NULL); + public function testConnection(?KeyInterface $key = NULL); /** * Returns a pre-configured API client with the provided credentials. diff --git a/src/UserDeveloperConverter.php b/src/UserDeveloperConverter.php index 8f316c33..44eac4b6 100644 --- a/src/UserDeveloperConverter.php +++ b/src/UserDeveloperConverter.php @@ -20,6 +20,8 @@ namespace Drupal\apigee_edge; +use Drupal\Core\Config\ConfigFactory; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\apigee_edge\Exception\DeveloperToUserConversationInvalidValueException; use Drupal\apigee_edge\Exception\DeveloperToUserConversionAttributeDoesNotExistException; @@ -29,8 +31,6 @@ use Drupal\apigee_edge\Plugin\Validation\Constraint\DeveloperEmailUniqueValidator; use Drupal\apigee_edge\Structure\DeveloperToUserConversionResult; use Drupal\apigee_edge\Structure\UserToDeveloperConversionResult; -use Drupal\Core\Config\ConfigFactory; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\user\UserInterface; /** diff --git a/tests/modules/apigee_edge_test/src/Entity/OverriddenDeveloperApp.php b/tests/modules/apigee_edge_test/src/Entity/OverriddenDeveloperApp.php index 934f1356..aa33adad 100644 --- a/tests/modules/apigee_edge_test/src/Entity/OverriddenDeveloperApp.php +++ b/tests/modules/apigee_edge_test/src/Entity/OverriddenDeveloperApp.php @@ -19,8 +19,8 @@ namespace Drupal\apigee_edge_test\Entity; -use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\apigee_edge\Entity\DeveloperApp; /** * Class OverriddenDeveloperApp. @@ -38,7 +38,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type): a $definitions['displayName']->setPropertyConstraints('value', [ 'Length' => [ 'min' => 1, - 'max' => 30 + 'max' => 30, ], ]); diff --git a/tests/modules/apigee_edge_test/src/SDKConnector.php b/tests/modules/apigee_edge_test/src/SDKConnector.php index fcfebfd9..ae550c24 100644 --- a/tests/modules/apigee_edge_test/src/SDKConnector.php +++ b/tests/modules/apigee_edge_test/src/SDKConnector.php @@ -23,14 +23,14 @@ use Apigee\Edge\Client; use Apigee\Edge\ClientInterface; use Apigee\Edge\Exception\ApiResponseException; -use Drupal\apigee_edge\SDKConnector as DecoratedSDKConnector; -use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\InfoParserInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Http\ClientFactory; use Drupal\Core\Logger\LoggerChannelInterface; +use Drupal\apigee_edge\SDKConnector as DecoratedSDKConnector; +use Drupal\apigee_edge\SDKConnectorInterface; use Drupal\key\KeyRepositoryInterface; use Http\Client\Exception; use Http\Message\Authentication; diff --git a/tests/modules/apigee_edge_test/src/UserDeveloperConverter.php b/tests/modules/apigee_edge_test/src/UserDeveloperConverter.php index ce6b53c3..4ca50c91 100644 --- a/tests/modules/apigee_edge_test/src/UserDeveloperConverter.php +++ b/tests/modules/apigee_edge_test/src/UserDeveloperConverter.php @@ -20,13 +20,13 @@ namespace Drupal\apigee_edge_test; +use Drupal\Core\Config\ConfigFactory; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\apigee_edge\FieldAttributeConverterInterface; use Drupal\apigee_edge\Plugin\FieldStorageFormatManagerInterface; use Drupal\apigee_edge\Structure\UserToDeveloperConversionResult; use Drupal\apigee_edge\UserDeveloperConverter as DecoratedUserDeveloperConverter; use Drupal\apigee_edge\UserDeveloperConverterInterface; -use Drupal\Core\Config\ConfigFactory; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\user\UserInterface; /** diff --git a/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/CreateDeleteAppKey.php b/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/CreateDeleteAppKey.php index db0c4420..1083f17f 100644 --- a/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/CreateDeleteAppKey.php +++ b/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/CreateDeleteAppKey.php @@ -20,10 +20,10 @@ namespace Drupal\apigee_edge_test_app_keys\EventSubscriber; -use Drupal\apigee_edge\Event\AppCredentialCreateEvent; -use Drupal\apigee_edge\Event\AppCredentialDeleteEvent; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\State\StateInterface; +use Drupal\apigee_edge\Event\AppCredentialCreateEvent; +use Drupal\apigee_edge\Event\AppCredentialDeleteEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** diff --git a/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/OverrideAppKeysOnGenerate.php b/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/OverrideAppKeysOnGenerate.php index cb0f411d..d8765119 100644 --- a/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/OverrideAppKeysOnGenerate.php +++ b/tests/modules/apigee_edge_test_app_keys/src/EventSubscriber/OverrideAppKeysOnGenerate.php @@ -22,10 +22,10 @@ use Apigee\Edge\Exception\ApiException; use Apigee\Edge\Structure\CredentialProduct; -use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; -use Drupal\apigee_edge\Event\AppCredentialGenerateEvent; use Drupal\Component\Utility\Random; use Drupal\Core\Utility\Error; +use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; +use Drupal\apigee_edge\Event\AppCredentialGenerateEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -73,7 +73,7 @@ public function overrideAppKeyOnGenerate(AppCredentialGenerateEvent $event) { $credential_controller = $this->devAppCredentialControllerFactory->developerAppCredentialController($event->getOwnerId(), $event->getAppName()); } else { - // TODO Finish when Company apps gets supported. + // @todo Finish when Company apps gets supported. } $prefix = apigee_edge_test_app_keys_get_prefix(); diff --git a/tests/modules/apigee_mock_api_client/src/ApigeeMockApiClientServiceProvider.php b/tests/modules/apigee_mock_api_client/src/ApigeeMockApiClientServiceProvider.php index abdbc42b..24f4580f 100644 --- a/tests/modules/apigee_mock_api_client/src/ApigeeMockApiClientServiceProvider.php +++ b/tests/modules/apigee_mock_api_client/src/ApigeeMockApiClientServiceProvider.php @@ -27,7 +27,7 @@ /** * Class ApigeeMockClientServiceProvider. * - * @todo: replace this with a service decorator that injects the apigee_mock_api_client.mock_http_client_factory dependency. + * @todo replace this with a service decorator that injects the apigee_mock_api_client.mock_http_client_factory dependency. * @see https://github.com/apigee/apigee-edge-drupal/pull/79#discussion_r229186448 * * This class is automatically picked up by the container builder. diff --git a/tests/modules/apigee_mock_api_client/tests/src/Traits/ApigeeMockApiClientHelperTrait.php b/tests/modules/apigee_mock_api_client/tests/src/Traits/ApigeeMockApiClientHelperTrait.php index 383a059c..4cb9dcca 100644 --- a/tests/modules/apigee_mock_api_client/tests/src/Traits/ApigeeMockApiClientHelperTrait.php +++ b/tests/modules/apigee_mock_api_client/tests/src/Traits/ApigeeMockApiClientHelperTrait.php @@ -26,13 +26,13 @@ use Apigee\Edge\Structure\AddonsConfig; use Apigee\Edge\Structure\MonetizationConfig; use Apigee\MockClient\Generator\ApigeeSdkEntitySource; +use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeUtilTestTrait; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\apigee_edge\Entity\DeveloperAppInterface; use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\apigee_edge_teams\Entity\Team; use Drupal\apigee_edge_teams\Entity\TeamInterface; -use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeUtilTestTrait; use Drupal\user\UserInterface; use Http\Message\RequestMatcher\RequestMatcher; @@ -140,9 +140,9 @@ protected function addApigeexOrganizationMatchedResponse($organizationName = '', 'runtimeType' => $runtimeType, 'addonsConfig' => new AddonsConfig([ 'monetizationConfig' => new MonetizationConfig([ - 'enabled' => 'true' - ]) - ]) + 'enabled' => 'true', + ]), + ]), ]); $this->stack->on( diff --git a/tests/src/Functional/ApigeeEdgeFunctionalTestBase.php b/tests/src/Functional/ApigeeEdgeFunctionalTestBase.php index 7beee478..4305dc2d 100644 --- a/tests/src/Functional/ApigeeEdgeFunctionalTestBase.php +++ b/tests/src/Functional/ApigeeEdgeFunctionalTestBase.php @@ -19,9 +19,9 @@ namespace Drupal\Tests\apigee_edge\Functional; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; -use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; /** * Base class for functional tests. diff --git a/tests/src/Functional/ApigeeX/ApigeeEdgeFunctionalTestBase.php b/tests/src/Functional/ApigeeX/ApigeeEdgeFunctionalTestBase.php index 36722a64..ecd6656f 100644 --- a/tests/src/Functional/ApigeeX/ApigeeEdgeFunctionalTestBase.php +++ b/tests/src/Functional/ApigeeX/ApigeeEdgeFunctionalTestBase.php @@ -19,9 +19,9 @@ namespace Drupal\Tests\apigee_edge\Functional\ApigeeX; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; -use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; /** * Base class for functional tests. diff --git a/tests/src/Functional/ApigeeX/EmailTest.php b/tests/src/Functional/ApigeeX/EmailTest.php index b14d74f8..7c554ee8 100644 --- a/tests/src/Functional/ApigeeX/EmailTest.php +++ b/tests/src/Functional/ApigeeX/EmailTest.php @@ -19,9 +19,8 @@ namespace Drupal\Tests\apigee_edge\Functional\ApigeeX; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\Core\Url; -use Drupal\Tests\apigee_edge\Functional\ApigeeX\ApigeeEdgeFunctionalTestBase; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; /** * Developer email already exists in Apigee Edge related tests. @@ -49,7 +48,6 @@ public function testEmailValidator() { $this->addApigeexOrganizationMatchedResponse(); // Admin user editing self email. - $this->drupalLogin($this->rootUser); $edit = [ 'name' => $this->randomMachineName(), @@ -75,7 +73,6 @@ public function testEmailValidator() { $this->assertSession()->pageTextContains('This email address accepts only lowercase characters.'); // Admin user creating a new user. - $adminuserCreate = [ 'name' => $this->randomMachineName(), 'mail' => 'aB' . $this->getRandomGenerator()->word(8) . '@example.com', @@ -91,7 +88,6 @@ public function testEmailValidator() { $this->drupalLogout(); // Anonmyous user creating new account. - $userRegister = [ 'name' => $this->randomMachineName(), 'mail' => 'xYZ' . $this->getRandomGenerator()->word(8) . '@example.com', diff --git a/tests/src/Functional/DeveloperAppAnalyticsTest.php b/tests/src/Functional/DeveloperAppAnalyticsTest.php index 646ea53e..6a257616 100644 --- a/tests/src/Functional/DeveloperAppAnalyticsTest.php +++ b/tests/src/Functional/DeveloperAppAnalyticsTest.php @@ -20,11 +20,11 @@ namespace Drupal\Tests\apigee_edge\Functional; use Apigee\Edge\Api\Management\Entity\App; -use Drupal\apigee_edge\Entity\Developer; -use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Component\Utility\Crypt; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\Developer; +use Drupal\apigee_edge\Entity\DeveloperApp; /** * Developer app analytics test. diff --git a/tests/src/Functional/DeveloperAppApiKeyTest.php b/tests/src/Functional/DeveloperAppApiKeyTest.php index cf082962..39c1b1d8 100644 --- a/tests/src/Functional/DeveloperAppApiKeyTest.php +++ b/tests/src/Functional/DeveloperAppApiKeyTest.php @@ -22,7 +22,6 @@ use Apigee\Edge\Api\Management\Entity\App; use Apigee\Edge\Api\Management\Entity\AppCredentialInterface; use Drupal\apigee_edge\Entity\ApiProduct; -use Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; @@ -288,7 +287,7 @@ public function testAppApiKeyAddMultiple() { "consumerSecret" => $this->randomMachineName(), "status" => AppCredentialInterface::STATUS_APPROVED, "issuedAt" => 1594973277300, - ] + ], ]; } else { @@ -343,7 +342,7 @@ public function testAppApiKeyRevoke() { "consumerKey" => $this->randomMachineName(), "consumerSecret" => $this->randomMachineName(), "status" => AppCredentialInterface::STATUS_APPROVED, - ] + ], ]; } else { diff --git a/tests/src/Functional/DeveloperAppApiKeysPermissionTest.php b/tests/src/Functional/DeveloperAppApiKeysPermissionTest.php index 7a5bfe73..c664a5d9 100644 --- a/tests/src/Functional/DeveloperAppApiKeysPermissionTest.php +++ b/tests/src/Functional/DeveloperAppApiKeysPermissionTest.php @@ -117,7 +117,7 @@ protected function setUp(): void { $this->consumer_key = $credential->getConsumerKey(); $this->apiProduct = $this->createProduct(); - /* @var \Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface $appCredentialController */ + /** @var \Drupal\apigee_edge\Entity\Controller\AppCredentialControllerInterface $appCredentialController */ $appCredentialController = \Drupal::service('apigee_edge.controller.developer_app_credential_factory') ->developerAppCredentialController($this->developerApp->getAppOwner(), $this->developerApp->getName()); $appCredentialController->addProducts($this->consumer_key, [$this->apiProduct->getName()]); diff --git a/tests/src/Functional/DeveloperAppFieldTest.php b/tests/src/Functional/DeveloperAppFieldTest.php index 58c546ce..909c0f06 100644 --- a/tests/src/Functional/DeveloperAppFieldTest.php +++ b/tests/src/Functional/DeveloperAppFieldTest.php @@ -21,14 +21,14 @@ use Apigee\Edge\Api\Management\Controller\DeveloperAppController; use Apigee\Edge\Api\Management\Entity\App; -use Drupal\apigee_edge\Entity\Developer; -use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Url; +use Drupal\Tests\field_ui\Traits\FieldUiTestTrait; +use Drupal\apigee_edge\Entity\Developer; +use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\Tests\field_ui\Traits\FieldUiTestTrait; use Symfony\Component\HttpFoundation\Response; /** @@ -184,7 +184,7 @@ protected function fieldStorageFormattersTest() { 'encoded' => implode(',', [ round(M_PI, 10), round(M_E, 10), - round(M_EULER, 10) + round(M_EULER, 10), ]), ], strtolower($this->randomMachineName()) => [ @@ -250,7 +250,7 @@ protected function fieldStorageFormattersTest() { ], 'data' => [ 0 => 'Zero', - 1 => 'One' + 1 => 'One', ], 'encoded' => '0,1', ], @@ -264,7 +264,7 @@ protected function fieldStorageFormattersTest() { ], 'data' => [ 'zero' => 'Zero', - 'one' => 'One' + 'one' => 'One', ], 'encoded' => 'zero,one', ], @@ -281,10 +281,10 @@ protected function fieldStorageFormattersTest() { 'data' => [ '0' => 'Zero', '0.5' => 'Point five', - '2' => 'Two' + '2' => 'Two', ], 'encoded' => '0.5', - ] + ], ]; // Changes for field of types 'list' fields @@ -352,12 +352,12 @@ protected function typesTest() { /** * {@inheritdoc} */ - public function resetCache(array $ids = NULL) {} + public function resetCache(?array $ids = NULL) {} /** * {@inheritdoc} */ - public function loadMultiple(array $ids = NULL) {} + public function loadMultiple(?array $ids = NULL) {} /** * {@inheritdoc} diff --git a/tests/src/Functional/DeveloperAppPermissionTest.php b/tests/src/Functional/DeveloperAppPermissionTest.php index bbbe7c55..60f9ea1c 100644 --- a/tests/src/Functional/DeveloperAppPermissionTest.php +++ b/tests/src/Functional/DeveloperAppPermissionTest.php @@ -51,13 +51,13 @@ class DeveloperAppPermissionTest extends ApigeeEdgeFunctionalTestBase { 'view any developer_app' => [ 'canonical', 'canonical-by-developer', - 'api-keys' + 'api-keys', ], 'view own developer_app' => [ 'canonical', 'canonical-by-developer', 'collection-by-developer', - 'api-keys' + 'api-keys', ], 'analytics any developer_app' => ['analytics', 'analytics-for-developer'], 'analytics own developer_app' => ['analytics', 'analytics-for-developer'], diff --git a/tests/src/Functional/DeveloperAppUITest.php b/tests/src/Functional/DeveloperAppUITest.php index f637f987..43fad6f2 100644 --- a/tests/src/Functional/DeveloperAppUITest.php +++ b/tests/src/Functional/DeveloperAppUITest.php @@ -20,10 +20,10 @@ namespace Drupal\Tests\apigee_edge\Functional; use Apigee\Edge\Api\Management\Controller\DeveloperController; -use Drupal\apigee_edge\Entity\Developer; -use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Core\Url; use Drupal\Tests\apigee_edge\Traits\EntityUtilsTrait; +use Drupal\apigee_edge\Entity\Developer; +use Drupal\apigee_edge\Entity\DeveloperApp; /** * Developer app UI tests. @@ -335,7 +335,7 @@ public function testAppDefaultProducts() { public function testAppCrudSingleProductChange() { $this->submitAdminForm([ 'display_as_select' => TRUE, - 'multiple_products' => FALSE + 'multiple_products' => FALSE, ]); $this->products[] = $this->createProduct(); @@ -500,7 +500,7 @@ public function testWarningMessagesIfMultipleProductsDisabled() { $this->products[] = $product2; $app = $this->createDeveloperApp([ 'name' => $this->randomMachineName(), - 'displayName' => $this->randomString() + 'displayName' => $this->randomString(), ], $this->account, [$product1->id(), $product2->id()]); $app_edit_url = $app->toUrl('edit-form-for-developer'); @@ -551,18 +551,18 @@ public function testCallbackUrlValidationServerSide() { $this->assertSession()->pageTextContains("Callback URL field is not in the right format."); $this->drupalGet($app_edit_url); $this->submitForm([ - 'callbackUrl[0][value]' => 'map://example.com' + 'callbackUrl[0][value]' => 'map://example.com', ], 'Save'); $this->assertSession()->pageTextContains("Callback URL field is not in the right format."); $this->drupalGet($app_edit_url); $this->submitForm([ - 'callbackUrl[0][value]' => 'http://example.com' + 'callbackUrl[0][value]' => 'http://example.com', ], 'Save'); $this->assertSession()->pageTextContains('App has been successfully updated.'); $this->assertSession()->pageTextContains('http://example.com'); $this->drupalGet($app_edit_url); $this->submitForm([ - 'callbackUrl[0][value]' => 'sap://example.com' + 'callbackUrl[0][value]' => 'sap://example.com', ], 'Save'); $this->assertSession()->pageTextContains('App has been successfully updated.'); $this->assertSession()->pageTextContains('sap://example.com'); diff --git a/tests/src/Functional/DeveloperAppUITestTrait.php b/tests/src/Functional/DeveloperAppUITestTrait.php index 14928c95..4eada9b3 100644 --- a/tests/src/Functional/DeveloperAppUITestTrait.php +++ b/tests/src/Functional/DeveloperAppUITestTrait.php @@ -21,12 +21,12 @@ namespace Drupal\Tests\apigee_edge\Functional; use Apigee\Edge\Structure\CredentialProduct; +use Drupal\Core\Url; +use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\apigee_edge\Entity\DeveloperAppInterface; -use Drupal\Core\Url; -use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; use Drupal\user\UserInterface; /** @@ -61,7 +61,7 @@ trait DeveloperAppUITestTrait { 'view own developer_app', 'update own developer_app', 'delete own developer_app', - 'edit_api_products developer_app' + 'edit_api_products developer_app', ]; /** @@ -342,7 +342,7 @@ protected function assertAppCreationWithProduct(array $products = [], bool $mult * @return \Drupal\apigee_edge\Entity\DeveloperAppInterface|null * Loaded developer app or null if not found. */ - protected function loadDeveloperApp(string $name, Developer $developer = NULL): ?DeveloperAppInterface { + protected function loadDeveloperApp(string $name, ?Developer $developer = NULL): ?DeveloperAppInterface { /** @var \Drupal\apigee_edge\Entity\DeveloperApp[] $apps */ if ($developer) { diff --git a/tests/src/Functional/DeveloperSyncTest.php b/tests/src/Functional/DeveloperSyncTest.php index 9e6c14a8..7c190c2b 100644 --- a/tests/src/Functional/DeveloperSyncTest.php +++ b/tests/src/Functional/DeveloperSyncTest.php @@ -20,13 +20,13 @@ namespace Drupal\Tests\apigee_edge\Functional; use Apigee\Edge\Api\Management\Controller\DeveloperController; +use Drupal\Core\Url; +use Drupal\Tests\field_ui\Traits\FieldUiTestTrait; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Plugin\ApigeeFieldStorageFormat\CSV; use Drupal\apigee_edge\Plugin\ApigeeFieldStorageFormat\JSON; -use Drupal\Core\Url; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\Tests\field_ui\Traits\FieldUiTestTrait; use Drupal\user\Entity\User; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\BufferedOutput; @@ -399,14 +399,14 @@ protected function setUpUserFields() { ], 'data' => [ 0 => 'Zero', - 1 => 'One' + 1 => 'One', ], 'odata' => [ ['value' => 0], - ['value' => 1] + ['value' => 1], ], 'data_changed' => [ - ['value' => 2] + ['value' => 2], ], ], 'list_string' => [ @@ -419,14 +419,14 @@ protected function setUpUserFields() { ], 'data' => [ 'zero' => 'Zero', - 'one' => 'One' + 'one' => 'One', ], 'odata' => [ ['value' => 'zero'], - ['value' => 'one'] + ['value' => 'one'], ], 'data_changed' => [ - ['value' => 'two'] + ['value' => 'two'], ], ], 'list_float' => [ @@ -442,15 +442,15 @@ protected function setUpUserFields() { 'data' => [ '0' => 'Zero', '0.5' => 'Point five', - '2' => 'Two' + '2' => 'Two', ], 'odata' => [ - ['value' => 0.5] + ['value' => 0.5], ], 'data_changed' => [ - ['value' => 0.8] + ['value' => 0.8], ], - ] + ], ]; // Changes for field of types 'list' fields diff --git a/tests/src/Functional/DeveloperTest.php b/tests/src/Functional/DeveloperTest.php index b7bc890c..38d76f60 100644 --- a/tests/src/Functional/DeveloperTest.php +++ b/tests/src/Functional/DeveloperTest.php @@ -23,8 +23,8 @@ use Apigee\Edge\Api\Management\Controller\CompanyMembersController; use Apigee\Edge\Api\Management\Entity\Company; use Apigee\Edge\Api\Management\Structure\CompanyMembership; -use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\DeveloperInterface; use Drupal\user\UserInterface; /** diff --git a/tests/src/Functional/EmailTest.php b/tests/src/Functional/EmailTest.php index a29b6147..9a58c960 100644 --- a/tests/src/Functional/EmailTest.php +++ b/tests/src/Functional/EmailTest.php @@ -19,10 +19,10 @@ namespace Drupal\Tests\apigee_edge\Functional; -use Drupal\apigee_edge\Entity\Developer; -use Drupal\apigee_edge\Form\DeveloperSettingsForm; use Drupal\Core\Test\AssertMailTrait; use Drupal\Core\Url; +use Drupal\apigee_edge\Entity\Developer; +use Drupal\apigee_edge\Form\DeveloperSettingsForm; /** * Developer email already exists in Apigee Edge related tests. diff --git a/tests/src/Functional/StatusReportTest.php b/tests/src/Functional/StatusReportTest.php index 7719c999..e1193a95 100644 --- a/tests/src/Functional/StatusReportTest.php +++ b/tests/src/Functional/StatusReportTest.php @@ -19,9 +19,9 @@ namespace Drupal\Tests\apigee_edge\Functional; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\Component\Serialization\Json; use Drupal\Core\Url; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\key\Entity\Key; /** diff --git a/tests/src/FunctionalJavascript/ApiProductAccessTest.php b/tests/src/FunctionalJavascript/ApiProductAccessTest.php index b0ede6ea..e99bce25 100644 --- a/tests/src/FunctionalJavascript/ApiProductAccessTest.php +++ b/tests/src/FunctionalJavascript/ApiProductAccessTest.php @@ -21,11 +21,11 @@ namespace Drupal\Tests\apigee_edge\FunctionalJavascript; use Apigee\Edge\Api\Management\Entity\App; +use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\apigee_edge\Entity\ApiProductInterface; use Drupal\apigee_edge\Entity\DeveloperApp; -use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Url; use Drupal\user\Entity\User; use Drupal\user\UserInterface; diff --git a/tests/src/FunctionalJavascript/ApigeeEdgeFunctionalJavascriptTestBase.php b/tests/src/FunctionalJavascript/ApigeeEdgeFunctionalJavascriptTestBase.php index b5794cb4..c4e96345 100644 --- a/tests/src/FunctionalJavascript/ApigeeEdgeFunctionalJavascriptTestBase.php +++ b/tests/src/FunctionalJavascript/ApigeeEdgeFunctionalJavascriptTestBase.php @@ -19,9 +19,9 @@ namespace Drupal\Tests\apigee_edge\FunctionalJavascript; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\Tests\apigee_edge\Traits\ApigeeEdgeFunctionalTestTrait; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; /** * Base class for functional javascript tests. diff --git a/tests/src/FunctionalJavascript/CacheTest.php b/tests/src/FunctionalJavascript/CacheTest.php index 187d6a62..a393778c 100644 --- a/tests/src/FunctionalJavascript/CacheTest.php +++ b/tests/src/FunctionalJavascript/CacheTest.php @@ -21,9 +21,9 @@ use Apigee\Edge\Api\Management\Controller\DeveloperAppController; use Apigee\Edge\Api\Management\Entity\App; +use Drupal\Core\Url; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; -use Drupal\Core\Url; /** * Apigee Edge entity cache related tests. diff --git a/tests/src/FunctionalJavascript/Form/AuthenticationFormJsTest.php b/tests/src/FunctionalJavascript/Form/AuthenticationFormJsTest.php index 472b9162..499408f4 100644 --- a/tests/src/FunctionalJavascript/Form/AuthenticationFormJsTest.php +++ b/tests/src/FunctionalJavascript/Form/AuthenticationFormJsTest.php @@ -19,12 +19,12 @@ namespace Drupal\Tests\apigee_edge\FunctionalJavascript\Form; +use Drupal\Core\Url; +use Drupal\Tests\apigee_edge\FunctionalJavascript\ApigeeEdgeFunctionalJavascriptTestBase; use Drupal\apigee_edge\Form\AuthenticationForm; use Drupal\apigee_edge\OauthTokenFileStorage; use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; -use Drupal\Core\Url; use Drupal\key\Entity\Key; -use Drupal\Tests\apigee_edge\FunctionalJavascript\ApigeeEdgeFunctionalJavascriptTestBase; /** * Apigee Edge API credentials, authentication form, key integration test. @@ -318,9 +318,8 @@ protected function validateForm(callable $visitFormAsAdmin): void { // Make sure that test connection is disabled without a password. // $page->fillField('Password', ''); - // $this->assertTrue($this->cssSelect('input[name="test_connection"]')[0]->hasAttribute('disabled')); - // TODO: Enable above test case later. - + // $this->assertTrue($this->cssSelect('input[name="test_connection"]')[0]->hasAttribute('disabled'));. + // @todo Enable above test case later. // Make sure that test connection is now enabled. $page->fillField('Password', $this->password); $this->assertFalse($this->cssSelect('input[name="test_connection"]')[0]->hasAttribute('disabled')); @@ -358,7 +357,7 @@ protected function validateForm(callable $visitFormAsAdmin): void { $random_pass = $this->randomString(); $page->fillField('Password', $random_pass); $this->assertSendRequestMessage('.messages--error', "Failed to connect to Apigee Edge. The given username ({$this->username}) or password is incorrect. Error message: "); - // TODO Re-add this assert later. It had to be disabled because of a + // @todo Re-add this assert later. It had to be disabled because of a // regression bug in the Apigee Edge for Public Cloud 19.03.01 release. If // valid organization name and username provided with an invalid password // the MGMT server returns HTTP 500 with an error instead of HTTP 401. @@ -373,7 +372,7 @@ protected function validateForm(callable $visitFormAsAdmin): void { $this->assertSendRequestMessage('.messages--error', "Failed to connect to Apigee Edge. The organization username should be a valid email. Error message: "); $page->fillField('Username', $this->username); - // TODO Re-add this assert later, if requires. + // @todo Re-add this assert later, if requires. // Irrespective of incorrect organization, username or password it will say Forbidden. // Test invalid organization. // $random_org = $this->randomGenerator->word(16); diff --git a/tests/src/Kernel/ApigeeEdgeKernelTestBase.php b/tests/src/Kernel/ApigeeEdgeKernelTestBase.php index 41446117..9e3041e7 100644 --- a/tests/src/Kernel/ApigeeEdgeKernelTestBase.php +++ b/tests/src/Kernel/ApigeeEdgeKernelTestBase.php @@ -19,8 +19,8 @@ namespace Drupal\Tests\apigee_edge\Kernel; -use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; use Drupal\KernelTests\KernelTestBase; +use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; /** * Base class for kernel tests. diff --git a/tests/src/Kernel/ApigeeX/ApigeeEdgeKernelTestBase.php b/tests/src/Kernel/ApigeeX/ApigeeEdgeKernelTestBase.php index ab88b7ff..ba4b6574 100644 --- a/tests/src/Kernel/ApigeeX/ApigeeEdgeKernelTestBase.php +++ b/tests/src/Kernel/ApigeeX/ApigeeEdgeKernelTestBase.php @@ -19,9 +19,9 @@ namespace Drupal\Tests\apigee_edge\Kernel\ApigeeX; +use Drupal\KernelTests\KernelTestBase; use Drupal\apigee_edge\OauthTokenFileStorage; use Drupal\apigee_edge\Plugin\EdgeKeyTypeInterface; -use Drupal\KernelTests\KernelTestBase; /** * Base class for kernel tests. diff --git a/tests/src/Kernel/Entity/AppWarningsCheckerTest.php b/tests/src/Kernel/Entity/AppWarningsCheckerTest.php index 1420b2be..f64f06f7 100644 --- a/tests/src/Kernel/Entity/AppWarningsCheckerTest.php +++ b/tests/src/Kernel/Entity/AppWarningsCheckerTest.php @@ -22,14 +22,14 @@ use Apigee\Edge\Api\Management\Entity\App; use Apigee\Edge\Api\Management\Entity\AppCredentialInterface; -use Drupal\apigee_edge\Entity\ApiProduct; -use Drupal\apigee_edge\Entity\Developer; -use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestTrait; use Drupal\Tests\apigee_edge\Traits\CredsUtilsTrait; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\Tests\user\Traits\UserCreationTrait; +use Drupal\apigee_edge\Entity\ApiProduct; +use Drupal\apigee_edge\Entity\Developer; +use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\user\Entity\User; use Symfony\Component\HttpFoundation\Request; diff --git a/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php b/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php index 3ec5e6a8..2c507eef 100644 --- a/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php +++ b/tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php @@ -22,16 +22,16 @@ use Apigee\Edge\Api\Management\Entity\App; use Apigee\Edge\Api\Management\Entity\AppCredentialInterface; -use Drupal\apigee_edge\Entity\ApiProduct; -use Drupal\apigee_edge\Entity\AppInterface; -use Drupal\apigee_edge\Entity\Developer; -use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\Component\Utility\Html; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestTrait; use Drupal\Tests\apigee_edge\Traits\CredsUtilsTrait; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\Tests\user\Traits\UserCreationTrait; +use Drupal\apigee_edge\Entity\ApiProduct; +use Drupal\apigee_edge\Entity\AppInterface; +use Drupal\apigee_edge\Entity\Developer; +use Drupal\apigee_edge\Entity\DeveloperApp; use Drupal\user\Entity\User; use Symfony\Component\HttpFoundation\Request; diff --git a/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php b/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php index 0f4db6fb..e74a0b67 100644 --- a/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php +++ b/tests/src/Kernel/Entity/ListBuilder/EntityListBuilderTest.php @@ -60,7 +60,7 @@ class EntityListBuilderTest extends ApigeeEdgeKernelTestBase { 'apigee_mock_api_client', 'key', 'user', - 'options' + 'options', ]; /** @@ -140,7 +140,7 @@ public function testDisplaySettings() { $this->app = $this->createDeveloperApp(); $this->stack->queueMockResponse([ 'get_developer_apps' => [ - 'apps' => [$this->app] + 'apps' => [$this->app], ], ]); diff --git a/tests/src/Kernel/Form/EdgeEntityDisplaySettingsFormTest.php b/tests/src/Kernel/Form/EdgeEntityDisplaySettingsFormTest.php index 7317a504..638f42ed 100644 --- a/tests/src/Kernel/Form/EdgeEntityDisplaySettingsFormTest.php +++ b/tests/src/Kernel/Form/EdgeEntityDisplaySettingsFormTest.php @@ -20,10 +20,10 @@ namespace Drupal\Tests\apigee_edge\Kernel\Form; -use Drupal\apigee_edge\Form\EdgeEntityDisplaySettingsForm; use Drupal\Core\Entity\Entity\EntityViewMode; use Drupal\Core\Form\FormState; use Drupal\KernelTests\KernelTestBase; +use Drupal\apigee_edge\Form\EdgeEntityDisplaySettingsForm; /** * Tests for EdgeEntityDisplaySettingsForm. diff --git a/tests/src/Kernel/OauthTokenFileStorageTest.php b/tests/src/Kernel/OauthTokenFileStorageTest.php index 5fd988ab..ccdeb80b 100644 --- a/tests/src/Kernel/OauthTokenFileStorageTest.php +++ b/tests/src/Kernel/OauthTokenFileStorageTest.php @@ -19,12 +19,12 @@ namespace Drupal\Tests\apigee_edge\Kernel; -use Drupal\apigee_edge\Exception\OauthTokenStorageException; -use Drupal\apigee_edge\OauthTokenFileStorage; use Drupal\Component\Serialization\Json; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\File\FileSystemInterface; use Drupal\KernelTests\KernelTestBase; +use Drupal\apigee_edge\Exception\OauthTokenStorageException; +use Drupal\apigee_edge\OauthTokenFileStorage; /** * OAuth cache storage tests. diff --git a/tests/src/Kernel/TestFrameworkKernelTest.php b/tests/src/Kernel/TestFrameworkKernelTest.php index b7b783be..14747bdb 100644 --- a/tests/src/Kernel/TestFrameworkKernelTest.php +++ b/tests/src/Kernel/TestFrameworkKernelTest.php @@ -19,11 +19,10 @@ namespace Drupal\Tests\apigee_edge\Kernel; -use Drupal\apigee_edge\Entity\Developer; use Drupal\Core\Form\FormState; -use Drupal\Tests\apigee_edge\Kernel\ApigeeEdgeKernelTestBase; use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\Tests\user\Traits\UserCreationTrait; +use Drupal\apigee_edge\Entity\Developer; use GuzzleHttp\Psr7\Response; use Http\Message\Authentication\AutoBasicAuth; diff --git a/tests/src/Kernel/UserAgentTest.php b/tests/src/Kernel/UserAgentTest.php index 55ce5ddc..d3641219 100644 --- a/tests/src/Kernel/UserAgentTest.php +++ b/tests/src/Kernel/UserAgentTest.php @@ -20,7 +20,6 @@ namespace Drupal\Tests\apigee_edge\Kernel; use Drupal\Core\Extension\InfoParser; -use Drupal\Core\Extension\InfoParserInterface; use Drupal\KernelTests\KernelTestBase; /** diff --git a/tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php b/tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php index bb076c23..9b9f5cc5 100644 --- a/tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php +++ b/tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php @@ -20,18 +20,18 @@ namespace Drupal\Tests\apigee_edge\Traits; use Apigee\Edge\Api\Management\Controller\DeveloperAppCredentialController as EdgeDeveloperAppCredentialController; +use Drupal\Core\Utility\Error; +use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\apigee_edge\Entity\Developer; use Drupal\apigee_edge\Entity\DeveloperApp; -use Drupal\Core\Utility\Error; -use Drupal\Tests\apigee_mock_api_client\Traits\ApigeeMockApiClientHelperTrait; use Drupal\user\Entity\User; use Drupal\user\UserInterface; /** * Provides common functionality for the Apigee Edge test classes. * - * TODO Move methods from this trait that can be also used in kernel tests to a + * @todo Move methods from this trait that can be also used in kernel tests to a * new trait, ex.: getRandomUniqueId(), logException(), etc. */ trait ApigeeEdgeFunctionalTestTrait { diff --git a/tests/src/Unit/Command/Util/ApigeeEdgeManagementCliServiceTest.php b/tests/src/Unit/Command/Util/ApigeeEdgeManagementCliServiceTest.php index f6755af6..a9efedbb 100644 --- a/tests/src/Unit/Command/Util/ApigeeEdgeManagementCliServiceTest.php +++ b/tests/src/Unit/Command/Util/ApigeeEdgeManagementCliServiceTest.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge\Unit\Command\Util; use Apigee\Edge\ClientInterface as ApigeeClientInterface; +use Drupal\Tests\UnitTestCase; use Drupal\apigee_edge\Command\Util\ApigeeEdgeManagementCliService; use Drupal\apigee_edge\Command\Util\ApigeeEdgeManagementCliServiceInterface; -use Drupal\Tests\UnitTestCase; use Drush\Utils\StringUtils; use GuzzleHttp\Client; use GuzzleHttp\Exception\ClientException; diff --git a/tests/src/Unit/Commands/ApigeeEdgeCommandsTest.php b/tests/src/Unit/Commands/ApigeeEdgeCommandsTest.php index dcf74d37..6d5244e0 100644 --- a/tests/src/Unit/Commands/ApigeeEdgeCommandsTest.php +++ b/tests/src/Unit/Commands/ApigeeEdgeCommandsTest.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge\Unit\Commands { use Consolidation\AnnotatedCommand\CommandData; + use Drupal\Tests\UnitTestCase; use Drupal\apigee_edge\CliServiceInterface; use Drupal\apigee_edge\Commands\ApigeeEdgeCommands; - use Drupal\Tests\UnitTestCase; use Drush\Style\DrushStyle; use Prophecy\Argument; use Prophecy\Prophet; diff --git a/tests/src/Unit/ConditionTest.php b/tests/src/Unit/ConditionTest.php index ce6296cf..d2586dc2 100644 --- a/tests/src/Unit/ConditionTest.php +++ b/tests/src/Unit/ConditionTest.php @@ -20,9 +20,9 @@ namespace Drupal\Tests\apigee_edge\Unit; use Apigee\Edge\Entity\EntityInterface; -use Drupal\apigee_edge\Entity\Query\Condition; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\Tests\UnitTestCase; +use Drupal\apigee_edge\Entity\Query\Condition; /** * Entity query condition tests. diff --git a/tests/src/Unit/Entity/ApiProductTest.php b/tests/src/Unit/Entity/ApiProductTest.php index 0ea20511..e88de597 100644 --- a/tests/src/Unit/Entity/ApiProductTest.php +++ b/tests/src/Unit/Entity/ApiProductTest.php @@ -19,8 +19,8 @@ namespace Drupal\Tests\apigee_edge\Unit\Entity; -use Drupal\apigee_edge\Entity\ApiProduct; use Drupal\Tests\UnitTestCase; +use Drupal\apigee_edge\Entity\ApiProduct; /** * Test ApiProductTest class. diff --git a/tests/src/Unit/EventSubscriber/EdgeExceptionSubscriberTest.php b/tests/src/Unit/EventSubscriber/EdgeExceptionSubscriberTest.php index de5f8970..6ea1b51b 100644 --- a/tests/src/Unit/EventSubscriber/EdgeExceptionSubscriberTest.php +++ b/tests/src/Unit/EventSubscriber/EdgeExceptionSubscriberTest.php @@ -20,8 +20,6 @@ namespace Drupal\Tests\apigee_edge\Unit\EventSubscriber; use Apigee\Edge\Exception\ApiException; -use Drupal\apigee_edge\Controller\ErrorPageController; -use Drupal\apigee_edge\EventSubscriber\EdgeExceptionSubscriber; use Drupal\Core\Config\Config; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\DependencyInjection\ClassResolverInterface; @@ -29,6 +27,8 @@ use Drupal\Core\Render\MainContent\HtmlRenderer; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Tests\UnitTestCase; +use Drupal\apigee_edge\Controller\ErrorPageController; +use Drupal\apigee_edge\EventSubscriber\EdgeExceptionSubscriber; use Prophecy\Argument; use Prophecy\Prophet; use Psr\Log\LoggerInterface;