Skip to content

Commit

Permalink
Fix psalm issues
Browse files Browse the repository at this point in the history
Signed-off-by: Filippo Tessarotto <[email protected]>
  • Loading branch information
Slamdunk committed Oct 5, 2023
1 parent 693254d commit 5c9e166
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Protocol/Imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public function requestAndResponse($command, $tokens = [], $dontParse = false)
/**
* escape one or more literals i.e. for sendRequest
*
* @param string|array $string the literal/-s
* @param string $string the literal/-s
* @return string|array escape literals, literals with newline ar returned
* as array('{size}', 'string');
*/
Expand Down
3 changes: 3 additions & 0 deletions src/Transport/Envelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Laminas\Stdlib\AbstractOptions;

/**
* @extends AbstractOptions<string|list<string>>
*/
class Envelope extends AbstractOptions
{
/** @var string|null */
Expand Down
3 changes: 3 additions & 0 deletions src/Transport/FileOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use function sys_get_temp_dir;
use function time;

/**
* @extends AbstractOptions<string|callable>
*/
class FileOptions extends AbstractOptions
{
/** @var string Path to stored mail files */
Expand Down
3 changes: 3 additions & 0 deletions src/Transport/SmtpOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use function is_string;
use function sprintf;

/**
* @extends AbstractOptions<string>
*/
class SmtpOptions extends AbstractOptions
{
/** @var string Local client hostname */
Expand Down
4 changes: 2 additions & 2 deletions test/Header/HeaderWrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testWrapUnstructuredHeaderAscii(): void
$header = $this->createMock(UnstructuredInterface::class);
$header->expects($this->any())
->method('getEncoding')
->will($this->returnValue('ASCII'));
->willReturn('ASCII');
$expected = wordwrap($string, 78, "\r\n ");

$test = HeaderWrap::wrap($string, $header);
Expand All @@ -45,7 +45,7 @@ public function testWrapUnstructuredHeaderMime(): void
$header = $this->createMock(UnstructuredInterface::class);
$header->expects($this->any())
->method('getEncoding')
->will($this->returnValue('UTF-8'));
->willReturn('UTF-8');
$expected = "=?UTF-8?Q?foobarblahblahblah=20baz=20batfoobarblahblahblah=20baz=20?=\r\n"
. " =?UTF-8?Q?batfoobarblahblahblah=20baz=20bat?=";

Expand Down
3 changes: 1 addition & 2 deletions test/Transport/SmtpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use ReflectionClass;

use function explode;
use function sprintf;
use function str_repeat;
use function strlen;
use function substr;
Expand Down Expand Up @@ -231,7 +230,7 @@ public function testLongLinesFoldingRFC5322(): void
$this->assertCount(28, $lines);

foreach ($lines as $line) {
$this->assertLessThanOrEqual($maxLen, strlen($line), sprintf('Line is too long: ' . $line));
$this->assertLessThanOrEqual($maxLen, strlen($line), 'Line is too long: ' . $line);
}

$this->assertStringNotContainsString(
Expand Down

0 comments on commit 5c9e166

Please sign in to comment.