Skip to content

Commit

Permalink
Merge pull request #17 from silverleague/bugfix/consistent-array-decl…
Browse files Browse the repository at this point in the history
…arations

MINOR Change array declarations for consistency. Fix line length. Add description to canCreate.
  • Loading branch information
Firesphere authored Jan 24, 2017
2 parents 70fc730 + 1997ca5 commit 340296c
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/Model/LogEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,24 @@ class LogEntry extends DataObject implements PermissionProvider
*/
public function providePermissions()
{
return array(
'DELETE_ENTRY' => array(
'name' => _t('LogEntry.PERMISSION_DELETE_DESCRIPTION', 'Delete log entries'),
return [
'DELETE_ENTRY' => [
'name' => _t('LogEntry.PERMISSION_DELETE_DESCRIPTION', 'Delete log entries'),
'category' => _t('Permissions.LOGENTRY_CATEGORY', 'Log entry permissions'),
'help' => _t('LogEntry.PERMISSION_DELETE_HELP', 'Permission required to delete existing log entries.')
),
'VIEW_ENTRY' => array(
'name' => _t('LogEntry.PERMISSION_VIEW_DESCRIPTION', 'View log entries'),
'help' => _t('LogEntry.PERMISSION_DELETE_HELP', 'Permission required to delete existing log entries.')
],
'VIEW_ENTRY' => [
'name' => _t('LogEntry.PERMISSION_VIEW_DESCRIPTION', 'View log entries'),
'category' => _t('Permissions.LOGENTRY_CATEGORY', 'Log entry permissions'),
'help' => _t('LogEntry.PERMISSION_VIEW_HELP', 'Permission required to view existing log entries.')
),
);
'help' => _t('LogEntry.PERMISSION_VIEW_HELP', 'Permission required to view existing log entries.')
]
];
}

/**
* {@inheritdoc}
* Log entries are created programmatically, they should never be created manually
*
* {@inheritDoc}
*/
public function canCreate($member = null, $context = [])
{
Expand All @@ -77,14 +79,14 @@ public function canEdit($member = null)
*/
public function canDelete($member = null)
{
return Permission::checkMember($member, array('DELETE_ENTRY', 'CMS_ACCESS_LogViewerAdmin'));
return Permission::checkMember($member, ['DELETE_ENTRY', 'CMS_ACCESS_LogViewerAdmin']);
}

/**
* {@inheritdoc}
*/
public function canView($member = null)
{
return Permission::checkMember($member, array('VIEW_ENTRY', 'CMS_ACCESS_LogViewerAdmin'));
return Permission::checkMember($member, ['VIEW_ENTRY', 'CMS_ACCESS_LogViewerAdmin']);
}
}

0 comments on commit 340296c

Please sign in to comment.