Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP deprecation warnings #137

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Exception/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ApiException extends Exception {
/** @var ResponseInterface $response */
protected $response;

public function __construct( $message = "", ResponseInterface $response ) {
public function __construct( $message, ResponseInterface $response ) {
$this->response = $response;

parent::__construct( $message, $response->getStatusCode() );
Expand Down
2 changes: 1 addition & 1 deletion src/V2/Pagination/IPaginatedEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ function page( $page, $size = null );
* @param callable $callback
* @return void
*/
function batch( $parallelRequests = null, callable $callback );
function batch( $parallelRequests, $callback = null );
}
2 changes: 1 addition & 1 deletion src/V2/Pagination/PaginatedEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function page( $page, $size = null ) {
* @param callable $callback
* @return void
*/
public function batch( $parallelRequests = null, callable $callback = null ) {
public function batch( $parallelRequests, $callback = null ) {
/** @noinspection PhpParamsInspection */
if( !isset( $callback ) && is_callable( $parallelRequests )) {
$callback = $parallelRequests;
Expand Down
6 changes: 6 additions & 0 deletions tests/Stubs/BulkEndpointStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

class BulkEndpointStub extends EndpointStub implements IBulkEndpoint {
use BulkEndpoint;

/** @var bool $supportsIdsAll */
protected $supportsIdsAll = false;

/** @var int $maxPageSize */
protected $maxPageSize = false;

public function __construct( GW2Api $api, $supportsIdsAll, $maxPageSize ) {
$this->supportsIdsAll = $supportsIdsAll;
Expand Down
3 changes: 3 additions & 0 deletions tests/Stubs/PaginatedEndpointStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
class PaginatedEndpointStub extends EndpointStub implements IPaginatedEndpoint {
use PaginatedEndpoint;

/** @var int $maxPageSize */
protected $maxPageSize = false;

public function __construct( GW2Api $api, $maxPageSize = 10 ) {
parent::__construct( $api );

Expand Down
Loading