Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Use class name instead of self #198

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/FormFields/SessionManagerField.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function setTitleLinkHref(string $titleLinkHref)

public function Field($properties = array())
{
return $this->renderWith(self::class);
return $this->renderWith(SessionManagerField::class);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/GarbageCollectionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function requireDefaultJob(): void

private function queueNextJob(): void
{
$timestamp = time() + self::config()->get('seconds_between_jobs');
$timestamp = time() + static::config()->get('seconds_between_jobs');
QueuedJobService::singleton()->queueJob(
Injector::inst()->create(self::class),
Injector::inst()->create(GarbageCollectionJob::class),
DBDatetime::create()->setValue($timestamp)->Rfc2822()
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/LoginSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function getFriendlyUserAgent(): string
* @param HTTPRequest|null $request
* @return LoginSession|null
*/
public static function getCurrentLoginSession(?HTTPRequest $request = null): ?self
public static function getCurrentLoginSession(?HTTPRequest $request = null): ?LoginSession
{
// Fall back to retrieving request from current Controller if available
if ($request === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Services/GarbageCollectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function collect(): void

private function batchRemoveAll($datalist)
{
$limit = self::config()->get('batch_remove_limit');
$limit = static::config()->get('batch_remove_limit');
$limitedList = $datalist->limit($limit);
DB::get_conn()->transactionStart();
foreach ($limitedList as $record) {
Expand Down
16 changes: 8 additions & 8 deletions tests/php/Extensions/ForcePermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ class ForcePermission extends DataExtension implements TestOnly

public static function forceCanView($val)
{
self::$canView = $val;
ForcePermission::$canView = $val;
}

public static function forceCanDelete($val)
{
self::$canDelete = $val;
ForcePermission::$canDelete = $val;
}

public static function reset()
{
self::$canView = null;
self::$canDelete = null;
ForcePermission::$canView = null;
ForcePermission::$canDelete = null;
}

public function canView($member)
{
if (self::$canView !== null) {
return self::$canView;
if (ForcePermission::$canView !== null) {
return ForcePermission::$canView;
}
}

public function canDelete($member)
{
if (self::$canDelete !== null) {
return self::$canDelete;
if (ForcePermission::$canDelete !== null) {
return ForcePermission::$canDelete;
}
}
}
Loading