Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Fix PHP5 compatibility issues #123

Open
wants to merge 4 commits 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
2 changes: 1 addition & 1 deletion src/Exceptions/LEAccountException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
class LEAccountException extends LEException
{
public const ACCOUNTNOTFOUNDEEXCEPTION = 0x21;
const ACCOUNTNOTFOUNDEEXCEPTION = 0x21;

public static function AccountNotFoundException()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/LEAuthorizationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
class LEAuthorizationException extends LEException
{
public const NOCHALLENGEFOUNDEEXCEPTION = 0x41;
const NOCHALLENGEFOUNDEEXCEPTION = 0x41;

public static function NoChallengeFoundException($type, $identifier)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/LEClientException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
*/
class LEClientException extends LEException
{
public const INVALIDARGUMENTEXCEPTION = 0x01;
public const INVALIDDIRECTORYEXCEPTION = 0x02;
const INVALIDARGUMENTEXCEPTION = 0x01;
const INVALIDDIRECTORYEXCEPTION = 0x02;

public static function InvalidArgumentException(string $message)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Exceptions/LEConnectorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
*/
class LEConnectorException extends LEException
{
public const NONEWNONCEEXCEPTION = 0x11;
public const ACCOUNTDEACTIVATEDEXCEPTION = 0x12;
public const METHODNOTSUPPORTEDEXCEPTION = 0x13;
public const CURLERROREXCEPTION = 0x14;
public const INVALIDRESPONSEEXCEPTION = 0x15;
const NONEWNONCEEXCEPTION = 0x11;
const ACCOUNTDEACTIVATEDEXCEPTION = 0x12;
const METHODNOTSUPPORTEDEXCEPTION = 0x13;
const CURLERROREXCEPTION = 0x14;
const INVALIDRESPONSEEXCEPTION = 0x15;

public static function NoNewNonceException()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/LEException.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LEException extends \RuntimeException
{
protected $responsedata;

public function __construct(string $message = "", int $code = 0, Throwable $previous = NULL, array $responsedata = NULL)
public function __construct($message = "", $code = 0, $previous = NULL, $responsedata = NULL)
{
parent::__construct($message, $code, $previous);
$this->responsedata = $responsedata;
Expand Down
6 changes: 3 additions & 3 deletions src/Exceptions/LEFunctionsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
*/
class LEFunctionsException extends LEException
{
public const INVALIDARGUMENTEXCEPTION = 0x51;
public const GENERATEKEYPAIREXCEPTION = 0x52;
public const PHPVERSIONEXCEPTION = 0x53;
const INVALIDARGUMENTEXCEPTION = 0x51;
const GENERATEKEYPAIREXCEPTION = 0x52;
const PHPVERSIONEXCEPTION = 0x53;

public static function InvalidArgumentException(string $message)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Exceptions/LEOrderException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
*/
class LEOrderException extends LEException
{
public const INVALIDKEYTYPEEXCEPTION = 0x31;
public const INVALIDORDERSTATUSEXCEPTION = 0x32;
public const CREATEFAILEDEXCEPTION = 0x33;
public const INVALIDARGUMENTEXCEPTION = 0x34;
public const INVALIDCONFIGURATIONEXCEPTION = 0x35;
const INVALIDKEYTYPEEXCEPTION = 0x31;
const INVALIDORDERSTATUSEXCEPTION = 0x32;
const CREATEFAILEDEXCEPTION = 0x33;
const INVALIDARGUMENTEXCEPTION = 0x34;
const INVALIDCONFIGURATIONEXCEPTION = 0x35;

public static function InvalidKeyTypeException(string $keyType)
{
Expand Down
3 changes: 2 additions & 1 deletion src/LEConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ private function getLEDirectory()
*/
private function getNewNonce()
{
if($this->head($this->newNonce)['status'] !== 200) throw LEConnectorException::NoNewNonceException();
$head = $this->head($this->newNonce);
if($head['status'] !== 200) throw LEConnectorException::NoNewNonceException();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/LEOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,10 @@ private function validateCertificateResponse(array $response)
{
if(preg_match_all('~(-----BEGIN\sCERTIFICATE-----[\s\S]+?-----END\sCERTIFICATE-----)~i', $response['body'], $matches))
{
return [
return array(
'leaf' => $matches[0][0],
'intermediate' => $matches[0][1],
];
);
}
else
{
Expand Down