From 57cc0b261a786990ecc8fc4708454c6d5be2f2f9 Mon Sep 17 00:00:00 2001 From: Dominique FOURNIER Date: Thu, 13 Apr 2023 14:36:03 +0200 Subject: [PATCH] phpstan for all --- src/Authorization.php | 3 ++- src/Authzgroups.php | 2 +- src/Authzgroupsoo.php | 2 +- src/Daemon.php | 4 ++-- src/Getopts.php | 2 +- src/Logger.php | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Authorization.php b/src/Authorization.php index 0ba017e..7229e61 100644 --- a/src/Authorization.php +++ b/src/Authorization.php @@ -33,9 +33,10 @@ class Authorization /** Return if the user right is NONE, READ, WRITE, EXECUTE if the object doesn't exists, or is not readable, throw an exception @param string $object The object path to examine - @return NONE, READ, WRITE, EXECUTE */ + @return string NONE, READ, WRITE, EXECUTE */ public function validate($object) { + return "NONE"; } /** Add a new object, with owner and group, and mode bits diff --git a/src/Authzgroups.php b/src/Authzgroups.php index 009d377..d4389a2 100644 --- a/src/Authzgroups.php +++ b/src/Authzgroups.php @@ -1468,7 +1468,7 @@ class Authzgroups "Wanted group not found" ), 404); } - return $this->rightReadByGroupByID($module, $objects[0]["idgroup"]); + return $this->rightReadByGroupByID($module, $groups[0]["idgroup"]); } /** Return an array with all the available rights for a module and a group diff --git a/src/Authzgroupsoo.php b/src/Authzgroupsoo.php index 2b1fe28..f3b4c7d 100644 --- a/src/Authzgroupsoo.php +++ b/src/Authzgroupsoo.php @@ -1676,7 +1676,7 @@ class Authzgroupsoo "Wanted group not found" ), 404); } - return $this->rightReadByGroupByID($module, $objects[0]["idgroup"]); + return $this->rightReadByGroupByID($module, $groups[0]["idgroup"]); } /** Return an array with all the available rights for a module and a group diff --git a/src/Daemon.php b/src/Daemon.php index 418b2e8..90afa38 100644 --- a/src/Daemon.php +++ b/src/Daemon.php @@ -149,7 +149,7 @@ class Daemon */ public function status($name) { - $file = new file(); + $file = new File(); if (! $file->is_writeable($this->runDir)) { throw new \Exception(sprintf( "Run Directory '%s' is not writeable", @@ -179,7 +179,7 @@ class Daemon */ public function reload($name) { - $file = new file(); + $file = new File(); if (! $file->is_writeable($this->runDir)) { throw new \Exception(sprintf( "Run Directory '%s' is not writeable", diff --git a/src/Getopts.php b/src/Getopts.php index b2b4652..1b5a9f2 100644 --- a/src/Getopts.php +++ b/src/Getopts.php @@ -160,7 +160,7 @@ class Getopts } if ( ! is_int($multiple) && - \verify::staticIs_integer("$multiple") === false + Verify::staticIs_integer("$multiple") === false ) { throw new \Exception("Multiple option must be an integer", 500); } diff --git a/src/Logger.php b/src/Logger.php index ad8c83c..d1af83a 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -242,7 +242,7 @@ class Logger // Display the backtrace if it is needed if ($this->backtraceDisplay) { - $e = new Exception(); + $e = new \Exception(); $msg .= "\n" . ($e->getTraceAsString()); }