Skip to content

Commit

Permalink
Merge branch '3.4' into 4.4
Browse files Browse the repository at this point in the history
* 3.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
  • Loading branch information
nicolas-grekas committed Sep 2, 2020
1 parent 50ad671 commit 42df250
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Crypto/SMimeEncrypter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Crypto/SMimeSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Encoder/Base64ContentEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]);
Expand Down
2 changes: 1 addition & 1 deletion Encoder/IdnAddressEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion FileinfoMimeTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Header/AbstractHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Part/Multipart/FormDataPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Crypto/SMimeSignerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function testSignedMessageExtraCerts()
$this->samplesDir.'sign.key',
null,
$this->samplesDir.'intermediate.crt',
PKCS7_DETACHED
\PKCS7_DETACHED
);
$signedMessage = $signer->sign($message);

Expand Down
6 changes: 3 additions & 3 deletions Tests/Part/Multipart/FormDataPartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 42df250

Please sign in to comment.