Skip to content

Commit

Permalink
Merge pull request #7 from hamburgscleanest/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
timopruesse committed Apr 13, 2017
2 parents 4d0ec4a + e48b335 commit dd86f43
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Helpers/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UrlHelper {
* @return array
* @throws \RuntimeException
*/
public function parameterizeQuery(? string $queryString = null): array
public function parameterizeQuery(? string $queryString = null) : array
{
if (empty($queryString))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function setName(string $name)
/**
* @return null|Relation
*/
public function getRelation(): ?Relation
public function getRelation(): ? Relation
{
return $this->_relation;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Models/DataComponents/DataScout.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function _shapeData(): Builder
return $this->_queryBuilder;
}

$this->_queryBuilder->where(function ($query)
$this->_queryBuilder->where(function($query)
{
foreach ($this->_searchQueries as $value)
{
Expand Down Expand Up @@ -118,9 +118,9 @@ public function makeSearchable(string $field): DataScout
public function render(): string
{
return '<form method="get" action="' . $this->_buildSearchUrl() .
'"><div class="row"><div class="col-md-10"><input name="search" class="form-control data-scout-input" placeholder="' .
$this->_placeholder . '"/></div><div class="col-md-2"><button type="submit" class="btn btn-primary">' .
$this->_buttonText . '</button></div></div></form>';
'"><div class="row"><div class="col-md-10"><input name="search" class="form-control data-scout-input" placeholder="' .
$this->_placeholder . '"/></div><div class="col-md-2"><button type="submit" class="btn btn-primary">' .
$this->_buttonText . '</button></div></div></form>';
}

/**
Expand Down
16 changes: 8 additions & 8 deletions src/Models/DataComponents/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ public function render(): string
}

return '<ul class="pagination">' .
$this->_renderListItem($this->_currentPage - 1, $this->_getFirstPageUrl(), $this->_firstPageSymbol) .
$this->_renderListItem($this->_currentPage - 1, $this->_getPreviousPageUrl(), $this->_previousPageSymbol) .
$this->_renderPageList() .
$this->_renderListItem($this->_currentPage + 1, $this->_getNextPageUrl(), $this->_nextPageSymbol) .
$this->_renderListItem($this->_currentPage + 1, $this->_getLastPageUrl(), $this->_lastPageSymbol) .
'</ul>';
$this->_renderListItem($this->_currentPage - 1, $this->_getFirstPageUrl(), $this->_firstPageSymbol) .
$this->_renderListItem($this->_currentPage - 1, $this->_getPreviousPageUrl(), $this->_previousPageSymbol) .
$this->_renderPageList() .
$this->_renderListItem($this->_currentPage + 1, $this->_getNextPageUrl(), $this->_nextPageSymbol) .
$this->_renderListItem($this->_currentPage + 1, $this->_getLastPageUrl(), $this->_lastPageSymbol) .
'</ul>';
}

/**
Expand All @@ -113,7 +113,7 @@ public function render(): string
*
* @return string
*/
private function _renderListItem(int $pagenumber, ? string $url, ? string $symbol = null): string
private function _renderListItem(int $pagenumber, ? string $url, ? string $symbol = null) : string
{
if ($url === null)
{
Expand Down Expand Up @@ -179,7 +179,7 @@ private function _renderPageList(): string
$end = $this->_getEndPage();

$pageList = '';
for ($i = $this->_getStartPage(); $i <= $end; $i ++)
for ($i = $this->_getStartPage(); $i <= $end; $i++)
{
$pageList .= $this->_renderListItem($i, $this->_buildPageUrl($i));
}
Expand Down
10 changes: 4 additions & 6 deletions src/Models/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

namespace hamburgscleanest\DataTables\Models;

use Closure;
use hamburgscleanest\DataTables\Interfaces\ColumnFormatter;
use hamburgscleanest\DataTables\Interfaces\HeaderFormatter;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
use RuntimeException;

/**
Expand Down Expand Up @@ -157,7 +155,7 @@ public function formatColumn(string $columnName, ColumnFormatter $columnFormatte
/** @var Column $column */
$column = \array_first(
$this->_columns,
function ($index, $column) use ($columnName)
function($index, $column) use ($columnName)
{
/** @var Column $column */
return $column->getName() === $columnName;
Expand Down Expand Up @@ -321,7 +319,7 @@ private function _renderHeaders(): string
private function _fetchHeaders(): array
{
return array_map(
function ($column)
function($column)
{
/** @var Column $column */
return new Header($column);
Expand Down Expand Up @@ -395,7 +393,7 @@ private function _getMutatedAttributes(Model $model, array $columns = []): array
*/
private function _getColumnNames(): array
{
return \array_map(function ($column)
return \array_map(function($column)
{
/** @var Column $column */
return $column->getName();
Expand All @@ -413,7 +411,7 @@ private function _getColumnsWithoutRelations(): array
{
return \array_filter(
$this->_columns,
function ($column)
function($column)
{
/** @var Column $column */
return $column->getRelation() === null;
Expand Down

0 comments on commit dd86f43

Please sign in to comment.