Skip to content

Commit

Permalink
Merge pull request #93 from creative-commoners/pulls/2.0/psr-12
Browse files Browse the repository at this point in the history
Update phpcs to use PSR-12 (with exclusions) and run automated linting
  • Loading branch information
robbieaverill authored Jan 24, 2020
2 parents f8fde1f + e0068e8 commit d92c6a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- base rules are PSR-12 -->
<rule ref="PSR12" >
<!-- Current exclusions -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
Expand Down
10 changes: 5 additions & 5 deletions src/ArchiveAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getEditForm($id = null, $fields = null)
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
$form->addExtraClass(
'ArchiveAdmin discardchanges cms-edit-form cms-panel-padded center flexbox-area-grow '.
'ArchiveAdmin discardchanges cms-edit-form cms-panel-padded center flexbox-area-grow ' .
$this->BaseCSSClasses()
);
$form->setFormAction(Controller::join_links(
Expand All @@ -123,10 +123,10 @@ public static function createArchiveGridField($title, $class)
$config = GridFieldConfig_Base::create();
$config->removeComponentsByType(VersionedGridFieldState::class);
$config->removeComponentsByType(GridFieldFilterHeader::class);
$config->addComponent(new GridFieldDetailForm);
$config->addComponent(new GridFieldViewButton);
$config->addComponent(new GridFieldRestoreAction);
$config->addComponent(new GridField_ActionMenu);
$config->addComponent(new GridFieldDetailForm());
$config->addComponent(new GridFieldViewButton());
$config->addComponent(new GridFieldRestoreAction());
$config->addComponent(new GridField_ActionMenu());

$list = singleton($class)->get();
$baseTable = singleton($list->dataClass())->baseTable();
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/HistoryViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ protected function getRecordVersion($recordClass, $recordId, $recordVersion)

if (!$record->canView()) {
$this->jsonError(403, _t(
__CLASS__.'.ErrorItemViewPermissionDenied',
__CLASS__ . '.ErrorItemViewPermissionDenied',
"You don't have the necessary permissions to view {ObjectTitle}",
['ObjectTitle' => $record->i18n_singular_name()]
));
Expand Down
2 changes: 1 addition & 1 deletion tests/Controllers/HistoryControllerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class HistoryControllerFactoryTest extends SapphireTest

public function testCreateController()
{
$factory = new HistoryControllerFactory;
$factory = new HistoryControllerFactory();

$controller = $factory->create(null);
$this->assertInstanceOf(CMSPageHistoryViewerController::class, $controller);
Expand Down

0 comments on commit d92c6a6

Please sign in to comment.