Skip to content

Commit

Permalink
Merge branch '4.3' into 4.4
Browse files Browse the repository at this point in the history
* 4.3:
  [4.3] Remove unused local variables
  • Loading branch information
nicolas-grekas committed Oct 30, 2019
2 parents 86fe792 + 3c0e197 commit bf6913d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion CharacterStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,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
3 changes: 1 addition & 2 deletions Tests/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ public function testGenerateBody()
$e->text('text content');
$e->attach($file);
$e->attach($image, 'test.gif');
$fullhtml = new TextPart($content, 'utf-8', 'html');
$body = $e->getBody();
$this->assertInstanceOf(MixedPart::class, $body);
$this->assertCount(2, $related = $body->getParts());
Expand Down Expand Up @@ -376,7 +375,7 @@ public function testSerialize()
$e->from('[email protected]');
$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 [email protected]'));
new PathHeader('Return-Path', new Address('chr [email protected]'));
}

public function testValueIsAngleAddrWithValidAddress()
Expand Down

0 comments on commit bf6913d

Please sign in to comment.