Skip to content

Commit bf6913d

Browse files
Merge branch '4.3' into 4.4
* 4.3: [4.3] Remove unused local variables
2 parents 86fe792 + 3c0e197 commit bf6913d

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

CharacterStream.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ public function read(int $length): ?string
114114
if ($this->currentPos >= $this->charCount) {
115115
return null;
116116
}
117-
$ret = null;
118117
$length = ($this->currentPos + $length > $this->charCount) ? $this->charCount - $this->currentPos : $length;
119118
if ($this->fixedWidth > 0) {
120119
$len = $length * $this->fixedWidth;

Tests/EmailTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ public function testGenerateBody()
319319
$e->text('text content');
320320
$e->attach($file);
321321
$e->attach($image, 'test.gif');
322-
$fullhtml = new TextPart($content, 'utf-8', 'html');
323322
$body = $e->getBody();
324323
$this->assertInstanceOf(MixedPart::class, $body);
325324
$this->assertCount(2, $related = $body->getParts());
@@ -376,7 +375,7 @@ public function testSerialize()
376375
$e->from('fabien@symfony.com');
377376
$e->text($r);
378377
$e->html($r);
379-
$contents = file_get_contents($name = __DIR__.'/Fixtures/mimetypes/test', 'r');
378+
$name = __DIR__.'/Fixtures/mimetypes/test';
380379
$file = fopen($name, 'r');
381380
$e->attach($file, 'test');
382381
$expected = clone $e;

Tests/Header/HeadersTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ public function testAllReturnsEmptyArrayIfNoneSet()
173173

174174
public function testRemoveRemovesAllHeadersWithName()
175175
{
176-
$header0 = new UnstructuredHeader('X-Test', 'some@id');
177-
$header1 = new UnstructuredHeader('X-Test', 'other@id');
178176
$headers = new Headers();
179177
$headers->addIdHeader('X-Test', 'some@id');
180178
$headers->addIdHeader('X-Test', 'other@id');
@@ -185,7 +183,6 @@ public function testRemoveRemovesAllHeadersWithName()
185183

186184
public function testHasIsNotCaseSensitive()
187185
{
188-
$header = new IdentificationHeader('Message-ID', 'some@id');
189186
$headers = new Headers();
190187
$headers->addIdHeader('Message-ID', 'some@id');
191188
$this->assertTrue($headers->has('message-id'));
@@ -209,7 +206,6 @@ public function testAllIsNotCaseSensitive()
209206

210207
public function testRemoveIsNotCaseSensitive()
211208
{
212-
$header = new IdentificationHeader('Message-ID', 'some@id');
213209
$headers = new Headers();
214210
$headers->addIdHeader('Message-ID', 'some@id');
215211
$headers->remove('message-id');

Tests/Header/IdentificationHeaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testInvalidIdLeftThrowsException()
103103
{
104104
$this->expectException('Exception');
105105
$this->expectExceptionMessage('Email "a b c@d" does not comply with addr-spec of RFC 2822.');
106-
$header = new IdentificationHeader('References', 'a b c@d');
106+
new IdentificationHeader('References', 'a b c@d');
107107
}
108108

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

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

155155
public function testSetBody()

Tests/Header/PathHeaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testSingleAddressCanBeSetAndFetched()
2626
public function testAddressMustComplyWithRfc2822()
2727
{
2828
$this->expectException('Exception');
29-
$header = new PathHeader('Return-Path', new Address('chr is@swiftmailer.org'));
29+
new PathHeader('Return-Path', new Address('chr is@swiftmailer.org'));
3030
}
3131

3232
public function testValueIsAngleAddrWithValidAddress()

0 commit comments

Comments
 (0)