diff --git a/Crypto/SMimeEncrypter.php b/Crypto/SMimeEncrypter.php index d6961a6..9081860 100644 --- a/Crypto/SMimeEncrypter.php +++ b/Crypto/SMimeEncrypter.php @@ -38,7 +38,7 @@ public function __construct($certificate, int $cipher = null) $this->certs = $this->normalizeFilePath($certificate); } - $this->cipher = $cipher ?? OPENSSL_CIPHER_AES_256_CBC; + $this->cipher = $cipher ?? \OPENSSL_CIPHER_AES_256_CBC; } public function encrypt(Message $message): Message diff --git a/Crypto/SMimeSigner.php b/Crypto/SMimeSigner.php index 1b55537..5b94a45 100644 --- a/Crypto/SMimeSigner.php +++ b/Crypto/SMimeSigner.php @@ -45,7 +45,7 @@ public function __construct(string $certificate, string $privateKey, string $pri $this->signPrivateKey = $this->normalizeFilePath($privateKey); } - $this->signOptions = $signOptions ?? PKCS7_DETACHED; + $this->signOptions = $signOptions ?? \PKCS7_DETACHED; $this->extraCerts = $extraCerts ? realpath($extraCerts) : null; } diff --git a/Encoder/Base64ContentEncoder.php b/Encoder/Base64ContentEncoder.php index cb7f911..338490b 100644 --- a/Encoder/Base64ContentEncoder.php +++ b/Encoder/Base64ContentEncoder.php @@ -24,7 +24,7 @@ public function encodeByteStream($stream, int $maxLineLength = 0): iterable throw new \TypeError(sprintf('Method "%s" takes a stream as a first argument.', __METHOD__)); } - $filter = stream_filter_append($stream, 'convert.base64-encode', STREAM_FILTER_READ, [ + $filter = stream_filter_append($stream, 'convert.base64-encode', \STREAM_FILTER_READ, [ 'line-length' => 0 >= $maxLineLength || 76 < $maxLineLength ? 76 : $maxLineLength, 'line-break-chars' => "\r\n", ]); diff --git a/Encoder/IdnAddressEncoder.php b/Encoder/IdnAddressEncoder.php index cdd5d4c..69ab887 100644 --- a/Encoder/IdnAddressEncoder.php +++ b/Encoder/IdnAddressEncoder.php @@ -43,7 +43,7 @@ public function encodeString(string $address): string } if (preg_match('/[^\x00-\x7F]/', $domain)) { - $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)); + $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, \INTL_IDNA_VARIANT_UTS46)); } } diff --git a/FileinfoMimeTypeGuesser.php b/FileinfoMimeTypeGuesser.php index 3028159..c6c7559 100644 --- a/FileinfoMimeTypeGuesser.php +++ b/FileinfoMimeTypeGuesser.php @@ -54,7 +54,7 @@ public function guessMimeType(string $path): ?string throw new LogicException(sprintf('The "%s" guesser is not supported.', __CLASS__)); } - if (false === $finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) { + if (false === $finfo = new \finfo(\FILEINFO_MIME_TYPE, $this->magicFile)) { return null; } $mimeType = $finfo->file($path); diff --git a/Header/AbstractHeader.php b/Header/AbstractHeader.php index 548c192..e93b87a 100644 --- a/Header/AbstractHeader.php +++ b/Header/AbstractHeader.php @@ -220,7 +220,7 @@ protected function getTokenAsEncodedWord(string $token, int $firstLineOffset = 0 */ protected function generateTokenLines(string $token): array { - return preg_split('~(\r\n)~', $token, -1, PREG_SPLIT_DELIM_CAPTURE); + return preg_split('~(\r\n)~', $token, -1, \PREG_SPLIT_DELIM_CAPTURE); } /** diff --git a/Part/Multipart/FormDataPart.php b/Part/Multipart/FormDataPart.php index 6838620..c293efe 100644 --- a/Part/Multipart/FormDataPart.php +++ b/Part/Multipart/FormDataPart.php @@ -40,7 +40,7 @@ public function __construct(array $fields = []) $this->fields[$name] = $value; } // HTTP does not support \r\n in header values - $this->getHeaders()->setMaxLineLength(PHP_INT_MAX); + $this->getHeaders()->setMaxLineLength(\PHP_INT_MAX); } public function getMediaSubtype(): string @@ -95,7 +95,7 @@ private function configurePart(string $name, TextPart $part): TextPart $part->setDisposition('form-data'); $part->setName($name); // HTTP does not support \r\n in header values - $part->getHeaders()->setMaxLineLength(PHP_INT_MAX); + $part->getHeaders()->setMaxLineLength(\PHP_INT_MAX); $r->setValue($part, '8bit'); return $part; diff --git a/Tests/Crypto/SMimeSignerTest.php b/Tests/Crypto/SMimeSignerTest.php index 5522bc6..ed13d04 100644 --- a/Tests/Crypto/SMimeSignerTest.php +++ b/Tests/Crypto/SMimeSignerTest.php @@ -143,7 +143,7 @@ public function testSignedMessageExtraCerts() $this->samplesDir.'sign.key', null, $this->samplesDir.'intermediate.crt', - PKCS7_DETACHED + \PKCS7_DETACHED ); $signedMessage = $signer->sign($message); diff --git a/Tests/Part/Multipart/FormDataPartTest.php b/Tests/Part/Multipart/FormDataPartTest.php index 6f81224..417417f 100644 --- a/Tests/Part/Multipart/FormDataPartTest.php +++ b/Tests/Part/Multipart/FormDataPartTest.php @@ -35,14 +35,14 @@ public function testConstructor() $t = new TextPart($content, 'utf-8', 'plain', '8bit'); $t->setDisposition('form-data'); $t->setName('foo'); - $t->getHeaders()->setMaxLineLength(PHP_INT_MAX); + $t->getHeaders()->setMaxLineLength(\PHP_INT_MAX); $b->setDisposition('form-data'); $b->setName('bar'); - $b->getHeaders()->setMaxLineLength(PHP_INT_MAX); + $b->getHeaders()->setMaxLineLength(\PHP_INT_MAX); $r->setValue($b, '8bit'); $c->setDisposition('form-data'); $c->setName('baz'); - $c->getHeaders()->setMaxLineLength(PHP_INT_MAX); + $c->getHeaders()->setMaxLineLength(\PHP_INT_MAX); $r->setValue($c, '8bit'); $this->assertEquals([$t, $b, $c], $f->getParts()); }