From a6f6e30af2006b521ad7726044e86627c72d9a28 Mon Sep 17 00:00:00 2001 From: Yada Clintjens Date: Fri, 3 Nov 2023 17:24:31 +0100 Subject: [PATCH] Fix typos in documentation --- src/EventSource.php | 2 +- tests/MessageEventTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/EventSource.php b/src/EventSource.php index 58e32dc..8c70271 100644 --- a/src/EventSource.php +++ b/src/EventSource.php @@ -191,7 +191,7 @@ private function request() return; } - // match `Content-Type: text/event-stream` (case insensitve and ignore additional parameters) + // match `Content-Type: text/event-stream` (case insensitive and ignore additional parameters) if (!preg_match('/^text\/event-stream(?:$|;)/i', $response->getHeaderLine('Content-Type'))) { $this->readyState = self::CLOSED; $this->emit('error', array(new \UnexpectedValueException('Unexpected Content-Type'))); diff --git a/tests/MessageEventTest.php b/tests/MessageEventTest.php index 3f20bff..a65f69a 100644 --- a/tests/MessageEventTest.php +++ b/tests/MessageEventTest.php @@ -21,14 +21,14 @@ public function testParseDataOverTwoLinesWillBeCombined() $this->assertEquals("hello\nworld", $message->data); } - public function testParseDataOverTwoLinesWithCarrigeReturnsWillBeCombinedWithNewline() + public function testParseDataOverTwoLinesWithCarriageReturnsWillBeCombinedWithNewline() { $message = MessageEvent::parse("data: hello\rdata: world", ''); $this->assertEquals("hello\nworld", $message->data); } - public function testParseDataOverTwoLinesWithCarrigeReturnsAndNewlinesWillBeCombinedWithNewline() + public function testParseDataOverTwoLinesWithCarriageReturnsAndNewlinesWillBeCombinedWithNewline() { $message = MessageEvent::parse("data: hello\r\ndata: world", ''); @@ -42,14 +42,14 @@ public function testParseDataWithTrailingNewlineOverTwoLines() $this->assertEquals("hello\n", $message->data); } - public function testParseDataWithCarrigeReturnOverTwoLines() + public function testParseDataWithCarriageReturnOverTwoLines() { $message = MessageEvent::parse("data: hello\rdata:", ''); $this->assertEquals("hello\n", $message->data); } - public function testParseDataWithCarrigeReturnAndNewlineOverTwoLines() + public function testParseDataWithCarriageReturnAndNewlineOverTwoLines() { $message = MessageEvent::parse("data: hello\r\ndata:", '');