1 | <?php |
||
4 | class PaginationFactory |
||
5 | { |
||
6 | |||
7 | |||
8 | /** |
||
9 | * @var int |
||
10 | */ |
||
11 | public $default_page_size = 25; |
||
12 | |||
13 | |||
14 | /** |
||
15 | * Default class FQDN for creating the Pagination instance |
||
16 | * @var string |
||
17 | */ |
||
18 | public $default_pagination_class; |
||
19 | |||
20 | |||
21 | |||
22 | /** |
||
23 | * @param int|integer $default_page_size Default: 25 |
||
24 | * @param string|null $php_class Default: \Germania\Pagination\Pagination |
||
25 | */ |
||
26 | 88 | public function __construct( int $default_page_size = 25, string $php_class = null ) |
|
31 | |||
32 | |||
33 | /** |
||
34 | * @param mixed $items The items to paginate: int, array or Traversable (countable) |
||
35 | * @param int|array $pagination_data The data to construct the pagination with |
||
36 | * @param string $php_class Optional: Custom pagination class FQDN |
||
|
|||
37 | * @return |
||
38 | */ |
||
39 | 48 | public function __invoke( $items, $pagination_data, string $custom_php_class = null ) |
|
64 | |||
65 | |||
66 | /** |
||
67 | * Counts the items to determine the $items_count parameter for Pagination class. |
||
68 | * |
||
69 | * @param mixed $items |
||
70 | * @return int |
||
71 | * @throws PaginationInvalidArgumentException |
||
72 | */ |
||
73 | 48 | protected function countItems( $items ) |
|
92 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.