From 239d5cc8a0293872fc18db39ad076d99cf47ea47 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Mon, 12 Aug 2019 23:09:42 +0200
Subject: [PATCH] Fully typehint lib/Logger/*.php

---
 lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php  | 4 ++--
 lib/SimpleSAML/Logger/FileLoggingHandler.php      | 4 ++--
 lib/SimpleSAML/Logger/LoggingHandlerInterface.php | 4 ++--
 lib/SimpleSAML/Logger/SyslogLoggingHandler.php    | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php b/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php
index 5d5f6cafe..0fdbdeddf 100644
--- a/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php
@@ -58,7 +58,7 @@ class ErrorLogLoggingHandler implements LoggingHandlerInterface
      * @param string $format The format used for logs.
      * @return void
      */
-    public function setLogFormat($format)
+    public function setLogFormat(string $format) : void
     {
         // we don't need the format here
     }
@@ -71,7 +71,7 @@ class ErrorLogLoggingHandler implements LoggingHandlerInterface
      * @param string $string The formatted message to log.
      * @return void
      */
-    public function log($level, $string)
+    public function log(int $level, string $string) : void
     {
         if (array_key_exists($level, self::$levelNames)) {
             $levelName = self::$levelNames[$level];
diff --git a/lib/SimpleSAML/Logger/FileLoggingHandler.php b/lib/SimpleSAML/Logger/FileLoggingHandler.php
index 745a1ed6a..659b06b86 100644
--- a/lib/SimpleSAML/Logger/FileLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/FileLoggingHandler.php
@@ -82,7 +82,7 @@ class FileLoggingHandler implements LoggingHandlerInterface
      * @param string $format The format used for logs.
      * @return void
      */
-    public function setLogFormat($format)
+    public function setLogFormat(string $format) : void
     {
         $this->format = $format;
     }
@@ -95,7 +95,7 @@ class FileLoggingHandler implements LoggingHandlerInterface
      * @param string $string The formatted message to log.
      * @return void
      */
-    public function log($level, $string)
+    public function log(int $level, string $string) : void
     {
         if (!is_null($this->logFile)) {
             // set human-readable log level. Copied from SimpleSAML\Logger\ErrorLogLoggingHandler.
diff --git a/lib/SimpleSAML/Logger/LoggingHandlerInterface.php b/lib/SimpleSAML/Logger/LoggingHandlerInterface.php
index 3681c2624..16585d6a6 100644
--- a/lib/SimpleSAML/Logger/LoggingHandlerInterface.php
+++ b/lib/SimpleSAML/Logger/LoggingHandlerInterface.php
@@ -30,7 +30,7 @@ interface LoggingHandlerInterface
      * @param string $string The message to log.
      * @return void
      */
-    public function log($level, $string);
+    public function log(int $level, string $string) : void;
 
 
     /**
@@ -39,5 +39,5 @@ interface LoggingHandlerInterface
      * @param string $format The format used for logs.
      * @return void
      */
-    public function setLogFormat($format);
+    public function setLogFormat(string $format) : void;
 }
diff --git a/lib/SimpleSAML/Logger/SyslogLoggingHandler.php b/lib/SimpleSAML/Logger/SyslogLoggingHandler.php
index 49da62d82..57ad7d340 100644
--- a/lib/SimpleSAML/Logger/SyslogLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/SyslogLoggingHandler.php
@@ -49,7 +49,7 @@ class SyslogLoggingHandler implements LoggingHandlerInterface
      * @param string $format The format used for logs.
      * @return void
      */
-    public function setLogFormat($format)
+    public function setLogFormat(string $format) : void
     {
         $this->format = $format;
     }
@@ -62,7 +62,7 @@ class SyslogLoggingHandler implements LoggingHandlerInterface
      * @param string $string The formatted message to log.
      * @return void
      */
-    public function log($level, $string)
+    public function log(int $level, string $string) : void
     {
         // changing log level to supported levels if OS is Windows
         if ($this->isWindows) {
-- 
GitLab