Przeglądaj źródła

Changing typo in variable name and default title for pushover message

Sebastian Goettschkes 13 lat temu
rodzic
commit
cb675ae10f

+ 3 - 3
src/Monolog/Handler/PushoverHandler.php

@@ -32,10 +32,10 @@ class PushoverHandler extends SocketHandler
      * @param integer $level  The minimum logging level at which this handler will be triggered
      * @param integer $level  The minimum logging level at which this handler will be triggered
      * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
      * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
      */
      */
-    public function __construct($token, $user, $title = 'Monolog error', $level = Logger::CRITICAL, $bubble = true)
+    public function __construct($token, $user, $title = 'Monolog', $level = Logger::CRITICAL, $bubble = true)
     {
     {
         parent::__construct('api.pushover.net', $level, $bubble);
         parent::__construct('api.pushover.net', $level, $bubble);
-        $this->conntectionPort = 80;
+        $this->connectionPort = 80;
 
 
         $this->token = $token;
         $this->token = $token;
         $this->user = $user;
         $this->user = $user;
@@ -65,7 +65,7 @@ class PushoverHandler extends SocketHandler
 
 
         return http_build_query($dataArray);
         return http_build_query($dataArray);
     }
     }
-    
+
     private function buildHeaderAndAddContent($content)
     private function buildHeaderAndAddContent($content)
     {
     {
         $header = "POST /1/messages.json HTTP/1.1\r\n";
         $header = "POST /1/messages.json HTTP/1.1\r\n";

+ 3 - 3
src/Monolog/Handler/SocketHandler.php

@@ -22,7 +22,7 @@ use Monolog\Logger;
 class SocketHandler extends AbstractProcessingHandler
 class SocketHandler extends AbstractProcessingHandler
 {
 {
     private $connectionString;
     private $connectionString;
-    protected $conntectionPort = -1;
+    protected $connectionPort = -1;
     private $connectionTimeout;
     private $connectionTimeout;
     private $resource;
     private $resource;
     private $timeout = 0;
     private $timeout = 0;
@@ -172,7 +172,7 @@ class SocketHandler extends AbstractProcessingHandler
      */
      */
     protected function pfsockopen()
     protected function pfsockopen()
     {
     {
-        return @pfsockopen($this->connectionString, $this->conntectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
+        return @pfsockopen($this->connectionString, $this->connectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
     }
     }
 
 
     /**
     /**
@@ -180,7 +180,7 @@ class SocketHandler extends AbstractProcessingHandler
      */
      */
     protected function fsockopen()
     protected function fsockopen()
     {
     {
-        return @fsockopen($this->connectionString, $this->conntectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
+        return @fsockopen($this->connectionString, $this->connectionPort, $this->errno, $this->errstr, $this->connectionTimeout);
     }
     }
 
 
     /**
     /**

+ 2 - 2
tests/Monolog/Handler/PushoverHandlerTest.php

@@ -43,7 +43,7 @@ class PushoverHandlerTest extends TestCase
      */
      */
     public function testWriteContent($content)
     public function testWriteContent($content)
     {
     {
-        $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog\+error&timestamp=\d{10}$/', $content);
+        $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog&timestamp=\d{10}$/', $content);
     }
     }
 
 
     public function testWriteWithComplexTitle()
     public function testWriteWithComplexTitle()
@@ -74,7 +74,7 @@ class PushoverHandlerTest extends TestCase
         fseek($this->res, 0);
         fseek($this->res, 0);
         $content = fread($this->res, 1024);
         $content = fread($this->res, 1024);
 
 
-        $expectedMessage = substr($message, 0, 499);
+        $expectedMessage = substr($message, 0, 505);
 
 
         $this->assertRegexp('/message=' . $expectedMessage . '&title/', $content);
         $this->assertRegexp('/message=' . $expectedMessage . '&title/', $content);
     }
     }