Skip to content

Commit

Permalink
Merge pull request #304 from garak/remove-php73
Browse files Browse the repository at this point in the history
Remove support for php 7.3
  • Loading branch information
garak authored Dec 11, 2021
2 parents 51aaf2c + 9dd70e7 commit 755b0d1
Show file tree
Hide file tree
Showing 37 changed files with 100 additions and 194 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,14 @@ jobs:
strategy:
fail-fast: false
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
include:
- description: 'Lowest'
composer_option: '--prefer-lowest'
- description: '7.4'
php: '7.4'
composer_option: '--prefer-lowest'
- description: '8.0'
php: '8.0'
- description: '8.1'
php: '8.1'
composer_option: ''
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"symfony/event-dispatcher-contracts": "^2.0 || ^3.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/Component/Pager/Event/AfterEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
final class AfterEvent extends Event
{
private $pagination;
private PaginationInterface $pagination;

public function __construct(PaginationInterface $paginationView)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Knp/Component/Pager/Event/BeforeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
*/
final class BeforeEvent extends Event
{
private $eventDispatcher;
private EventDispatcherInterface $eventDispatcher;

private $request;
private ?Request $request;

public function __construct(EventDispatcherInterface $eventDispatcher, ?Request $request)
{
Expand Down
14 changes: 5 additions & 9 deletions src/Knp/Component/Pager/Event/ItemsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ final class ItemsEvent extends Event

/**
* List of options
*
* @var array
*/
public $options;
public array $options;

/**
* Items result
Expand All @@ -32,14 +30,12 @@ final class ItemsEvent extends Event

/**
* Count result
*
* @var integer
*/
public $count;
public int $count;

private $offset;
private $limit;
private $customPaginationParams = [];
private int $offset;
private int $limit;
private array $customPaginationParams = [];

public function __construct(int $offset, int $limit)
{
Expand Down
6 changes: 2 additions & 4 deletions src/Knp/Component/Pager/Event/PaginationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ final class PaginationEvent extends Event

/**
* List of options
*
* @var array
*/
public $options;
public array $options;

private $pagination;
private PaginationInterface $pagination;

public function setPagination(PaginationInterface $pagination): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@

class QuerySubscriber implements EventSubscriberInterface
{
/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(?Request $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ class FiltrationSubscriber implements EventSubscriberInterface
{
/**
* Lazy-load state tracker
* @var bool
*/
private $isLoaded = false;
private bool $isLoaded = false;

public function before(BeforeEvent $event): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

class PropelQuerySubscriber implements EventSubscriberInterface
{
/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(?Request $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class CallbackPagination
*/
private $items;

/**
* @param callable $count
* @param callable $items
*/
public function __construct(callable $count, callable $items)
{
$this->count = $count;
Expand All @@ -36,6 +32,6 @@ public function getPaginationCount(): int

public function getPaginationItems(int $offset, int $limit): array
{
return call_user_func_array($this->items, [$offset, $limit]);
return call_user_func($this->items, $offset, $limit);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class DBALQueryBuilderSubscriber implements EventSubscriberInterface
public function items(ItemsEvent $event): void
{
if ($event->target instanceof QueryBuilder) {
/** @var QueryBuilder $target */
$target = $event->target;

// count results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class Helper
/**
* Clones the given $query and copies all used
* parameters and hints
*
* @param Query $query
* @return Query
*/
public static function cloneQuery(Query $query): Query
{
Expand All @@ -33,10 +30,6 @@ public static function cloneQuery(Query $query): Query
* Add a custom TreeWalker $walker class name to
* be included in the CustomTreeWalker hint list
* of the given $query
*
* @param Query $query
* @param string $walker
* @return void
*/
public static function addCustomTreeWalker(Query $query, string $walker): void
{
Expand All @@ -48,4 +41,4 @@ public static function addCustomTreeWalker(Query $query, string $walker): void
}
$query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, $customTreeWalkers);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ class PaginationSubscriber implements EventSubscriberInterface
{
/**
* Lazy-load state tracker
* @var bool
*/
private $isLoaded = false;
private bool $isLoaded = false;

public function pagination(PaginationEvent $event): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,16 @@ class ArraySubscriber implements EventSubscriberInterface
/**
* @var string the field used to sort current object array list
*/
private $currentSortingField;
private string $currentSortingField;

/**
* @var string the sorting direction
*/
private $sortDirection;
private string $sortDirection;

/**
* @var PropertyAccessorInterface|null
*/
private $propertyAccessor;
private ?PropertyAccessorInterface $propertyAccessor;

/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(Request $request = null, PropertyAccessorInterface $accessor = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

class QuerySubscriber implements EventSubscriberInterface
{
/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(Request $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ class OrderByWalker extends TreeWalkerAdapter
/**
* Walks down a SelectStatement AST node, modifying it to
* sort the query like requested by url
*
* @param SelectStatement $AST
* @return void|string
*/
public function walkSelectStatement(SelectStatement $AST)
public function walkSelectStatement(SelectStatement $AST): string
{
$query = $this->_getQuery();
$fields = (array)$query->getHint(self::HINT_PAGINATOR_SORT_FIELD);
Expand Down Expand Up @@ -92,5 +89,7 @@ public function walkSelectStatement(SelectStatement $AST)
$AST->orderByClause = new OrderByClause([$orderByItem]);
}
}

return '';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

class ElasticaQuerySubscriber implements EventSubscriberInterface
{
/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(Request $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

class PropelQuerySubscriber implements EventSubscriberInterface
{
/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(Request $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
*/
class SolariumQuerySubscriber implements EventSubscriberInterface
{
/**
* @var Request
*/
private $request;
private Request $request;

public function __construct(Request $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ class SortableSubscriber implements EventSubscriberInterface
{
/**
* Lazy-load state tracker
* @var bool
*/
private $isLoaded = false;
private bool $isLoaded = false;

public function before(BeforeEvent $event): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

class PageNumberOutOfRangeException extends OutOfRangeException
{
/** @var int */
private $maxPageNumber;
private int $maxPageNumber;

public function __construct(?string $message, int $maxPageNumber, ?Throwable $previousException = null)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Knp/Component/Pager/Pagination/AbstractPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

abstract class AbstractPagination implements Iterator, PaginationInterface
{
protected $currentPageNumber;
protected $numItemsPerPage;
protected $items = [];
protected $totalCount;
protected $paginatorOptions;
protected $customParameters;
protected ?int $currentPageNumber = null;
protected ?int $numItemsPerPage = null;
protected iterable $items = [];
protected ?int $totalCount = null;
protected ?array $paginatorOptions = null;
protected ?array $customParameters = null;

public function rewind(): void
{
Expand Down
8 changes: 2 additions & 6 deletions src/Knp/Component/Pager/Pagination/SlidingPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ final class SlidingPagination extends AbstractPagination
{
/**
* Pagination page range
*
* @var int
*/
private $range = 5;
private int $range = 5;

/**
* Closure which is executed to render pagination
*
* @var Closure
*/
public $renderer;
public ?Closure $renderer = null;

public function setPageRange(int $range): void
{
Expand Down
14 changes: 4 additions & 10 deletions src/Knp/Component/Pager/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@
*/
final class Paginator implements PaginatorInterface
{
/**
* @var EventDispatcherInterface
*/
private $eventDispatcher;
private EventDispatcherInterface $eventDispatcher;

/**
* Default options of paginator
*
* @var array
* @var array<string, scalar>
*/
private $defaultOptions = [
private array $defaultOptions = [
self::PAGE_PARAMETER_NAME => 'page',
self::SORT_FIELD_PARAMETER_NAME => 'sort',
self::SORT_DIRECTION_PARAMETER_NAME => 'direction',
Expand All @@ -37,10 +34,7 @@ final class Paginator implements PaginatorInterface
self::DEFAULT_LIMIT => self::DEFAULT_LIMIT_VALUE,
];

/**
* @var RequestStack|null
*/
private $requestStack;
private ?RequestStack $requestStack;

public function __construct(EventDispatcherInterface $eventDispatcher, RequestStack $requestStack = null)
{
Expand Down
Loading

0 comments on commit 755b0d1

Please sign in to comment.