Skip to content

Commit

Permalink
Merge pull request #344 from creative-commoners/pulls/2.2/remove-self
Browse files Browse the repository at this point in the history
ENH Use class name instead of self
  • Loading branch information
GuySartorelli authored Jun 17, 2024
2 parents e5e2e78 + 6a731c2 commit d1fd54e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/Controllers/HistoryViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class HistoryViewerController extends LeftAndMain
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';

private static $allowed_actions = [
self::FORM_NAME_VERSION,
self::FORM_NAME_COMPARE,
HistoryViewerController::FORM_NAME_VERSION,
HistoryViewerController::FORM_NAME_COMPARE,
'schema',
];

Expand All @@ -51,7 +51,7 @@ class HistoryViewerController extends LeftAndMain
*
* @var string[]
*/
protected $formNames = [self::FORM_NAME_VERSION, self::FORM_NAME_COMPARE];
protected $formNames = [HistoryViewerController::FORM_NAME_VERSION, HistoryViewerController::FORM_NAME_COMPARE];

public function getClientConfig()
{
Expand Down Expand Up @@ -93,15 +93,15 @@ protected function generateSchemaForForm($formName, HTTPRequest $request): HTTPR
{
switch ($formName) {
// Get schema for history form
case self::FORM_NAME_VERSION:
case HistoryViewerController::FORM_NAME_VERSION:
$form = $this->getVersionForm([
'RecordClass' => $request->getVar('RecordClass'),
'RecordID' => $request->getVar('RecordID'),
'RecordVersion' => $request->getVar('RecordVersion'),
'RecordDate' => $request->getVar('RecordDate'),
]);
break;
case self::FORM_NAME_COMPARE:
case HistoryViewerController::FORM_NAME_COMPARE:
$form = $this->getCompareForm([
'RecordClass' => $request->getVar('RecordClass'),
'RecordID' => $request->getVar('RecordID'),
Expand Down Expand Up @@ -163,7 +163,7 @@ protected function getVersionFormByDate(array $context)
$effectiveContext = array_merge($context, ['Record' => $record]);

// Ensure the form is scaffolded with archive date enabled.
$form = $this->scaffoldForm(self::FORM_NAME_VERSION, $effectiveContext, [
$form = $this->scaffoldForm(HistoryViewerController::FORM_NAME_VERSION, $effectiveContext, [
$recordClass,
$recordId,
]);
Expand Down Expand Up @@ -191,7 +191,7 @@ protected function getVersionFormByVersion(array $context)

$effectiveContext = array_merge($context, ['Record' => $record]);

return $this->scaffoldForm(self::FORM_NAME_VERSION, $effectiveContext, [
return $this->scaffoldForm(HistoryViewerController::FORM_NAME_VERSION, $effectiveContext, [
$recordClass,
$recordId,
]);
Expand Down Expand Up @@ -251,7 +251,7 @@ public function getCompareForm(array $context)

$effectiveContext = array_merge($context, ['Record' => $recordTo]);

$form = $this->scaffoldForm(self::FORM_NAME_COMPARE, $effectiveContext, [
$form = $this->scaffoldForm(HistoryViewerController::FORM_NAME_COMPARE, $effectiveContext, [
$recordClass,
$recordId,
$recordVersionFrom,
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/DataObjectVersionFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DataObjectVersionFormFactory implements FormFactory
* @var string[]
*/
private static $readonly_types = [
self::TYPE_HISTORY,
DataObjectVersionFormFactory::TYPE_HISTORY,
];

public function getForm(RequestHandler $controller = null, $name = FormFactory::DEFAULT_NAME, $context = [])
Expand Down

0 comments on commit d1fd54e

Please sign in to comment.