Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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