Skip to content
Snippets Groups Projects
Commit 524967d2 authored by Ide Braakman's avatar Ide Braakman Committed by Florian Weber
Browse files

Issue #3479098 by idebr, webflo: Fix newly reported phpcs issues in latest pipeline

parent 38a09f93
No related branches found
No related tags found
1 merge request!117Issue #3479098: Fix newly reported phpcs issues in latest pipeline
Pipeline #303327 passed
Showing
with 24 additions and 24 deletions
......@@ -74,7 +74,7 @@ class DomainAccessControlHandler extends EntityAccessControlHandler implements E
/**
* {@inheritdoc}
*/
public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account = NULL) {
public function checkAccess(EntityInterface $entity, $operation, ?AccountInterface $account = NULL) {
if (!($entity instanceof DomainInterface)) {
return AccessResult::neutral();
}
......
......@@ -80,7 +80,7 @@ class DomainStorage extends ConfigEntityStorage implements DomainStorageInterfac
/**
* {@inheritdoc}
*/
public function loadMultipleSorted(array $ids = NULL) {
public function loadMultipleSorted(?array $ids = NULL) {
$domains = $this->loadMultiple($ids);
uasort($domains, [$this, 'sort']);
......
......@@ -34,7 +34,7 @@ interface DomainStorageInterface extends ConfigEntityStorageInterface {
* @return \Drupal\domain\DomainInterface[]
* An array of domain records.
*/
public function loadMultipleSorted(array $ids = NULL);
public function loadMultipleSorted(?array $ids = NULL);
/**
* Loads a domain record by hostname lookup.
......
......@@ -21,7 +21,7 @@ class DefaultDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function execute(DomainInterface $domain = NULL) {
public function execute(?DomainInterface $domain = NULL) {
$domain->saveDefault();
}
......@@ -39,7 +39,7 @@ class DefaultDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
$access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
return $return_as_object ? $access_result : $access_result->isAllowed();
}
......
......@@ -21,7 +21,7 @@ class DeleteDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function execute(DomainInterface $domain = NULL) {
public function execute(?DomainInterface $domain = NULL) {
$domain->delete();
}
......@@ -39,7 +39,7 @@ class DeleteDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
$access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
return $return_as_object ? $access_result : $access_result->isAllowed();
}
......
......@@ -21,7 +21,7 @@ class DisableDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function execute(DomainInterface $domain = NULL) {
public function execute(?DomainInterface $domain = NULL) {
$domain->disable();
}
......@@ -39,7 +39,7 @@ class DisableDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
$access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
return $return_as_object ? $access_result : $access_result->isAllowed();
}
......
......@@ -21,7 +21,7 @@ class EnableDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function execute(DomainInterface $domain = NULL) {
public function execute(?DomainInterface $domain = NULL) {
$domain->enable();
}
......@@ -39,7 +39,7 @@ class EnableDomain extends ActionBase {
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
$access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
return $return_as_object ? $access_result : $access_result->isAllowed();
}
......
......@@ -4,9 +4,9 @@ namespace Drupal\Tests\domain\Functional;
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Session\AccountInterface;
use Drupal\domain\DomainInterface;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\domain\Traits\DomainTestTrait;
use Drupal\domain\DomainInterface;
/**
* Base test class for Domain.
......
......@@ -3,9 +3,9 @@
namespace Drupal\Tests\domain\Functional\Views;
use Drupal\Core\Url;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\Tests\domain\Traits\DomainTestTrait;
use Drupal\domain_access\DomainAccessManagerInterface;
/**
* Tests the active_domain default argument.
......
......@@ -437,7 +437,7 @@ function domain_access_node_create_access(AccountInterface $account, $context, $
* Hides the domain access fields from the entity add/edit forms
* when the user cannot access them.
*/
function domain_access_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
function domain_access_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL) {
// If not editing an entity, do nothing.
if ($operation !== 'edit' || is_null($items)) {
return AccessResult::neutral();
......
......@@ -100,7 +100,7 @@ abstract class DomainAccessActionBase extends ConfigurableActionBase implements
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
/** @var \Drupal\user\UserInterface $object */
// @todo fix this logic.
$access = $object->access('update', $account, TRUE);
......
......@@ -2,9 +2,9 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManager;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\Tests\domain\Functional\DomainTestBase;
/**
* Tests the domain access entity reference field type.
......
......@@ -3,8 +3,8 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Core\Url;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManagerInterface;
/**
* Tests behavior for getting all URLs for an entity.
......
......@@ -2,8 +2,8 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\domain_access\DomainAccessManager;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManager;
/**
* Tests the domain access handling of default field values.
......
......@@ -2,9 +2,9 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManager;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\Tests\domain\Functional\DomainTestBase;
/**
* Tests behavior for the domain access field element.
......
......@@ -3,8 +3,8 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Core\Language\LanguageInterface;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\taxonomy\Entity\Vocabulary;
/**
* Tests the domain access entity reference field type for custom entities.
......
......@@ -2,8 +2,8 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\domain_access\DomainAccessManager;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManager;
/**
* Tests the domain access entity reference field type.
......
......@@ -2,9 +2,9 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\domain\Functional\DomainTestBase;
/**
* Tests the domain access entity reference field type.
......
......@@ -3,8 +3,8 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Core\Database\Database;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManagerInterface;
/**
* Tests the application of domain access grants.
......
......@@ -2,10 +2,10 @@
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Tests\domain\Functional\DomainTestBase;
use Drupal\domain_access\DomainAccessManager;
use Drupal\domain_access\DomainAccessManagerInterface;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Tests\domain\Functional\DomainTestBase;
/**
* Tests saving the domain access field elements in multiple languages.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment