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

Remove PHP 7.1+ references to keep 5.6+ compatibility. #925

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions src/XeroPHP/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Application
* @param $tenantId
* $param $constructClient
*/
public function __construct($token, $tenantId, ?bool $constructClient = true)
public function __construct($token, $tenantId, $constructClient = true)
{
$this->config = static::$_config_defaults;

Expand Down Expand Up @@ -462,14 +462,14 @@ public function delete(Remote\Model $object)
return $object;
}

public function updateAppRateLimit(int $appMinLimitRemining)
public function updateAppRateLimit($appMinLimitRemining)
Copy link
Contributor

@bretto36 bretto36 Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You reckon you could add the phpdoc version of the prop types? Just so there is no loss in the IDE auto complete

/*
* @param int $appMinLimitRemining.
*/

{
$this->lastApiCall = time();
$this->appMinLimitRemining = $appMinLimitRemining;
return $this;
}

public function updateTenantRateLimits(int $tenantDayLimitRemining, int $tenantMinLimitRemining)
public function updateTenantRateLimits($tenantDayLimitRemining, $tenantMinLimitRemining)
{
$this->lastApiCall = time();
$this->tenantDayLimitRemining = $tenantDayLimitRemining;
Expand All @@ -480,31 +480,31 @@ public function updateTenantRateLimits(int $tenantDayLimitRemining, int $tenantM
/**
* @return int|null Timestamp of last API call.
*/
public function getLastApiCall(): ?int
public function getLastApiCall()
{
return $this->lastApiCall;
}

/**
* @return int|null Application call limit remaining across all tenants.
*/
public function getAppMinLimitRemining(): ?int
public function getAppMinLimitRemining()
{
return $this->appMinLimitRemining;
}

/**
* @return int|null Tenant daily call limit remaining
*/
public function getTenantDayLimitRemining(): ?int
public function getTenantDayLimitRemining()
{
return $this->tenantDayLimitRemining;
}

/**
* @return int|null Tenant minute call limit remaining
*/
public function getTenantMinLimitRemining(): ?int
public function getTenantMinLimitRemining()
{
return $this->tenantMinLimitRemining;
}
Expand Down
3 changes: 1 addition & 2 deletions src/XeroPHP/Remote/Exception/RequiredFieldException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace XeroPHP\Remote\Exception;

use Throwable;
use XeroPHP\Remote\Exception;

class RequiredFieldException extends Exception
{
protected $class;
protected $field;

public function __construct($class, $field, $message = "", $code = 0, Throwable $previous = null)
public function __construct($class, $field, $message = "", $code = 0, $previous = null)
{
$this->class = $class;
$this->field = $field;
Expand Down