Skip to content

Commit

Permalink
Move pagination classes to separate namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Nov 23, 2024
1 parent c11a1d2 commit dd9776e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions config/widgets-themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Yiisoft\Yii\DataView\Filter\Widget\DropdownFilter;
use Yiisoft\Yii\DataView\Filter\Widget\TextInputFilter;
use Yiisoft\Yii\DataView\GridView;
use Yiisoft\Yii\DataView\KeysetPagination;
use Yiisoft\Yii\DataView\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\KeysetPagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;
use Yiisoft\Yii\DataView\PageSize\InputPageSize;
use Yiisoft\Yii\DataView\PageSize\SelectPageSize;

Expand Down
3 changes: 3 additions & 0 deletions src/BaseListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
use Yiisoft\Yii\DataView\PageSize\PageSizeContext;
use Yiisoft\Yii\DataView\PageSize\PageSizeControlInterface;
use Yiisoft\Yii\DataView\PageSize\SelectPageSize;
use Yiisoft\Yii\DataView\Pagination\KeysetPagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\PaginationContext;

use function array_key_exists;
use function array_slice;
Expand Down
5 changes: 4 additions & 1 deletion src/BasePagination.php → src/Pagination/BasePagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

declare(strict_types=1);

namespace Yiisoft\Yii\DataView;
namespace Yiisoft\Yii\DataView\Pagination;

use InvalidArgumentException;
use Yiisoft\Data\Paginator\PageToken;
use Yiisoft\Data\Paginator\PaginatorInterface;
use Yiisoft\Data\Reader\OrderHelper;
use Yiisoft\Html\Html;
use Yiisoft\Widget\Widget;
use Yiisoft\Yii\DataView\BaseListView;
use Yiisoft\Yii\DataView\UrlConfig;
use Yiisoft\Yii\DataView\UrlParametersFactory;

use function array_key_exists;
use function call_user_func_array;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

declare(strict_types=1);

namespace Yiisoft\Yii\DataView;
namespace Yiisoft\Yii\DataView\Pagination;

use Stringable;
use Yiisoft\Data\Paginator\KeysetPaginator;
use Yiisoft\Data\Paginator\PageToken;
use Yiisoft\Yii\DataView\Exception;

final class KeysetPagination extends BasePagination
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

declare(strict_types=1);

namespace Yiisoft\Yii\DataView;
namespace Yiisoft\Yii\DataView\Pagination;

use InvalidArgumentException;
use Stringable;
use Yiisoft\Data\Paginator\PageToken;
use Yiisoft\Data\Paginator\OffsetPaginator;
use Yiisoft\Yii\DataView\Exception;

use function max;
use function min;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\DataView;
namespace Yiisoft\Yii\DataView\Pagination;

final class PaginationContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\DataView;
namespace Yiisoft\Yii\DataView\Pagination;

use Stringable;

Expand Down
2 changes: 1 addition & 1 deletion tests/Pagination/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Yiisoft\Factory\NotFoundException;
use Yiisoft\Router\UrlGeneratorInterface;
use Yiisoft\Widget\WidgetFactory;
use Yiisoft\Yii\DataView\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;
use Yiisoft\Yii\DataView\Tests\Support\Assert;
use Yiisoft\Yii\DataView\Tests\Support\Mock;
use Yiisoft\Yii\DataView\Tests\Support\SimplePaginationUrlCreator;
Expand Down
2 changes: 1 addition & 1 deletion tests/Pagination/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Yiisoft\Di\ContainerConfig;
use Yiisoft\Factory\NotFoundException;
use Yiisoft\Widget\WidgetFactory;
use Yiisoft\Yii\DataView\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;
use Yiisoft\Yii\DataView\Tests\Support\TestTrait;

final class ExceptionTest extends TestCase
Expand Down
4 changes: 2 additions & 2 deletions tests/Pagination/ImmutableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use PHPUnit\Framework\TestCase;
use Yiisoft\Data\Paginator\PageToken;
use Yiisoft\Data\Paginator\PaginatorInterface;
use Yiisoft\Yii\DataView\BasePagination;
use Yiisoft\Yii\DataView\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\BasePagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;
use Yiisoft\Yii\DataView\Tests\Support\TestTrait;
use Yiisoft\Yii\DataView\UrlConfig;

Expand Down
2 changes: 1 addition & 1 deletion tests/Pagination/KeysetPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Yiisoft\Yii\DataView\Column\DataColumn;
use Yiisoft\Yii\DataView\Exception\PaginatorNotSetException;
use Yiisoft\Yii\DataView\GridView;
use Yiisoft\Yii\DataView\KeysetPagination;
use Yiisoft\Yii\DataView\Pagination\KeysetPagination;
use Yiisoft\Yii\DataView\Tests\Support\Assert;
use Yiisoft\Yii\DataView\Tests\Support\TestTrait;

Expand Down
2 changes: 1 addition & 1 deletion tests/Pagination/OffsetPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Yiisoft\Factory\NotFoundException;
use Yiisoft\Yii\DataView\Exception\PaginatorNotSetException;
use Yiisoft\Yii\DataView\GridView;
use Yiisoft\Yii\DataView\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;
use Yiisoft\Yii\DataView\Tests\Support\Assert;
use Yiisoft\Yii\DataView\Tests\Support\TestTrait;

Expand Down

0 comments on commit dd9776e

Please sign in to comment.