Skip to content

Commit

Permalink
run phpcbf
Browse files Browse the repository at this point in the history
  • Loading branch information
xini committed Aug 22, 2024
1 parent f38178f commit 483db32
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/Extension/ChangeRecordable.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public function onBeforeVersionedPublish($from, $to)
*
* @return \SilverStripe\ORM\DataList
*/
public function getDataChangesList() {
public function getDataChangesList()
{
return DataChangeRecord::get()->filter([
'ChangeRecordID' => $this->owner->ID,
'ChangeRecordClass' => $this->owner->ClassName
Expand Down
1 change: 0 additions & 1 deletion src/Job/PruneChangesBeforeJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ public function process()
Injector::inst()->get(QueuedJobService::class)->queueJob($job, $next);
}
}

9 changes: 4 additions & 5 deletions src/Model/DataChangeRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function getCMSFields($params = null)
$prop = json_encode($prop);
}
$changedFields[] = $readOnly = \SilverStripe\Forms\ReadonlyField::create(
'ChangedField'.$field,
'ChangedField' . $field,
$field,
$prop
);
Expand All @@ -132,7 +132,6 @@ public function getCMSFields($params = null)
ToggleCompositeField::create('FieldChanges', 'Changed Fields', $changedFields)
->setStartClosed(false)
->addExtraClass('datachange-field')

);
}

Expand All @@ -147,7 +146,7 @@ public function getCMSFields($params = null)
$value,
'forTemplate'
)) {
$field->setValue('[Missing '.$value::class.'::forTemplate]');
$field->setValue('[Missing ' . $value::class . '::forTemplate]');
}
}
}
Expand Down Expand Up @@ -249,7 +248,7 @@ public function track(DataObject $changedObject, $type = 'Change')
$protocol = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on" ? 'https://' : 'http://';
$port = $_SERVER['SERVER_PORT'] ?? '80';

$this->CurrentURL = $protocol.$_SERVER["SERVER_NAME"].":".$port.$_SERVER["REQUEST_URI"];
$this->CurrentURL = $protocol . $_SERVER["SERVER_NAME"] . ":" . $port . $_SERVER["REQUEST_URI"];
} elseif (Director::is_cli()) {
$this->CurrentURL = 'CLI';
} else {
Expand Down Expand Up @@ -277,7 +276,7 @@ public function canDelete($member = null)
* */
public function getTitle()
{
return $this->ChangeRecordClass.' #'.$this->ChangeRecordID;
return $this->ChangeRecordClass . ' #' . $this->ChangeRecordID;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Service/DataChangeTrackService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public function track(DataObject $object, $type = 'Change')
$this->dcr_cache["{$object->ID}-{$object->Classname}"]->track($object, $type);
}

public function resetChangeCache() {
public function resetChangeCache()
{
$this->dcr_cache = [];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/DataChangeCMSTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testCMSFieldsWithJSONData()
// View in the CMS.
$this->logInWithPermission('ADMIN');
$dataChangeTrackEditID = $dataChangeTrackRecordIds[0];
$editLink = 'admin/datachanges/Symbiote-DataChange-Model-DataChangeRecord/EditForm/field/Symbiote-DataChange-Model-DataChangeRecord/item/'.$dataChangeTrackEditID.'/edit';
$editLink = 'admin/datachanges/Symbiote-DataChange-Model-DataChangeRecord/EditForm/field/Symbiote-DataChange-Model-DataChangeRecord/item/' . $dataChangeTrackEditID . '/edit';

// NOTE(Jake): 2018-06-25
//
Expand Down
3 changes: 2 additions & 1 deletion tests/TestTextJSONFieldObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class TestTextJSONFieldObject extends DataObject implements TestOnly
*
* This getter pattern was used in at least 1 internal Symbiote project.
*/
public function getTextFieldWithJSON() {
public function getTextFieldWithJSON()
{
$value = $this->getField('TextFieldWithJSON');
if (is_string($value)) {
$value = json_decode($value, true);
Expand Down

0 comments on commit 483db32

Please sign in to comment.