Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
patrickbrouwers authored and StyleCIBot committed Sep 22, 2021
1 parent bcf473d commit 2219283
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 86 deletions.
13 changes: 5 additions & 8 deletions src/Actions/DownloadExcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ public function name()
}

/**
* @param ActionRequest $request
* @param Action $exportable
*
* @param ActionRequest $request
* @param Action $exportable
* @return array
*/
public function handle(ActionRequest $request, Action $exportable): array
Expand Down Expand Up @@ -54,9 +53,8 @@ public function handle(ActionRequest $request, Action $exportable): array
}

/**
* @param ActionRequest $request
* @param Action $exportable
*
* @param ActionRequest $request
* @param Action $exportable
* @return array
*/
public function handleRemoteDisk(ActionRequest $request, Action $exportable): array
Expand All @@ -79,8 +77,7 @@ public function handleRemoteDisk(ActionRequest $request, Action $exportable): ar
}

/**
* @param string $filePath
*
* @param string $filePath
* @return string
*/
protected function getDownloadUrl(string $filePath): string
Expand Down
37 changes: 13 additions & 24 deletions src/Actions/ExportToExcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ class ExportToExcel extends Action implements FromQuery, WithCustomChunkSize, Wi
/**
* Execute the action for the given request.
*
* @param \Laravel\Nova\Http\Requests\ActionRequest $request
*
* @param \Laravel\Nova\Http\Requests\ActionRequest $request
* @return mixed
*/
public function handleRequest(ActionRequest $request)
Expand All @@ -94,9 +93,8 @@ public function handleRequest(ActionRequest $request)
}

/**
* @param ActionRequest $request
* @param Action $exportable
*
* @param ActionRequest $request
* @param Action $exportable
* @return array
*/
public function handle(ActionRequest $request, Action $exportable): array
Expand All @@ -120,8 +118,7 @@ public function handle(ActionRequest $request, Action $exportable): array
}

/**
* @param callable $callback
*
* @param callable $callback
* @return $this
*/
public function onSuccess(callable $callback)
Expand All @@ -132,8 +129,7 @@ public function onSuccess(callable $callback)
}

/**
* @param callable $callback
*
* @param callable $callback
* @return $this
*/
public function onFailure(callable $callback)
Expand All @@ -144,8 +140,7 @@ public function onFailure(callable $callback)
}

/**
* @param string $name
*
* @param string $name
* @return $this
*/
public function withName(string $name)
Expand All @@ -172,8 +167,7 @@ public function fields()
}

/**
* @param Model|mixed $row
*
* @param Model|mixed $row
* @return array
*/
public function map($row): array
Expand Down Expand Up @@ -209,8 +203,7 @@ public function map($row): array
}

/**
* @param Builder $query
*
* @param Builder $query
* @return $this
*/
protected function withQuery($query)
Expand All @@ -229,9 +222,8 @@ protected function getDefaultExtension(): string
}

/**
* @param Model $model
* @param array $only
*
* @param Model $model
* @param array $only
* @return array
*/
protected function replaceFieldValuesWhenOnResource(Model $model, array $only = []): array
Expand Down Expand Up @@ -269,8 +261,7 @@ protected function replaceFieldValuesWhenOnResource(Model $model, array $only =
}

/**
* @param \Laravel\Nova\Resource $resource
*
* @param \Laravel\Nova\Resource $resource
* @return Collection
*/
protected function resourceFields(Resource $resource)
Expand All @@ -279,8 +270,7 @@ protected function resourceFields(Resource $resource)
}

/**
* @param Model $model
*
* @param Model $model
* @return \Laravel\Nova\Resource
*/
protected function resolveResource(Model $model): Resource
Expand All @@ -291,8 +281,7 @@ protected function resolveResource(Model $model): Resource
}

/**
* @param Field $field
*
* @param Field $field
* @return bool
*/
protected function isExportableField(Field $field): bool
Expand Down
3 changes: 1 addition & 2 deletions src/Concerns/Except.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ trait Except
protected $except;

/**
* @param array|mixed $columns
*
* @param array|mixed $columns
* @return $this
*/
public function except($columns)
Expand Down
5 changes: 2 additions & 3 deletions src/Concerns/Only.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ trait Only
protected $onlyIndexFields = true;

/**
* @param array|mixed $columns
*
* @param array|mixed $columns
* @return $this
*/
public function only($columns)
Expand Down Expand Up @@ -58,7 +57,7 @@ public function getOnly()
}

/**
* @param ExportActionRequest|ActionRequest $request
* @param ExportActionRequest|ActionRequest $request
*/
protected function handleOnly(ExportActionRequest $request)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Concerns/WithChunkCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
trait WithChunkCount
{
/**
* @param int $chunkCount
*
* @param int $chunkCount
* @return $this
*/
public function withChunkCount(int $chunkCount)
Expand Down
3 changes: 1 addition & 2 deletions src/Concerns/WithDisk.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ trait WithDisk
protected $disk;

/**
* @param string|null $disk
*
* @param string|null $disk
* @return $this
*/
public function withDisk(string $disk = null)
Expand Down
7 changes: 3 additions & 4 deletions src/Concerns/WithFilename.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ trait WithFilename
protected $filename;

/**
* @param string|null $filename
*
* @param string|null $filename
* @return $this
*/
public function withFilename(string $filename = null)
Expand All @@ -35,7 +34,7 @@ protected function getFilename(): ?string
}

/**
* @param ActionRequest $request
* @param ActionRequest $request
*/
protected function withDefaultFilename(ActionRequest $request)
{
Expand All @@ -57,7 +56,7 @@ protected function withDefaultFilename(ActionRequest $request)
abstract protected function getDefaultExtension(): string;

/**
* @param ActionRequest $request
* @param ActionRequest $request
*/
protected function handleFilename(ActionRequest $request): void
{
Expand Down
9 changes: 4 additions & 5 deletions src/Concerns/WithHeadings.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ trait WithHeadings
protected $headings = [];

/**
* @param array|mixed $headings
* @param array $only
*
* @param array|mixed $headings
* @param array $only
* @return $this
*/
public function withHeadings($headings = null)
Expand All @@ -49,8 +48,8 @@ public function headings(): array
}

/**
* @param Builder $query
* @param ExportActionRequest $request
* @param Builder $query
* @param ExportActionRequest $request
*/
protected function handleHeadings($query, ExportActionRequest $request)
{
Expand Down
5 changes: 2 additions & 3 deletions src/Concerns/WithWriterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ trait WithWriterType
protected $writerType;

/**
* @param string|null $writerType
*
* @param string|null $writerType
* @return $this
*/
public function withWriterType(string $writerType = null)
Expand All @@ -32,7 +31,7 @@ protected function getWriterType(): ?string
}

/**
* @param ActionRequest $request
* @param ActionRequest $request
*/
protected function handleWriterType(ActionRequest $request)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/ExcelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class ExcelController extends Controller
use ValidatesRequests;

/**
* @param Request $request
* @param ResponseFactory $response
*
* @param Request $request
* @param ResponseFactory $response
* @return Response
*
* @throws ValidationException
*/
public function download(Request $request, ResponseFactory $response): Response
Expand Down
5 changes: 2 additions & 3 deletions src/Interactions/AskForFilename.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ trait AskForFilename
/**
* Ask the user for a filename.
*
* @param string $label Input label
* @param callable|null $callback
*
* @param string $label Input label
* @param callable|null $callback
* @return $this
*/
public function askForFilename(string $label = null, callable $callback = null)
Expand Down
7 changes: 3 additions & 4 deletions src/Interactions/AskForWriterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ trait AskForWriterType
/**
* Ask the user for a filename.
*
* @param array|null $options
* @param string|null $label
* @param callable|null $callback
*
* @param array|null $options
* @param string|null $label
* @param callable|null $callback
* @return $this
*/
public function askForWriterType(array $options = null, string $label = null, callable $callback = null)
Expand Down
11 changes: 4 additions & 7 deletions src/Requests/ExportActionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ interface ExportActionRequest
public function toExportQuery();

/**
* @param \Laravel\Nova\Resource $resource
*
* @param \Laravel\Nova\Resource $resource
* @return array
*/
public function indexFields(Resource $resource): array;

/**
* @param \Laravel\Nova\Resource $resource
*
* @param \Laravel\Nova\Resource $resource
* @return Collection|Field[]
*/
public function resourceFields(Resource $resource): Collection;

/**
* @param string $attribute
* @param string|null $default
*
* @param string $attribute
* @param string|null $default
* @return string|null
*/
public function findHeading(string $attribute, string $default = null);
Expand Down
3 changes: 1 addition & 2 deletions src/Requests/ExportActionRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
class ExportActionRequestFactory
{
/**
* @param ActionRequest $request
*
* @param ActionRequest $request
* @return ExportActionRequest
*/
public static function make(ActionRequest $request): ExportActionRequest
Expand Down
3 changes: 1 addition & 2 deletions src/Requests/ExportResourceActionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public function toExportQuery()
}

/**
* @param \Laravel\Nova\Resource $resource
*
* @param \Laravel\Nova\Resource $resource
* @return Collection|Field[]
*/
public function resourceFields(Resource $resource): Collection
Expand Down
9 changes: 4 additions & 5 deletions src/Requests/SerializedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class SerializedRequest
private $lens;

/**
* @param string $className
* @param string $resource
* @param string|null $lens
* @param string $className
* @param string $resource
* @param string|null $lens
*/
public function __construct(string $className, string $resource, string $lens = null)
{
Expand All @@ -36,8 +36,7 @@ public function __construct(string $className, string $resource, string $lens =
}

/**
* @param ActionRequest|LensActionRequest $request
*
* @param ActionRequest|LensActionRequest $request
* @return SerializedRequest
*/
public static function serialize(ActionRequest $request)
Expand Down
5 changes: 2 additions & 3 deletions src/Requests/WithHeadingFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
trait WithHeadingFinder
{
/**
* @param string $attribute
* @param string|null $default
*
* @param string $attribute
* @param string|null $default
* @return string|null
*/
public function findHeading(string $attribute, string $default = null)
Expand Down
Loading

0 comments on commit 2219283

Please sign in to comment.