Skip to content

Commit

Permalink
Merge pull request #82 from arrilot/analysis-qxwpGb
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
arrilot committed Aug 19, 2017
2 parents 8ce07ac + d01a802 commit 4291f9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/WidgetGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function removeById($id)
foreach ($widgets as $i => $widget) {
if ($widget['id'] === $id) {
unset($this->widgets[$position][$i]);

return;
}
}
Expand Down Expand Up @@ -250,12 +251,13 @@ public function count()

return $count;
}

/**
* Add a widget with a given type to the array.
*
* @param string $type
* @param array $arguments
* @param array $arguments
*
* @return int
*/
protected function addWidgetWithType($type, array $arguments = [])
Expand Down Expand Up @@ -304,8 +306,8 @@ protected function resetPosition()
* Wraps widget content in a special markup defined by $this->wrap().
*
* @param string $content
* @param int $index
* @param int $total
* @param int $index
* @param int $total
*
* @return string
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/WidgetGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function testWrap()
$this->widgetGroup->addWidget('Slider', ['slides' => 5]);
$this->widgetGroup->addAsyncWidget('Slider');

$output = $this->widgetGroup->wrap(function($content, $index, $count) {
$output = $this->widgetGroup->wrap(function ($content, $index, $count) {
return "<div class='widget widget-{$index}-{$count}'>{$content}</div>";
})->display();

Expand Down Expand Up @@ -148,7 +148,7 @@ public function testCount()
$this->widgetGroup->position(50)->addWidget('Slider');
$this->assertSame(3, $this->widgetGroup->count());
}

public function testRemoveById()
{
$id1 = $this->widgetGroup->addWidget('Slider');
Expand Down

0 comments on commit 4291f9c

Please sign in to comment.