diff --git a/src/Extension/ChangeRecordable.php b/src/Extension/ChangeRecordable.php index 3eacad2..be70c4f 100644 --- a/src/Extension/ChangeRecordable.php +++ b/src/Extension/ChangeRecordable.php @@ -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 diff --git a/src/Job/PruneChangesBeforeJob.php b/src/Job/PruneChangesBeforeJob.php index 50b2f7a..87987bf 100644 --- a/src/Job/PruneChangesBeforeJob.php +++ b/src/Job/PruneChangesBeforeJob.php @@ -69,4 +69,3 @@ public function process() Injector::inst()->get(QueuedJobService::class)->queueJob($job, $next); } } - diff --git a/src/Model/DataChangeRecord.php b/src/Model/DataChangeRecord.php index 4c11e52..4ce0caf 100644 --- a/src/Model/DataChangeRecord.php +++ b/src/Model/DataChangeRecord.php @@ -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 ); @@ -132,7 +132,6 @@ public function getCMSFields($params = null) ToggleCompositeField::create('FieldChanges', 'Changed Fields', $changedFields) ->setStartClosed(false) ->addExtraClass('datachange-field') - ); } @@ -147,7 +146,7 @@ public function getCMSFields($params = null) $value, 'forTemplate' )) { - $field->setValue('[Missing '.$value::class.'::forTemplate]'); + $field->setValue('[Missing ' . $value::class . '::forTemplate]'); } } } @@ -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 { @@ -277,7 +276,7 @@ public function canDelete($member = null) * */ public function getTitle() { - return $this->ChangeRecordClass.' #'.$this->ChangeRecordID; + return $this->ChangeRecordClass . ' #' . $this->ChangeRecordID; } /** diff --git a/src/Service/DataChangeTrackService.php b/src/Service/DataChangeTrackService.php index f146aa4..2ab323d 100644 --- a/src/Service/DataChangeTrackService.php +++ b/src/Service/DataChangeTrackService.php @@ -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 = []; } diff --git a/tests/DataChangeCMSTest.php b/tests/DataChangeCMSTest.php index 04ba617..9d4bf21 100644 --- a/tests/DataChangeCMSTest.php +++ b/tests/DataChangeCMSTest.php @@ -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 // diff --git a/tests/TestTextJSONFieldObject.php b/tests/TestTextJSONFieldObject.php index 9176dfa..6f7b8b6 100644 --- a/tests/TestTextJSONFieldObject.php +++ b/tests/TestTextJSONFieldObject.php @@ -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);