Skip to content

Commit

Permalink
Merge pull request #7 from sabbelasichon/feature/make-package-version…
Browse files Browse the repository at this point in the history
…-independent

Make package TYPO3 version independent
  • Loading branch information
georgringer authored Feb 2, 2022
2 parents 03703ee + b9e977e commit d36aa6c
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 9 deletions.
20 changes: 20 additions & 0 deletions Classes/Contract/PaginationInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace GeorgRinger\NumberedPagination\Contract;

interface PaginationInterface
{
public function __construct(PaginatorInterface $paginator);

public function getPreviousPageNumber(): ?int;

public function getNextPageNumber(): ?int;

public function getFirstPageNumber(): int;

public function getLastPageNumber(): int;

public function getStartRecordNumber(): int;

public function getEndRecordNumber(): int;
}
20 changes: 20 additions & 0 deletions Classes/Contract/PaginatorInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace GeorgRinger\NumberedPagination\Contract;

interface PaginatorInterface
{
public function withItemsPerPage(int $itemsPerPage): PaginatorInterface;

public function withCurrentPageNumber(int $currentPageNumber): PaginatorInterface;

public function getPaginatedItems(): iterable;

public function getNumberOfPages(): int;

public function getCurrentPageNumber(): int;

public function getKeyOfFirstPaginatedItem(): int;

public function getKeyOfLastPaginatedItem(): int;
}
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "georgringer/numbered-pagination",
"type": "typo3-cms-extension",
"description": "Improved pagination for TYPO3 10+",
"description": "Improved pagination for TYPO3",
"keywords": [
"TYPO3",
"pagination"
Expand All @@ -15,7 +15,7 @@
],
"license": "GPL-2.0-or-later",
"require": {
"typo3/cms-core": "^10 || ^11",
"typo3/cms-core": "^9 || ^10 || ^11",
"php": ">=7.3"
},
"extra": {
Expand All @@ -28,11 +28,6 @@
"GeorgRinger\\NumberedPagination\\": "Classes"
}
},
"autoload-dev": {
"psr-4": {
"GeorgRinger\\NumberedPagination\\Tests\\": "Tests"
}
},
"replace": {
"typo3-ter/numbered-pagination": "self.version"
}
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
'author_email' => '[email protected]',
'state' => 'beta',
'clearCacheOnLoad' => true,
'version' => '1.0.2',
'version' => '1.0.3',
'constraints' => [
'depends' => [
'typo3' => '10.4.12-11.5.99',
'typo3' => '9.5.0-11.5.99',
],
'conflicts' => [],
'suggests' => [],
Expand Down
17 changes: 17 additions & 0 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

defined('TYPO3_MODE') or die();

if (!class_exists('TYPO3\CMS\Core\Pagination\PaginationInterface')) {
class_alias(
\GeorgRinger\NumberedPagination\Contract\PaginationInterface::class,
'TYPO3\CMS\Core\Pagination\PaginationInterface'
);
}

if (!class_exists('TYPO3\CMS\Core\Pagination\PaginatorInterface')) {
class_alias(
\GeorgRinger\NumberedPagination\Contract\PaginatorInterface::class,
'TYPO3\CMS\Core\Pagination\PaginatorInterface'
);
}

0 comments on commit d36aa6c

Please sign in to comment.