Skip to content

Commit

Permalink
Fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed May 28, 2020
1 parent 3cfa43c commit fbb772b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Pdf/CakePdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ public function crypto($name = null): AbstractPdfCrypto

$engineClassName = App::className($name, 'Pdf/Crypto', 'Crypto');
if ($engineClassName === null || !class_exists($engineClassName)) {
throw new Exception('Pdf crypto "%s" not found', $name);
throw new Exception(sprintf('Pdf crypto `%s` not found', $name));
}
if (!is_subclass_of($engineClassName, 'CakePdf\Pdf\Crypto\AbstractPdfCrypto')) {
throw new Exception('Crypto engine must extend "AbstractPdfCrypto"');
if (!is_subclass_of($engineClassName, AbstractPdfCrypto::class)) {
throw new Exception('Crypto engine must extend `AbstractPdfCrypto`');
}
$this->_cryptoClass = new $engineClassName($this);
$this->_cryptoClass->config($config);
Expand Down

0 comments on commit fbb772b

Please sign in to comment.