mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
refactor: Replace __CLASS__ with ::class references
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
5a8d0a2721
commit
1ee833efab
7 changed files with 15 additions and 15 deletions
|
|
@ -42,7 +42,7 @@ class LoginListener implements IEventListener {
|
|||
|
||||
public function onPostLogin(IUser $user): void {
|
||||
$this->logger->info(
|
||||
__CLASS__ . ' - {user} postLogin',
|
||||
self::class . ' - {user} postLogin',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $user->getUID(),
|
||||
|
|
@ -67,7 +67,7 @@ class LoginListener implements IEventListener {
|
|||
$groupObject = $this->groupManager->get($groupId);
|
||||
if ($groupObject === null) {
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} could not be found (user {user})',
|
||||
self::class . ' - group {group} could not be found (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $userId,
|
||||
|
|
@ -81,7 +81,7 @@ class LoginListener implements IEventListener {
|
|||
} catch (Exception $e) {
|
||||
if ($e->getReason() !== Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} membership failed to be added (user {user})',
|
||||
self::class . ' - group {group} membership failed to be added (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $userId,
|
||||
|
|
@ -96,7 +96,7 @@ class LoginListener implements IEventListener {
|
|||
$this->groupBackend->addRelationshipToCaches($userId, null, $groupId);
|
||||
$this->dispatcher->dispatchTyped(new UserAddedEvent($groupObject, $userObject));
|
||||
$this->logger->info(
|
||||
__CLASS__ . ' - {user} added to {group}',
|
||||
self::class . ' - {user} added to {group}',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $userId,
|
||||
|
|
@ -110,7 +110,7 @@ class LoginListener implements IEventListener {
|
|||
} catch (Exception $e) {
|
||||
if ($e->getReason() !== Exception::REASON_DATABASE_OBJECT_NOT_FOUND) {
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} membership failed to be removed (user {user})',
|
||||
self::class . ' - group {group} membership failed to be removed (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $userId,
|
||||
|
|
@ -125,7 +125,7 @@ class LoginListener implements IEventListener {
|
|||
$groupObject = $this->groupManager->get($groupId);
|
||||
if ($groupObject === null) {
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} could not be found (user {user})',
|
||||
self::class . ' - group {group} could not be found (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $userId,
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class UpdateGroupsService {
|
|||
if ($e->getReason() !== Exception::REASON_DATABASE_OBJECT_NOT_FOUND) {
|
||||
/* If reason is not found something else removed the membership, that’s fine */
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} membership failed to be removed (user {user})',
|
||||
self::class . ' - group {group} membership failed to be removed (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $removedUser,
|
||||
|
|
@ -121,7 +121,7 @@ class UpdateGroupsService {
|
|||
if ($e->getReason() !== Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||
/* If reason is unique constraint something else added the membership, that’s fine */
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} membership failed to be added (user {user})',
|
||||
self::class . ' - group {group} membership failed to be added (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $addedUser,
|
||||
|
|
@ -167,7 +167,7 @@ class UpdateGroupsService {
|
|||
} catch (Exception $e) {
|
||||
if ($e->getReason() !== Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||
$this->logger->error(
|
||||
__CLASS__ . ' - group {group} membership failed to be added (user {user})',
|
||||
self::class . ' - group {group} membership failed to be added (user {user})',
|
||||
[
|
||||
'app' => 'user_ldap',
|
||||
'user' => $user,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class MemoryCacheBackend implements IBackend {
|
|||
ICacheFactory $cacheFactory,
|
||||
private ITimeFactory $timeFactory,
|
||||
) {
|
||||
$this->cache = $cacheFactory->createDistributed(__CLASS__);
|
||||
$this->cache = $cacheFactory->createDistributed(self::class);
|
||||
}
|
||||
|
||||
private function hash(
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class MemoryCacheBackend implements IBackend {
|
|||
ICacheFactory $cacheFactory,
|
||||
private ITimeFactory $timeFactory,
|
||||
) {
|
||||
$this->cache = $cacheFactory->createDistributed(__CLASS__);
|
||||
$this->cache = $cacheFactory->createDistributed(self::class);
|
||||
}
|
||||
|
||||
private function hash(
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ class LockNotAcquiredException extends \Exception {
|
|||
* @since 7.0.0
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||
return self::class . ": [{$this->code}]: {$this->message}\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class HintException extends \Exception {
|
|||
* @return string
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
|
||||
return self::class . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
|
|||
public function testGetAnnotationParameterSingle() {
|
||||
$reader = new ControllerMethodReflector();
|
||||
$reader->reflect(
|
||||
__CLASS__,
|
||||
self::class,
|
||||
__FUNCTION__
|
||||
);
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
|
|||
public function testGetAnnotationParameterMultiple() {
|
||||
$reader = new ControllerMethodReflector();
|
||||
$reader->reflect(
|
||||
__CLASS__,
|
||||
self::class,
|
||||
__FUNCTION__
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue