@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | return ChangeSet::get() |
| 119 | 119 | ->filter('State', ChangeSet::STATE_OPEN) |
| 120 | - ->filterByCallback(function ($item) { |
|
| 120 | + ->filterByCallback(function($item) { |
|
| 121 | 121 | /** @var ChangeSet $item */ |
| 122 | 122 | return $item->canView(); |
| 123 | 123 | }); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | protected function getObject($id, $class) |
| 157 | 157 | { |
| 158 | - $id = (int)$id; |
|
| 158 | + $id = (int) $id; |
|
| 159 | 159 | $class = ClassInfo::class_name($class); |
| 160 | 160 | |
| 161 | 161 | if (!$class |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | if (is_array($data) && !empty($data['Campaign'])) { |
| 454 | 454 | $campaignID = $data['Campaign']; |
| 455 | 455 | } elseif (is_numeric($data)) { |
| 456 | - $campaignID = (int)$data; |
|
| 456 | + $campaignID = (int) $data; |
|
| 457 | 457 | } |
| 458 | 458 | if (empty($campaignID)) { |
| 459 | 459 | throw $this->validationResult(_t(__CLASS__ . '.NONE_SELECTED', 'No campaign selected')); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function __construct() |
| 16 | 16 | { |
| 17 | - parent::__construct('addtocampaign', _t(__CLASS__.'.ADDTOCAMPAIGN', 'Add to Campaign')); |
|
| 17 | + parent::__construct('addtocampaign', _t(__CLASS__ . '.ADDTOCAMPAIGN', 'Add to Campaign')); |
|
| 18 | 18 | $this->setUseButtonTag(false); |
| 19 | 19 | $this->addExtraClass('add-to-campaign-action'); |
| 20 | 20 | $this->addExtraClass('btn'); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | "url" => $oneSetAction, |
| 60 | 60 | "method" => "DELETE" |
| 61 | 61 | ]; |
| 62 | - $data['data']['editFormSchemaEndpoint'] = $schemaEndpoint; |
|
| 62 | + $data['data']['editFormSchemaEndpoint'] = $schemaEndpoint; |
|
| 63 | 63 | |
| 64 | 64 | // Set summary columns |
| 65 | 65 | $columns = []; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $results = $this->callProtectedMethod($admin, 'getListItems'); |
| 90 | 90 | $this->assertDOSEquals( |
| 91 | 91 | [ |
| 92 | - [ 'Name' => 'changeset 1' ], |
|
| 92 | + ['Name' => 'changeset 1'], |
|
| 93 | 93 | ], |
| 94 | 94 | $results |
| 95 | 95 | ); |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | $results = $this->callProtectedMethod($admin, 'getListItems'); |
| 100 | 100 | $this->assertDOSEquals( |
| 101 | 101 | [ |
| 102 | - [ 'Name' => 'changeset 1' ], |
|
| 103 | - [ 'Name' => 'changeset 2' ], |
|
| 102 | + ['Name' => 'changeset 1'], |
|
| 103 | + ['Name' => 'changeset 2'], |
|
| 104 | 104 | ], |
| 105 | 105 | $results |
| 106 | 106 | ); |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | $results = $this->callProtectedMethod($admin, 'getListItems'); |
| 111 | 111 | $this->assertDOSEquals( |
| 112 | 112 | [ |
| 113 | - [ 'Name' => 'changeset 1' ], |
|
| 114 | - [ 'Name' => 'changeset 2' ], |
|
| 115 | - [ 'Name' => 'changeset 3' ], |
|
| 116 | - [ 'Name' => 'changeset 4' ], |
|
| 113 | + ['Name' => 'changeset 1'], |
|
| 114 | + ['Name' => 'changeset 2'], |
|
| 115 | + ['Name' => 'changeset 3'], |
|
| 116 | + ['Name' => 'changeset 4'], |
|
| 117 | 117 | ], |
| 118 | 118 | $results |
| 119 | 119 | ); |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | $results = $this->callProtectedMethod($admin, 'getListItems'); |
| 124 | 124 | $this->assertDOSEquals( |
| 125 | 125 | [ |
| 126 | - [ 'Name' => 'changeset 1' ], |
|
| 127 | - [ 'Name' => 'changeset 3' ], |
|
| 126 | + ['Name' => 'changeset 1'], |
|
| 127 | + ['Name' => 'changeset 3'], |
|
| 128 | 128 | ], |
| 129 | 129 | $results |
| 130 | 130 | ); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $form->addExtraClass('form--padded'); |
| 169 | 169 | |
| 170 | 170 | // Set callback response |
| 171 | - $form->setValidationResponseCallback(function () use ($form) { |
|
| 171 | + $form->setValidationResponseCallback(function() use ($form) { |
|
| 172 | 172 | $schemaId = $this->Link('schema/EditForm'); |
| 173 | 173 | return $this->getSchemaResponse($form, $schemaId); |
| 174 | 174 | }); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | 'baseClass' => DataObject::getSchema()->baseDataClass($class), |
| 216 | 216 | 'singular' => $item->i18n_singular_name(), |
| 217 | 217 | 'plural' => $item->i18n_plural_name(), |
| 218 | - 'noItemsText' => _t(__CLASS__.'.NOITEMSTEXT', 'Add items from the {section} section', [ |
|
| 218 | + 'noItemsText' => _t(__CLASS__ . '.NOITEMSTEXT', 'Add items from the {section} section', [ |
|
| 219 | 219 | 'section' => $item->i18n_plural_name(), |
| 220 | 220 | ]), |
| 221 | 221 | 'items' => [] |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | 'Created' => $changeSet->Created, |
| 284 | 284 | 'LastEdited' => $changeSet->LastEdited, |
| 285 | 285 | 'State' => $changeSet->State, |
| 286 | - 'StateLabel' => [ 'html' => $stateLabel ], |
|
| 286 | + 'StateLabel' => ['html' => $stateLabel], |
|
| 287 | 287 | 'IsInferred' => $changeSet->IsInferred, |
| 288 | 288 | 'canEdit' => $changeSet->canEdit(), |
| 289 | 289 | 'canPublish' => false, |
@@ -338,8 +338,8 @@ discard block |
||
| 338 | 338 | return []; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - $thumbnailWidth = (int)$this->config()->get('thumbnail_width'); |
|
| 342 | - $thumbnailHeight = (int)$this->config()->get('thumbnail_height'); |
|
| 341 | + $thumbnailWidth = (int) $this->config()->get('thumbnail_width'); |
|
| 342 | + $thumbnailHeight = (int) $this->config()->get('thumbnail_height'); |
|
| 343 | 343 | $hal = [ |
| 344 | 344 | '_links' => [ |
| 345 | 345 | 'self' => [ |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $changesets = $changesets->filter('IsInferred', 0); |
| 420 | 420 | } |
| 421 | 421 | return $changesets |
| 422 | - ->filterByCallback(function ($item) { |
|
| 422 | + ->filterByCallback(function($item) { |
|
| 423 | 423 | /** @var ChangeSet $item */ |
| 424 | 424 | return ($item->canView()); |
| 425 | 425 | }); |
@@ -626,19 +626,19 @@ discard block |
||
| 626 | 626 | 'campaignEditForm', |
| 627 | 627 | $fields, |
| 628 | 628 | FieldList::create( |
| 629 | - FormAction::create('save', _t(__CLASS__.'SAVE', 'Save')) |
|
| 629 | + FormAction::create('save', _t(__CLASS__ . 'SAVE', 'Save')) |
|
| 630 | 630 | ->setIcon('save') |
| 631 | 631 | ->setSchemaState([ |
| 632 | 632 | 'data' => [ |
| 633 | - 'pristineTitle' => _t(__CLASS__.'SAVED', 'Saved'), |
|
| 633 | + 'pristineTitle' => _t(__CLASS__ . 'SAVED', 'Saved'), |
|
| 634 | 634 | 'pristineIcon' => 'tick', |
| 635 | - 'dirtyTitle' => _t(__CLASS__.'SAVE', 'Save'), |
|
| 635 | + 'dirtyTitle' => _t(__CLASS__ . 'SAVE', 'Save'), |
|
| 636 | 636 | 'dirtyIcon' => 'save', |
| 637 | 637 | 'pristineClass' => 'btn-outline-primary', |
| 638 | 638 | 'dirtyClass' => '', |
| 639 | 639 | ], |
| 640 | 640 | ]), |
| 641 | - FormAction::create('cancel', _t(__CLASS__.'.CANCEL', 'Cancel')) |
|
| 641 | + FormAction::create('cancel', _t(__CLASS__ . '.CANCEL', 'Cancel')) |
|
| 642 | 642 | ->setUseButtonTag(true) |
| 643 | 643 | ), |
| 644 | 644 | new RequiredFields('Name') |
@@ -649,12 +649,12 @@ discard block |
||
| 649 | 649 | |
| 650 | 650 | // Set form action handler with ID included |
| 651 | 651 | $form->setRequestHandler( |
| 652 | - LeftAndMainFormRequestHandler::create($form, [ $id ]) |
|
| 652 | + LeftAndMainFormRequestHandler::create($form, [$id]) |
|
| 653 | 653 | ); |
| 654 | 654 | |
| 655 | 655 | // Configure form to respond to validation errors with form schema |
| 656 | 656 | // if requested via react. |
| 657 | - $form->setValidationResponseCallback(function (ValidationResult $errors) use ($form, $id, $record) { |
|
| 657 | + $form->setValidationResponseCallback(function(ValidationResult $errors) use ($form, $id, $record) { |
|
| 658 | 658 | $schemaId = Controller::join_links( |
| 659 | 659 | $this->Link('schema'), |
| 660 | 660 | 'campaignEditForm', |
@@ -701,9 +701,9 @@ discard block |
||
| 701 | 701 | 'campaignCreateForm', |
| 702 | 702 | $fields, |
| 703 | 703 | FieldList::create( |
| 704 | - FormAction::create('save', _t(__CLASS__.'.CREATE', 'Create')) |
|
| 704 | + FormAction::create('save', _t(__CLASS__ . '.CREATE', 'Create')) |
|
| 705 | 705 | ->setIcon('plus'), |
| 706 | - FormAction::create('cancel', _t(__CLASS__.'.CANCEL', 'Cancel')) |
|
| 706 | + FormAction::create('cancel', _t(__CLASS__ . '.CANCEL', 'Cancel')) |
|
| 707 | 707 | ->setUseButtonTag(true) |
| 708 | 708 | ), |
| 709 | 709 | new RequiredFields('Name') |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | |
| 717 | 717 | // Configure form to respond to validation errors with form schema |
| 718 | 718 | // if requested via react. |
| 719 | - $form->setValidationResponseCallback(function (ValidationResult $errors) use ($form, $record) { |
|
| 719 | + $form->setValidationResponseCallback(function(ValidationResult $errors) use ($form, $record) { |
|
| 720 | 720 | $schemaId = $this->Link('schema/campaignCreateForm'); |
| 721 | 721 | return $this->getSchemaResponse($schemaId, $form, $errors); |
| 722 | 722 | }); |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | return Security::permissionFailure($this); |
| 746 | 746 | } |
| 747 | 747 | if (!$record || !$record->ID) { |
| 748 | - $this->httpError(404, "Bad record ID #" . (int)$id); |
|
| 748 | + $this->httpError(404, "Bad record ID #" . (int) $id); |
|
| 749 | 749 | } |
| 750 | 750 | } else { |
| 751 | 751 | if (!ChangeSet::singleton()->canCreate()) { |
@@ -764,13 +764,13 @@ discard block |
||
| 764 | 764 | $form->saveInto($record, true); |
| 765 | 765 | $record->write(); |
| 766 | 766 | $this->extend('onAfterSave', $record); |
| 767 | - $message = _t(__CLASS__.'.SAVEDUP', 'Saved.'); |
|
| 767 | + $message = _t(__CLASS__ . '.SAVEDUP', 'Saved.'); |
|
| 768 | 768 | $form->setMessage($message, ValidationResult::TYPE_GOOD); |
| 769 | 769 | } else { |
| 770 | - $nameDuplicateMsg = _t(__CLASS__ . '.ERROR_DUPLICATE_NAME', 'Name "{Name}" already exists', '', [ 'Name' => $data['Name']]); |
|
| 770 | + $nameDuplicateMsg = _t(__CLASS__ . '.ERROR_DUPLICATE_NAME', 'Name "{Name}" already exists', '', ['Name' => $data['Name']]); |
|
| 771 | 771 | $errors = new ValidationResult(); |
| 772 | 772 | $errors->addFieldMessage('Name', $nameDuplicateMsg); |
| 773 | - $message = _t(__CLASS__.'.SAVEDERROR', 'Error.'); |
|
| 773 | + $message = _t(__CLASS__ . '.SAVEDERROR', 'Error.'); |
|
| 774 | 774 | // Need to set the form message or the field message won't show up at all |
| 775 | 775 | $form->setMessage($message, ValidationResult::TYPE_ERROR); |
| 776 | 776 | } |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | ), |
| 829 | 829 | 'category' => _t('SilverStripe\\Security\\Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), |
| 830 | 830 | 'help' => _t( |
| 831 | - __CLASS__.'.ACCESS_HELP', |
|
| 831 | + __CLASS__ . '.ACCESS_HELP', |
|
| 832 | 832 | 'Allow viewing of the campaign publishing section.' |
| 833 | 833 | ) |
| 834 | 834 | ) |