Skip to content

Commit

Permalink
Fix return type of FromQuery::query() (#3485)
Browse files Browse the repository at this point in the history
  • Loading branch information
halloei authored Jan 4, 2022
1 parent 6f171c8 commit e3d9b7e
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- Fix return type of `FromQuery::query()`

## [3.1.35] - 2022-01-04

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion src/Concerns/FromQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

namespace Maatwebsite\Excel\Concerns;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;

interface FromQuery
{
/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query();
}
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromGroupUsersQueuedQueryExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
Expand All @@ -15,7 +17,7 @@ class FromGroupUsersQueuedQueryExport implements FromQuery, WithCustomChunkSize,
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromNestedArraysQueryExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
Expand All @@ -13,7 +15,7 @@ class FromNestedArraysQueryExport implements FromQuery, WithMapping
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromNonEloquentQueryExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Concerns\Exportable;
Expand All @@ -13,7 +15,7 @@ class FromNonEloquentQueryExport implements FromQuery, WithCustomChunkSize
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromQueryWithCustomQuerySize.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Concerns\Exportable;
Expand All @@ -16,7 +18,7 @@ class FromQueryWithCustomQuerySize implements FromQuery, WithCustomQuerySize, Wi
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromUsersQueryExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
Expand All @@ -13,7 +15,7 @@ class FromUsersQueryExport implements FromQuery, WithCustomChunkSize
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromUsersQueryExportWithEagerLoad.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
Expand All @@ -13,7 +15,7 @@ class FromUsersQueryExportWithEagerLoad implements FromQuery, WithMapping
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromUsersQueryExportWithMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
Expand All @@ -15,7 +17,7 @@ class FromUsersQueryExportWithMapping implements FromQuery, WithMapping, WithEve
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Data/Stubs/FromUsersQueryExportWithPrepareRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Maatwebsite\Excel\Tests\Data\Stubs;

use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\Exportable;
Expand All @@ -14,7 +16,7 @@ class FromUsersQueryExportWithPrepareRows implements FromQuery, WithCustomChunkS
use Exportable;

/**
* @return Builder
* @return Builder|EloquentBuilder|Relation
*/
public function query()
{
Expand Down

0 comments on commit e3d9b7e

Please sign in to comment.