diff --git a/CharacterStream.php b/CharacterStream.php index faf5359..749066f 100644 --- a/CharacterStream.php +++ b/CharacterStream.php @@ -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; diff --git a/Tests/EmailTest.php b/Tests/EmailTest.php index eb792c2..bfd3005 100644 --- a/Tests/EmailTest.php +++ b/Tests/EmailTest.php @@ -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()); @@ -376,7 +375,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; diff --git a/Tests/Header/HeadersTest.php b/Tests/Header/HeadersTest.php index 3568c9a..e2eb75a 100644 --- a/Tests/Header/HeadersTest.php +++ b/Tests/Header/HeadersTest.php @@ -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'); @@ -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')); @@ -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'); diff --git a/Tests/Header/IdentificationHeaderTest.php b/Tests/Header/IdentificationHeaderTest.php index b7f0095..7d274ab 100644 --- a/Tests/Header/IdentificationHeaderTest.php +++ b/Tests/Header/IdentificationHeaderTest.php @@ -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() @@ -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() @@ -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() diff --git a/Tests/Header/PathHeaderTest.php b/Tests/Header/PathHeaderTest.php index 6bc029a..a8386f8 100644 --- a/Tests/Header/PathHeaderTest.php +++ b/Tests/Header/PathHeaderTest.php @@ -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()