Skip to content
This repository was archived by the owner on Jan 18, 2018. It is now read-only.

Commit 515d0ec

Browse files
CS fixes
1 parent d26a508 commit 515d0ec

3 files changed

Lines changed: 88 additions & 87 deletions

File tree

src/Navigation.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ class Navigation
3535
*
3636
* @var array
3737
*/
38-
protected $main = array();
38+
protected $main = [];
3939

4040
/**
4141
* The items in the bar nav bar.
4242
*
4343
* @var array
4444
*/
45-
protected $bar = array();
45+
protected $bar = [];
4646

4747
/**
4848
* The events instance.
@@ -113,13 +113,13 @@ public function addToMain(array $item, $name = 'default', $first = false)
113113
// check if the name exists in the main array
114114
if (!array_key_exists($name, $this->main)) {
115115
// add it if it doesn't exists
116-
$this->main[$name] = array();
116+
$this->main[$name] = [];
117117
}
118118

119119
// check if we are forcing the item to the start
120120
if ($first) {
121121
// add the item to the start of the array
122-
$this->main[$name] = array_merge(array($item), $this->main[$name]);
122+
$this->main[$name] = array_merge([$item], $this->main[$name]);
123123
} else {
124124
// add the item to the end of the array
125125
$this->main[$name][] = $item;
@@ -142,13 +142,13 @@ public function addToBar(array $item, $name = 'default', $first = false)
142142
// check if the name exists in the bar array
143143
if (!array_key_exists($name, $this->bar)) {
144144
// add it if it doesn't exists
145-
$this->bar[$name] = array();
145+
$this->bar[$name] = [];
146146
}
147147

148148
// check if we are forcing the item to the start
149149
if ($first) {
150150
// add the item to the start of the array
151-
$this->bar[$name] = array_merge(array($item), $this->bar[$name]);
151+
$this->bar[$name] = array_merge([$item], $this->bar[$name]);
152152
} else {
153153
// add the item to the end of the array
154154
$this->bar[$name][] = $item;
@@ -169,7 +169,7 @@ public function addToBar(array $item, $name = 'default', $first = false)
169169
public function render(
170170
$mainName = 'default',
171171
$barName = false,
172-
array $data = array('title' => 'Navigation', 'side' => 'dropdown', 'inverse' => true)
172+
array $data = ['title' => 'Navigation', 'side' => 'dropdown', 'inverse' => true]
173173
) {
174174
// get the nav bar arrays
175175
$main = $this->getMain($mainName);
@@ -183,7 +183,7 @@ public function render(
183183
}
184184

185185
// return the html nav bar
186-
return $this->view->make($this->name, array_merge($data, array('main' => $main, 'bar' => $bar)))->render();
186+
return $this->view->make($this->name, array_merge($data, ['main' => $main, 'bar' => $bar]))->render();
187187
}
188188

189189
/**
@@ -196,7 +196,7 @@ public function render(
196196
protected function getMain($name = 'default')
197197
{
198198
// fire event that can be hooked to add items to the nav bar
199-
$this->events->fire('navigation.main', array(array('name' => $name)));
199+
$this->events->fire('navigation.main', [['name' => $name]]);
200200

201201
// check if the name exists in the main array
202202
if ($name !== 'default' && !array_key_exists($name, $this->main)) {
@@ -206,7 +206,7 @@ protected function getMain($name = 'default')
206206

207207
if (!array_key_exists($name, $this->main)) {
208208
// add it if it doesn't exists
209-
$this->main[$name] = array();
209+
$this->main[$name] = [];
210210
}
211211

212212
// apply active keys
@@ -226,7 +226,7 @@ protected function getMain($name = 'default')
226226
protected function getBar($name = 'default')
227227
{
228228
// fire event that can be hooked to add items to the nav bar
229-
$this->events->fire('navigation.bar', array(array('name' => $name)));
229+
$this->events->fire('navigation.bar', [['name' => $name]]);
230230

231231
// check if the name exists in the bar array
232232
if ($name !== 'default' && !array_key_exists($name, $this->bar)) {
@@ -236,7 +236,7 @@ protected function getBar($name = 'default')
236236

237237
if (!array_key_exists($name, $this->bar)) {
238238
// add it if it doesn't exists
239-
$this->bar[$name] = array();
239+
$this->bar[$name] = [];
240240
}
241241

242242
// don't apply active keys

src/NavigationServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ protected function registerNavigation()
7070

7171
$navigation = new Navigation($events, $request, $url, $view, $name);
7272
$app->refresh('request', $navigation, 'setRequest');
73+
7374
return $navigation;
7475
});
7576

@@ -83,8 +84,8 @@ protected function registerNavigation()
8384
*/
8485
public function provides()
8586
{
86-
return array(
87+
return [
8788
'navigation',
88-
);
89+
];
8990
}
9091
}

0 commit comments

Comments
 (0)