Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR Change array declarations for consistency. Fix line length. Add description to canCreate. #17

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']);
}
}