Skip to content

Commit

Permalink
Merge pull request #163 from yajra/analysis-YORMpv
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
yajra authored Oct 28, 2022
2 parents 42881ec + 975bed2 commit 4670aeb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Services/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function render(string $view = null, array $data = [], array $mergeData =
*/
public function request(): Request
{
if (!$this->request) {
if (! $this->request) {
$this->request = app(Request::class);
}

Expand Down Expand Up @@ -352,7 +352,7 @@ public function builder(): Builder
return $this->htmlBuilder = $this->htmlBuilder();
}

if (!$this->htmlBuilder) {
if (! $this->htmlBuilder) {
$this->htmlBuilder = app(Builder::class);
}

Expand Down Expand Up @@ -459,7 +459,7 @@ public function excel()
{
set_time_limit(3600);

$path = $this->getFilename() . '.' . strtolower($this->excelWriter);
$path = $this->getFilename().'.'.strtolower($this->excelWriter);

$excelFile = $this->buildExcelFile();

Expand All @@ -486,11 +486,11 @@ protected function buildExcelFile()
return $this->buildFastExcelFile();
}

if (!class_exists(ExcelServiceProvider::class)) {
if (! class_exists(ExcelServiceProvider::class)) {
throw new Exception('Please install maatwebsite/excel to be able to use this function.');
}

if (!new $this->exportClass instanceof DataTablesExportHandler) {
if (! new $this->exportClass instanceof DataTablesExportHandler) {
$collection = $this->getAjaxResponseData();

return new $this->exportClass($this->convertToLazyCollection($collection));
Expand Down Expand Up @@ -531,7 +531,7 @@ public function setFilename(string $filename): static
*/
protected function filename(): string
{
return class_basename($this) . '_' . date('YmdHis');
return class_basename($this).'_'.date('YmdHis');
}

/**
Expand Down Expand Up @@ -591,7 +591,7 @@ private function toColumnsCollection(array $columns): Collection
public function csv()
{
set_time_limit(3600);
$path = $this->getFilename() . '.' . strtolower($this->csvWriter);
$path = $this->getFilename().'.'.strtolower($this->csvWriter);

$excelFile = $this->buildExcelFile();

Expand Down Expand Up @@ -623,7 +623,7 @@ public function pdf()
}

// @phpstan-ignore-next-line
return $this->buildExcelFile()->download($this->getFilename() . '.pdf', $this->pdfWriter);
return $this->buildExcelFile()->download($this->getFilename().'.pdf', $this->pdfWriter);
}

/**
Expand All @@ -635,7 +635,7 @@ public function pdf()
*/
public function snappyPdf(): Response
{
if (!class_exists(PdfWrapper::class)) {
if (! class_exists(PdfWrapper::class)) {
throw new Exception('You need to install barryvdh/laravel-snappy to be able to use this feature.');
}

Expand All @@ -648,7 +648,7 @@ public function snappyPdf(): Response

$snappy->setOptions($options)->setOrientation($orientation);

return $snappy->loadHTML($this->printPreview())->download($this->getFilename() . '.pdf');
return $snappy->loadHTML($this->printPreview())->download($this->getFilename().'.pdf');
}

/**
Expand Down Expand Up @@ -738,7 +738,7 @@ protected function hasScopes(array $scopes, bool $validateAll = false): bool
return in_array(get_class($scope), $scopes);
});

return $validateAll ? count($filteredScopes) === count($scopes) : !empty($filteredScopes);
return $validateAll ? count($filteredScopes) === count($scopes) : ! empty($filteredScopes);
}

/**
Expand Down

0 comments on commit 4670aeb

Please sign in to comment.