Skip to content

Commit f18ceda

Browse files
committed
#109 - Fix styleci errors
1 parent fa92eda commit f18ceda

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/PanelTraits/ViewsAndRestoresRevisions.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
trait ViewsAndRestoresRevisions
88
{
99
/**
10-
* Build a list of Revisions, grouped by revision date
10+
* Build a list of Revisions, grouped by revision date.
1111
*
1212
* @return [Array] of revision groups, keyed by revision date
1313
*/
1414
public function listRevisions($id)
1515
{
1616
$revisions = [];
1717
// Group revisions by change date
18-
foreach($this->getEntry($id)->revisionHistory as $history) {
18+
foreach ($this->getEntry($id)->revisionHistory as $history) {
1919

2020
// Get just the date from the revision created timestamp
21-
$revisionDate = date('Y-m-d', strtotime((string)$history->created_at));
21+
$revisionDate = date('Y-m-d', strtotime((string) $history->created_at));
2222

2323
// Be sure to instantiate the initial grouping array
24-
if(!array_key_exists($revisionDate, $revisions)) {
24+
if (! array_key_exists($revisionDate, $revisions)) {
2525
$revisions[$revisionDate] = [];
2626
}
2727

@@ -36,12 +36,13 @@ public function listRevisions($id)
3636
}
3737

3838
/**
39-
* Restore a single revision
39+
* Restore a single revision.
4040
*
4141
* @param [int] $id The ID of the source CRUD Model instance to update
4242
* @param [int] $revisionId The ID of the revision to use for the update
4343
*/
44-
public function restoreRevision($id, $revisionId) {
44+
public function restoreRevision($id, $revisionId)
45+
{
4546
$entry = $this->getEntry($id);
4647
$revision = Revision::findOrFail($revisionId);
4748

src/app/Http/Controllers/CrudController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function restoreRevision($id)
220220
// is somewhat superfluous.. however if we are POSTing, it makes sense to actually have data to post.
221221
// Perhaps the route shoud be better named to reflect this (e.g. just /model/{id}/revisions) (??)
222222
$revisionId = \Request::input('revision_id', false);
223-
if(!$revisionId) {
223+
if (! $revisionId) {
224224
abort(500, 'Can\'t restore revision without revision_id');
225225
} else {
226226
$this->crud->restoreRevision($id, $revisionId); // do the update

0 commit comments

Comments
 (0)