Skip to content

Commit 68b94ff

Browse files
authored
Merge pull request #2258 from z-song/analysis-zY5aNG
Apply fixes from StyleCI
2 parents 0b49f10 + c1347d6 commit 68b94ff

13 files changed

+34
-24
lines changed

src/Grid.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ public function getCreateUrl()
681681

682682
return sprintf('%s/create%s',
683683
$this->resource(),
684-
$queryString ? ('?' . $queryString) : ''
684+
$queryString ? ('?'.$queryString) : ''
685685
);
686686
}
687687

@@ -1000,6 +1000,7 @@ public function setView($view, $variables = [])
10001000
* Set grid title.
10011001
*
10021002
* @param string $title
1003+
*
10031004
* @return $this
10041005
*/
10051006
public function setTitle($title)
@@ -1013,6 +1014,7 @@ public function setTitle($title)
10131014
* Set relation for grid.
10141015
*
10151016
* @param Relation $relation
1017+
*
10161018
* @return $this
10171019
*/
10181020
public function setRelation(Relation $relation)

src/Grid/Column.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ public function display(Closure $callback)
306306
* Set value mapping.
307307
*
308308
* @param array $values
309-
* @param null $default
309+
* @param null $default
310+
*
310311
* @return $this
311312
*/
312313
public function values(array $values, $default = null)

src/Grid/Displayers/Actions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function display($callback = null)
128128
$actions = $this->prepends;
129129

130130
foreach ($this->actions as $action) {
131-
$method = 'render' . ucfirst($action);
131+
$method = 'render'.ucfirst($action);
132132
array_push($actions, $this->{$method}());
133133
}
134134

@@ -139,7 +139,7 @@ public function display($callback = null)
139139

140140
/**
141141
* Render view action.
142-
*
142+
*
143143
* @return string
144144
*/
145145
protected function renderView()

src/Grid/Filter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public function setModalId($filterModalId)
137137

138138
/**
139139
* @param $name
140+
*
140141
* @return $this
141142
*/
142143
public function setName($name)
@@ -213,6 +214,7 @@ public function conditions()
213214

214215
/**
215216
* @param $inputs
217+
*
216218
* @return array
217219
*/
218220
protected function sanitizeInputs(&$inputs)

src/Grid/HasElementNames.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ trait HasElementNames
2929
* Set name to grid.
3030
*
3131
* @param string $name
32+
*
3233
* @return $this
3334
*/
3435
public function setName($name)
@@ -100,7 +101,7 @@ public function getSelectedRowsName()
100101
$elementName = $this->elementNames['selected_rows'];
101102

102103
if ($this->name) {
103-
return sprintf("%s%s", $this->name, ucfirst($elementName));
104+
return sprintf('%s%s', $this->name, ucfirst($elementName));
104105
}
105106

106107
return $elementName;
@@ -114,7 +115,7 @@ protected function elementNameWithPrefix($name)
114115
$elementName = $this->elementNames[$name];
115116

116117
if ($this->name) {
117-
return sprintf("%s-%s", $this->name, $elementName);
118+
return sprintf('%s-%s', $this->name, $elementName);
118119
}
119120

120121
return $elementName;

src/Grid/Model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public function setSortName($name)
185185

186186
/**
187187
* @param Grid $grid
188+
*
188189
* @return $this
189190
*/
190191
public function setGrid(Grid $grid)
@@ -196,6 +197,7 @@ public function setGrid(Grid $grid)
196197

197198
/**
198199
* @param Relation $relation
200+
*
199201
* @return $this
200202
*/
201203
public function setRelation(Relation $relation)

src/Grid/Tools/BatchAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
abstract class BatchAction
88
{
99
/**
10-
* @var integer
10+
* @var int
1111
*/
1212
protected $id;
1313

@@ -69,6 +69,7 @@ public function getToken()
6969

7070
/**
7171
* @param bool $dotPrefix
72+
*
7273
* @return string
7374
*/
7475
public function getElementClass($dotPrefix = true)

src/Grid/Tools/BatchActions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function disableDelete()
5454
*
5555
* @param $title
5656
* @param BatchAction|null $action
57+
*
5758
* @return $this
5859
*/
5960
public function add($title, BatchAction $action = null)

src/Show.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Show implements Renderable
6969
*/
7070
public function __construct($model, $builder = null)
7171
{
72-
$this->model = $model;
72+
$this->model = $model;
7373
$this->builder = $builder;
7474

7575
$this->initPanel();
@@ -81,12 +81,12 @@ public function __construct($model, $builder = null)
8181
*/
8282
protected function initContents()
8383
{
84-
$this->fields = new Collection();
84+
$this->fields = new Collection();
8585
$this->relations = new Collection();
8686
}
8787

8888
/**
89-
* Initialize panel
89+
* Initialize panel.
9090
*/
9191
protected function initPanel()
9292
{
@@ -161,7 +161,7 @@ public function relation($name, $label, $builder = null)
161161
{
162162
if (is_null($builder)) {
163163
$builder = $label;
164-
$label = '';
164+
$label = '';
165165
}
166166

167167
return $this->addRelation($name, $builder, $label);

src/Show/Field.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function setRelation($relation)
274274
public function __call($method, $arguments = [])
275275
{
276276
if ($this->relation) {
277-
$this->name = $method;
277+
$this->name = $method;
278278
$this->label = $this->formatLabel(array_get($arguments, 0));
279279
}
280280

@@ -298,7 +298,7 @@ public function render()
298298
}
299299

300300
$content = $this->value;
301-
$label = $this->getLabel();
301+
$label = $this->getLabel();
302302

303303
return view($this->view, compact('content', 'label'));
304304
}

src/Show/Panel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function style($style = 'info')
106106
*/
107107
public function title($title)
108108
{
109-
$this->data['title'] = $title;
109+
$this->data['title'] = $title;
110110

111111
return $this;
112112
}

src/Show/Relation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class Relation extends Field
5353
*/
5454
public function __construct($name, $builder, $title = '')
5555
{
56-
$this->name = $name;
56+
$this->name = $name;
5757
$this->builder = $builder;
58-
$this->title = $this->formatLabel($title);
58+
$this->title = $this->formatLabel($title);
5959
}
6060

6161
/**
@@ -79,7 +79,7 @@ public function setModel(Model $model)
7979
*/
8080
protected function getNullRenderable()
8181
{
82-
return new class implements Renderable {
82+
return new class() implements Renderable {
8383
public function render()
8484
{
8585
}

src/Show/Tools.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function disableEdit()
135135
*/
136136
protected function getListPath()
137137
{
138-
return '/' . ltrim($this->getResource(), '/');
138+
return '/'.ltrim($this->getResource(), '/');
139139
}
140140

141141
/**
@@ -147,7 +147,7 @@ protected function getEditPath()
147147
{
148148
$key = $this->panel->getParent()->getModel()->getKey();
149149

150-
return $this->getListPath() . '/' . $key . '/edit';
150+
return $this->getListPath().'/'.$key.'/edit';
151151
}
152152

153153
/**
@@ -159,7 +159,7 @@ protected function getDeletePath()
159159
{
160160
$key = $this->panel->getParent()->getModel()->getKey();
161161

162-
return $this->getListPath() . '/' . $key;
162+
return $this->getListPath().'/'.$key;
163163
}
164164

165165
/**
@@ -202,8 +202,8 @@ protected function renderEdit()
202202
protected function renderDelete()
203203
{
204204
$deleteConfirm = trans('admin.delete_confirm');
205-
$confirm = trans('admin.confirm');
206-
$cancel = trans('admin.cancel');
205+
$confirm = trans('admin.confirm');
206+
$cancel = trans('admin.cancel');
207207

208208
$class = uniqid();
209209

@@ -266,10 +266,10 @@ public function render()
266266
$output = implode('', $this->prepends);
267267

268268
foreach ($this->tools as $tool) {
269-
$renderMethod = 'render' . ucfirst($tool);
269+
$renderMethod = 'render'.ucfirst($tool);
270270
$output .= $this->$renderMethod();
271271
}
272272

273-
return $output . implode('', $this->appends);
273+
return $output.implode('', $this->appends);
274274
}
275275
}

0 commit comments

Comments
 (0)