Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -20,7 +20,7 @@ final class EmailAttachmentCount extends Constraint
private $expectedValue;
private $transport;
public function __construct(int $expectedValue, string $transport = null)
public function __construct(int $expectedValue, ?string $transport = null)
{
$this->expectedValue = $expectedValue;
$this->transport = $transport;

View File

@@ -55,12 +55,14 @@ final class EmailHeaderSame extends Constraint
*/
protected function failureDescription($message): string
{
return sprintf('the Email %s (value is %s)', $this->toString(), $this->getHeaderValue($message));
return sprintf('the Email %s (value is %s)', $this->toString(), $this->getHeaderValue($message) ?? 'null');
}
private function getHeaderValue($message): string
private function getHeaderValue($message): ?string
{
$header = $message->getHeaders()->get($this->headerName);
if (null === $header = $message->getHeaders()->get($this->headerName)) {
return null;
}
return $header instanceof UnstructuredHeader ? $header->getValue() : $header->getBodyAsString();
}