Skip to content

Commit

Permalink
[4.3] Remove unused local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Oct 30, 2019
1 parent a6b152c commit 3c0e197
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion CharacterStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public function read(int $length): ?string
if ($this->currentPos >= $this->charCount) {
return null;
}
$ret = null;
$length = ($this->currentPos + $length > $this->charCount) ? $this->charCount - $this->currentPos : $length;
if ($this->fixedWidth > 0) {
$len = $length * $this->fixedWidth;
Expand Down
4 changes: 1 addition & 3 deletions Tests/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ public function testGenerateBody()
$e->text('text content');
$e->attach($file);
$e->attach($image, 'test.gif');
$fullhtml = new TextPart($content, 'utf-8', 'html');
$inlinedimg = (new DataPart($image, 'test.gif'))->asInline();
$body = $e->getBody();
$this->assertInstanceOf(MixedPart::class, $body);
$this->assertCount(2, $related = $body->getParts());
Expand Down Expand Up @@ -378,7 +376,7 @@ public function testSerialize()
$e->from('fabien@symfony.com');
$e->text($r);
$e->html($r);
$contents = file_get_contents($name = __DIR__.'/Fixtures/mimetypes/test', 'r');
$name = __DIR__.'/Fixtures/mimetypes/test';
$file = fopen($name, 'r');
$e->attach($file, 'test');
$expected = clone $e;
Expand Down
4 changes: 0 additions & 4 deletions Tests/Header/HeadersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ public function testAllReturnsEmptyArrayIfNoneSet()

public function testRemoveRemovesAllHeadersWithName()
{
$header0 = new UnstructuredHeader('X-Test', 'some@id');
$header1 = new UnstructuredHeader('X-Test', 'other@id');
$headers = new Headers();
$headers->addIdHeader('X-Test', 'some@id');
$headers->addIdHeader('X-Test', 'other@id');
Expand All @@ -185,7 +183,6 @@ public function testRemoveRemovesAllHeadersWithName()

public function testHasIsNotCaseSensitive()
{
$header = new IdentificationHeader('Message-ID', 'some@id');
$headers = new Headers();
$headers->addIdHeader('Message-ID', 'some@id');
$this->assertTrue($headers->has('message-id'));
Expand All @@ -209,7 +206,6 @@ public function testAllIsNotCaseSensitive()

public function testRemoveIsNotCaseSensitive()
{
$header = new IdentificationHeader('Message-ID', 'some@id');
$headers = new Headers();
$headers->addIdHeader('Message-ID', 'some@id');
$headers->remove('message-id');
Expand Down
6 changes: 3 additions & 3 deletions Tests/Header/IdentificationHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testInvalidIdLeftThrowsException()
{
$this->expectException('Exception');
$this->expectExceptionMessage('Email "a b c@d" does not comply with addr-spec of RFC 2822.');
$header = new IdentificationHeader('References', 'a b c@d');
new IdentificationHeader('References', 'a b c@d');
}

public function testIdRightCanBeDotAtom()
Expand Down Expand Up @@ -139,7 +139,7 @@ public function testInvalidIdRightThrowsException()
{
$this->expectException('Exception');
$this->expectExceptionMessage('Email "a@b c d" does not comply with addr-spec of RFC 2822.');
$header = new IdentificationHeader('References', 'a@b c d');
new IdentificationHeader('References', 'a@b c d');
}

public function testMissingAtSignThrowsException()
Expand All @@ -149,7 +149,7 @@ public function testMissingAtSignThrowsException()
/* -- RFC 2822, 3.6.4.
msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS]
*/
$header = new IdentificationHeader('References', 'abc');
new IdentificationHeader('References', 'abc');
}

public function testSetBody()
Expand Down
2 changes: 1 addition & 1 deletion Tests/Header/PathHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testSingleAddressCanBeSetAndFetched()
public function testAddressMustComplyWithRfc2822()
{
$this->expectException('Exception');
$header = new PathHeader('Return-Path', new Address('chr is@swiftmailer.org'));
new PathHeader('Return-Path', new Address('chr is@swiftmailer.org'));
}

public function testValueIsAngleAddrWithValidAddress()
Expand Down

0 comments on commit 3c0e197

Please sign in to comment.