Skip to content

Commit b920787

Browse files
committed
PHP 7.4 compatibility + small improvements
1 parent 9b73999 commit b920787

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/vendor
22
/composer.lock
33
/examples/mycertandkey.crt
4-
/examples/SwisscomAISDemoClient-Certificate.*
4+
/examples/*.crt
5+
/examples/*.pfx
56
/examples/credentials*
67
/examples/output/*.pdf
78
/examples/_tmp/.ht*

examples/demo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// now let's create a signer instance
4545
$signer = new SetaPDF_Signer($document);
4646
$signer->setAllowSignatureContentLengthChange(false);
47-
$signer->setSignatureContentLength(32000);
47+
$signer->setSignatureContentLength(36000);
4848

4949
// set some signature properties
5050
$signer->setLocation($_SERVER['SERVER_NAME']);

src/SetaPDF/Signer/SwisscomAIS/AbstractModule.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __construct($customerId, array $clientOptions = array(), $wsdl =
7777
{
7878
$this->_customerId = $customerId;
7979
$this->_clientOptions = $clientOptions;
80-
$this->_wsdl = $wsdl === null ? dirname(__FILE__) . '/aisService.wsdl' : $wsdl;
80+
$this->_wsdl = $wsdl === null ? __DIR__ . '/aisService.wsdl' : $wsdl;
8181
}
8282

8383
/**
@@ -196,7 +196,7 @@ public function updateDss(SetaPDF_Core_Document $document, $fieldName)
196196
}
197197

198198
$dss = new SetaPDF_Signer_DocumentSecurityStore($document);
199-
$dss->addValidationRelatedInfoByField($fieldName, $crls, $ocsps, $certificates);
199+
$dss->addValidationRelatedInfoByFieldName($fieldName, $crls, $ocsps, $certificates);
200200
}
201201

202202
/**
@@ -209,9 +209,9 @@ protected function _getHash($data)
209209
{
210210
if ($data instanceof SetaPDF_Core_Reader_FilePath) {
211211
return hash_file($this->getDigest(), $data->getPath(), true);
212-
} else {
213-
return hash($this->getDigest(), $data, true);
214212
}
213+
214+
return hash($this->getDigest(), $data, true);
215215
}
216216

217217
/**
@@ -247,7 +247,7 @@ protected function _generateTransactionId()
247247
$maxLen = strlen($pattern) - 1;
248248
$id = '';
249249
for ($i = 1; $i <= 6; $i++) {
250-
$id .= $pattern{mt_rand(0, $maxLen)};
250+
$id .= $pattern[mt_rand(0, $maxLen)];
251251
}
252252

253253
return $id;

src/SetaPDF/Signer/SwisscomAIS/Batch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SetaPDF_Signer_SwisscomAIS_Batch extends SetaPDF_Signer_SwisscomAIS_Abstra
2424
*
2525
* @var int
2626
*/
27-
protected $_signatureConentLength = 32000;
27+
protected $_signatureConentLength = 36000;
2828

2929
/**
3030
* The signature field name

0 commit comments

Comments
 (0)