diff --git a/core/core.services.yml b/core/core.services.yml index 2f3a696..380ed6e 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1208,13 +1208,13 @@ services: tags: - { name: event_subscriber } account_switcher: - class: Drupal\Core\Session\AccountSwitcher + class: Drupal\Core\Authentication\AccountSwitcher arguments: ['@current_user', '@session_handler.write_safe'] user_permissions_hash_generator: class: Drupal\Core\Session\PermissionsHashGenerator arguments: ['@private_key', '@cache.default'] current_user: - class: Drupal\Core\Session\AccountProxy + class: Drupal\Core\Authentication\AccountProxy session_configuration: class: Drupal\Core\Session\SessionConfiguration arguments: ['%session.storage.options%'] diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index f949669..29eca34 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -240,7 +240,7 @@ public static function routeMatch() { /** * Gets the current active user. * - * @return \Drupal\Core\Session\AccountProxyInterface + * @return \Drupal\Core\Authentication\AccountProxyInterface */ public static function currentUser() { return static::getContainer()->get('current_user'); diff --git a/core/lib/Drupal/Core/Authentication/AccountProxyInterface.php b/core/lib/Drupal/Core/Authentication/AccountProxyInterface.php index 2ffa241..dc24a68 100644 --- a/core/lib/Drupal/Core/Authentication/AccountProxyInterface.php +++ b/core/lib/Drupal/Core/Authentication/AccountProxyInterface.php @@ -21,8 +21,8 @@ * inject the desired user object into the dependent code directly. * * A preferable method of account impersonation is to use - * \Drupal\Core\Session\AccountSwitcherInterface::switchTo() and - * \Drupal\Core\Session\AccountSwitcherInterface::switchBack(). + * \Drupal\Core\Authentication\AccountSwitcherInterface::switchTo() and + * \Drupal\Core\Authentication\AccountSwitcherInterface::switchBack(). * * @param \Drupal\Core\Authentication\AccountInterface $account * The current account. diff --git a/core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php b/core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php index ae0621c..3362129 100644 --- a/core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php +++ b/core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php @@ -10,7 +10,7 @@ /** * Defines the TimeZoneCacheContext service, for "per time zone" caching. * - * @see \Drupal\Core\Session\AccountProxy::setAccount() + * @see \Drupal\Core\Authentication\AccountProxy::setAccount() */ class TimeZoneCacheContext implements CacheContextInterface { diff --git a/core/lib/Drupal/Core/Cron.php b/core/lib/Drupal/Core/Cron.php index 615489f..1fec276 100644 --- a/core/lib/Drupal/Core/Cron.php +++ b/core/lib/Drupal/Core/Cron.php @@ -13,7 +13,7 @@ use Drupal\Core\Lock\LockBackendInterface; use Drupal\Core\Queue\QueueFactory; use Drupal\Core\Authentication\AnonymousUserSession; -use Drupal\Core\Session\AccountSwitcherInterface; +use Drupal\Core\Authentication\AccountSwitcherInterface; use Drupal\Core\Queue\SuspendQueueException; use Psr\Log\LoggerInterface; @@ -53,7 +53,7 @@ class Cron implements CronInterface { /** * The account switcher service. * - * @var \Drupal\Core\Session\AccountSwitcherInterface + * @var \Drupal\Core\Authentication\AccountSwitcherInterface */ protected $accountSwitcher; @@ -82,7 +82,7 @@ class Cron implements CronInterface { * The queue service. * @param \Drupal\Core\State\StateInterface $state * The state service. - * @param \Drupal\Core\Session\AccountSwitcherInterface $account_switcher + * @param \Drupal\Core\Authentication\AccountSwitcherInterface $account_switcher * The account switching service. * @param \Psr\Log\LoggerInterface $logger * A logger instance. diff --git a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php index 6fd0b99..a62b535 100644 --- a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php @@ -10,7 +10,7 @@ use Drupal\Core\Authentication\AuthenticationProviderFilterInterface; use Drupal\Core\Authentication\AuthenticationProviderChallengeInterface; use Drupal\Core\Authentication\AuthenticationProviderInterface; -use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Authentication\AccountProxyInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; @@ -49,7 +49,7 @@ class AuthenticationSubscriber implements EventSubscriberInterface { /** * Account proxy. * - * @var \Drupal\Core\Session\AccountProxyInterface + * @var \Drupal\Core\Authentication\AccountProxyInterface */ protected $accountProxy; @@ -58,7 +58,7 @@ class AuthenticationSubscriber implements EventSubscriberInterface { * * @param \Drupal\Core\Authentication\AuthenticationProviderInterface $authentication_provider * An authentication provider. - * @param \Drupal\Core\Session\AccountProxyInterface $account_proxy + * @param \Drupal\Core\Authentication\AccountProxyInterface $account_proxy * Account proxy. */ public function __construct(AuthenticationProviderInterface $authentication_provider, AccountProxyInterface $account_proxy) { diff --git a/core/modules/comment/src/Tests/Views/CommentUserNameTest.php b/core/modules/comment/src/Tests/Views/CommentUserNameTest.php index 8bc932c..3f7e4d4 100644 --- a/core/modules/comment/src/Tests/Views/CommentUserNameTest.php +++ b/core/modules/comment/src/Tests/Views/CommentUserNameTest.php @@ -133,7 +133,7 @@ public function testUsername() { ]); $view->save(); - /* @var \Drupal\Core\Session\AccountSwitcherInterface $account_switcher */ + /* @var \Drupal\Core\Authentication\AccountSwitcherInterface $account_switcher */ $account_switcher = \Drupal::service('account_switcher'); /* @var \Drupal\Core\Render\RendererInterface $renderer */ diff --git a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php index 202f6a4..6dc87be 100644 --- a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php +++ b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php @@ -44,7 +44,7 @@ class CommentLinkBuilderTest extends UnitTestCase { /** * Current user proxy mock. * - * @var \Drupal\Core\Session\AccountProxyInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Authentication\AccountProxyInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $currentUser; @@ -67,7 +67,7 @@ protected function setUp() { $this->commentManager = $this->getMock('\Drupal\comment\CommentManagerInterface'); $this->stringTranslation = $this->getStringTranslationStub(); $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface'); - $this->currentUser = $this->getMock('\Drupal\Core\Session\AccountProxyInterface'); + $this->currentUser = $this->getMock('\Drupal\Core\Authentication\AccountProxyInterface'); $this->commentLinkBuilder = new CommentLinkBuilder($this->currentUser, $this->commentManager, $this->moduleHandler, $this->stringTranslation); $this->commentManager->expects($this->any()) ->method('getFields') diff --git a/core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraintValidator.php b/core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraintValidator.php index 7011ff3..a48c6f9 100644 --- a/core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraintValidator.php +++ b/core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraintValidator.php @@ -7,7 +7,7 @@ namespace Drupal\link\Plugin\Validation\Constraint; -use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Authentication\AccountProxyInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Validator\Constraint; @@ -29,14 +29,14 @@ class LinkAccessConstraintValidator implements ConstraintValidatorInterface, Con /** * Proxy for the current user account. * - * @var \Drupal\Core\Session\AccountProxyInterface + * @var \Drupal\Core\Authentication\AccountProxyInterface */ protected $current_user; /** * Constructs an instance of the LinkAccessConstraintValidator class. * - * @param \Drupal\Core\Session\AccountProxyInterface $current_user + * @param \Drupal\Core\Authentication\AccountProxyInterface $current_user * The current user account. */ public function __construct(AccountProxyInterface $current_user) { diff --git a/core/modules/link/tests/src/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php b/core/modules/link/tests/src/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php index a3711ec..701d824 100644 --- a/core/modules/link/tests/src/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php +++ b/core/modules/link/tests/src/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php @@ -26,7 +26,7 @@ class LinkAccessConstraintValidatorTest extends UnitTestCase { * * @param \Drupal\link\LinkItemInterface $value * The link item. - * @param \Drupal\Core\Session\AccountProxyInterface $user + * @param \Drupal\Core\Authentication\AccountProxyInterface $user * The user account. * @param bool $valid * A boolean indicating if the combination is expected to be valid. @@ -86,7 +86,7 @@ public function providerValidate() { ->willReturn($url); // Mock a user object that returns a boolean indicating user access to all // links. - $user = $this->getMock('Drupal\Core\Session\AccountProxyInterface'); + $user = $this->getMock('Drupal\Core\Authentication\AccountProxyInterface'); $user->expects($this->any()) ->method('hasPermission') ->with($this->equalTo('link to any page')) diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 7f60ecc..6a506f5 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -17,8 +17,6 @@ use Drupal\Core\Database\ConnectionNotDefinedException; use Drupal\Core\Config\StorageInterface; use Drupal\Core\Language\Language; -use Drupal\Core\Session\AccountProxy; -use Drupal\Core\Authentication\AnonymousUserSession; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\Utility\Error; @@ -217,7 +215,7 @@ /** * The original user, before testing began. * - * @var \Drupal\Core\Session\AccountProxyInterface + * @var \Drupal\Core\Authentication\AccountProxyInterface */ protected $originalUser; diff --git a/core/modules/system/core.api.php b/core/modules/system/core.api.php index 304652b..f4eed23 100644 --- a/core/modules/system/core.api.php +++ b/core/modules/system/core.api.php @@ -635,7 +635,7 @@ * - \Drupal\Core\Authentication\AccountInterface: The part of UserInterface that * deals with access checking. In writing code that checks access, your * method parameters should use this interface, not UserInterface. - * - \Drupal\Core\Session\AccountProxyInterface: The interface for the + * - \Drupal\Core\Authentication\AccountProxyInterface: The interface for the * current_user service (described above). * @} */ diff --git a/core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php b/core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php index d99fc5d..68c5cb1 100644 --- a/core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php +++ b/core/modules/user/src/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidator.php @@ -7,7 +7,7 @@ namespace Drupal\user\Plugin\Validation\Constraint; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; -use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Authentication\AccountProxyInterface; use Drupal\user\UserStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Validator\Constraint; @@ -28,7 +28,7 @@ class ProtectedUserFieldConstraintValidator extends ConstraintValidator implemen /** * The current user. * - * @var \Drupal\Core\Session\AccountProxyInterface + * @var \Drupal\Core\Authentication\AccountProxyInterface */ protected $currentUser; @@ -37,7 +37,7 @@ class ProtectedUserFieldConstraintValidator extends ConstraintValidator implemen * * @param \Drupal\user\UserStorageInterface $user_storage * The user storage handler. - * @param \Drupal\Core\Session\AccountProxyInterface $current_user + * @param \Drupal\Core\Authentication\AccountProxyInterface $current_user * The current user. */ public function __construct(UserStorageInterface $user_storage, AccountProxyInterface $current_user) { diff --git a/core/modules/user/src/PrivateTempStore.php b/core/modules/user/src/PrivateTempStore.php index 79be710..4f00bf4 100644 --- a/core/modules/user/src/PrivateTempStore.php +++ b/core/modules/user/src/PrivateTempStore.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface; use Drupal\Core\Lock\LockBackendInterface; -use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Authentication\AccountProxyInterface; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -51,7 +51,7 @@ class PrivateTempStore { /** * The current user. * - * @var \Drupal\Core\Session\AccountProxyInterface + * @var \Drupal\Core\Authentication\AccountProxyInterface */ protected $currentUser; diff --git a/core/modules/user/src/PrivateTempStoreFactory.php b/core/modules/user/src/PrivateTempStoreFactory.php index bd62633..d438aba 100644 --- a/core/modules/user/src/PrivateTempStoreFactory.php +++ b/core/modules/user/src/PrivateTempStoreFactory.php @@ -9,7 +9,7 @@ use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface; use Drupal\Core\Lock\LockBackendInterface; -use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Authentication\AccountProxyInterface; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -34,7 +34,7 @@ class PrivateTempStoreFactory { /** * The current user. * - * @var \Drupal\Core\Session\AccountProxyInterface + * @var \Drupal\Core\Authentication\AccountProxyInterface */ protected $currentUser; diff --git a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php index e0c068e..e7b754f 100644 --- a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php +++ b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php @@ -35,7 +35,7 @@ protected function createValidator() { $user_storage->expects($this->any()) ->method('loadUnchanged') ->willReturn($unchanged_account); - $current_user = $this->getMock('Drupal\Core\Session\AccountProxyInterface'); + $current_user = $this->getMock('Drupal\Core\Authentication\AccountProxyInterface'); $current_user->expects($this->any()) ->method('id') ->willReturn('current-user'); diff --git a/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php b/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php index a2d3d95..6fe6765 100644 --- a/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php +++ b/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php @@ -42,7 +42,7 @@ class PrivateTempStoreTest extends UnitTestCase { /** * The current user. * - * @var \Drupal\Core\Session\AccountProxyInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Authentication\AccountProxyInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $currentUser; @@ -75,7 +75,7 @@ protected function setUp() { $this->keyValue = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface'); $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface'); - $this->currentUser = $this->getMock('Drupal\Core\Session\AccountProxyInterface'); + $this->currentUser = $this->getMock('Drupal\Core\Authentication\AccountProxyInterface'); $this->currentUser->expects($this->any()) ->method('id') ->willReturn(1); diff --git a/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php b/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php index 5554a8a..08ccff4 100644 --- a/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php +++ b/core/modules/views/src/Tests/Handler/FieldFieldAccessTestBase.php @@ -116,7 +116,7 @@ protected function assertFieldAccess($entity_type_id, $field_name, $field_conten ]); $entity->save(); - /** @var \Drupal\Core\Session\AccountSwitcherInterface $account_switcher */ + /** @var \Drupal\Core\Authentication\AccountSwitcherInterface $account_switcher */ $account_switcher = \Drupal::service('account_switcher'); /** @var \Drupal\Core\Render\RendererInterface $renderer */