Skip to content

Commit

Permalink
PHP 7.4 compatibility + small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSlabon committed Aug 11, 2020
1 parent 9b73999 commit b920787
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/vendor
/composer.lock
/examples/mycertandkey.crt
/examples/SwisscomAISDemoClient-Certificate.*
/examples/*.crt
/examples/*.pfx
/examples/credentials*
/examples/output/*.pdf
/examples/_tmp/.ht*
2 changes: 1 addition & 1 deletion examples/demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// now let's create a signer instance
$signer = new SetaPDF_Signer($document);
$signer->setAllowSignatureContentLengthChange(false);
$signer->setSignatureContentLength(32000);
$signer->setSignatureContentLength(36000);

// set some signature properties
$signer->setLocation($_SERVER['SERVER_NAME']);
Expand Down
10 changes: 5 additions & 5 deletions src/SetaPDF/Signer/SwisscomAIS/AbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct($customerId, array $clientOptions = array(), $wsdl =
{
$this->_customerId = $customerId;
$this->_clientOptions = $clientOptions;
$this->_wsdl = $wsdl === null ? dirname(__FILE__) . '/aisService.wsdl' : $wsdl;
$this->_wsdl = $wsdl === null ? __DIR__ . '/aisService.wsdl' : $wsdl;
}

/**
Expand Down Expand Up @@ -196,7 +196,7 @@ public function updateDss(SetaPDF_Core_Document $document, $fieldName)
}

$dss = new SetaPDF_Signer_DocumentSecurityStore($document);
$dss->addValidationRelatedInfoByField($fieldName, $crls, $ocsps, $certificates);
$dss->addValidationRelatedInfoByFieldName($fieldName, $crls, $ocsps, $certificates);
}

/**
Expand All @@ -209,9 +209,9 @@ protected function _getHash($data)
{
if ($data instanceof SetaPDF_Core_Reader_FilePath) {
return hash_file($this->getDigest(), $data->getPath(), true);
} else {
return hash($this->getDigest(), $data, true);
}

return hash($this->getDigest(), $data, true);
}

/**
Expand Down Expand Up @@ -247,7 +247,7 @@ protected function _generateTransactionId()
$maxLen = strlen($pattern) - 1;
$id = '';
for ($i = 1; $i <= 6; $i++) {
$id .= $pattern{mt_rand(0, $maxLen)};
$id .= $pattern[mt_rand(0, $maxLen)];
}

return $id;
Expand Down
2 changes: 1 addition & 1 deletion src/SetaPDF/Signer/SwisscomAIS/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SetaPDF_Signer_SwisscomAIS_Batch extends SetaPDF_Signer_SwisscomAIS_Abstra
*
* @var int
*/
protected $_signatureConentLength = 32000;
protected $_signatureConentLength = 36000;

/**
* The signature field name
Expand Down

0 comments on commit b920787

Please sign in to comment.