From ed8449d321703f2429affc8fdb6aa2af3b5c9011 Mon Sep 17 00:00:00 2001 From: Dominique FOURNIER Date: Wed, 27 Jul 2022 10:26:43 +0200 Subject: [PATCH] Add the @return types --- src/Authentication.php | 4 ++-- src/Authjwt.php | 2 +- src/Authorizationdb.php | 22 +++++++++++----------- src/Console.php | 2 +- src/Mail.php | 2 +- src/Password.php | 8 ++++---- src/Route.php | 2 +- src/Smtp.php | 2 +- src/Spfcheck.php | 3 +-- src/Sse.php | 2 +- src/Tcpclient.php | 6 +++--- src/Tcpserver.php | 4 ++-- src/Xmppclient.php | 2 +- 13 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/Authentication.php b/src/Authentication.php index 55a363d..e1a42d6 100644 --- a/src/Authentication.php +++ b/src/Authentication.php @@ -82,7 +82,7 @@ class Authentication /** Setter/Getter for debug * @param integer|null $debug The debug value to get/set - * @return the actual value or this + * @return integer|self the actual value or this */ public function debug ($debug = null) // {{{ @@ -380,7 +380,7 @@ class Authentication * properties of the class. * @param string $email The email to check * @param string $password The password to check - * @return an array containing the user data if the authentication is + * @return array containing the user data if the authentication is * correct, * an exception if noting is found */ diff --git a/src/Authjwt.php b/src/Authjwt.php index 92e0871..20d864c 100644 --- a/src/Authjwt.php +++ b/src/Authjwt.php @@ -106,7 +106,7 @@ class Authjwt extends Auth /** Save the auth data in cache directory and return the JWT token * Do not allow to store data if the $auth is anonymous * @param array $auth The authentication to save - * @return JWT token string + * @return string JWT token */ public function createJwtToken ($auth) // {{{ diff --git a/src/Authorizationdb.php b/src/Authorizationdb.php index 38583f5..058a282 100644 --- a/src/Authorizationdb.php +++ b/src/Authorizationdb.php @@ -59,7 +59,7 @@ class Authorizationdb extends 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 an array with READ, WRITE, EXECUTE */ + @return array with READ, WRITE, EXECUTE */ public function validate ($object) { if ($this->db === null) @@ -136,7 +136,7 @@ class Authorizationdb extends Authorization @param integer $ownerid Owner ID of the object @param integer $groupid Group ID of the object @param integer $modbits Bits of authorization - @return TRUE or an exception with the error message */ + @return boolean TRUE or an exception with the error message */ public function add ($object, $ownerid, $groupid, $modbits) { if ($this->db === null) @@ -205,7 +205,7 @@ class Authorizationdb extends Authorization /** Remove the information about an object and all its sub-objects @param string $object Object path to drop - @return TRUE or an exception with the error message */ + @return boolean TRUE or an exception with the error message */ public function drop ($object) { if ($this->db === null) @@ -279,7 +279,7 @@ class Authorizationdb extends Authorization Need to be the root administrator @param string $object Object path to add @param integer $ownerid Owner ID of the object - @return TRUE or an exception with the error message */ + @return boolean TRUE or an exception with the error message */ public function chown ($object, $ownerid) { if ($this->db === null) @@ -322,7 +322,7 @@ class Authorizationdb extends Authorization Need to be the ownerid of the object or the root administrator @param string $object Object path to add @param integer $groupid Group ID of the object - @return TRUE or an exception with the error message */ + @return boolean TRUE or an exception with the error message */ public function chgrp ($object, $groupid) { if ($this->db === null) @@ -368,7 +368,7 @@ class Authorizationdb extends Authorization Need to be the owner of the object or the root administrator @param string $object Object path to change @param integer $mod Bits of authorization - @return TRUE or an exception with the error message */ + @return boolean TRUE or an exception with the error message */ public function chmod ($object, $mod) { if ($this->db === null) @@ -411,7 +411,7 @@ class Authorizationdb extends Authorization /** Return the mode bits for an object if all his parents are readable for the user @param string $object Object path to examine - @return the modbits or an exception with the error message */ + @return int|float the modbits or an exception with the error message */ public function lsmod ($object) { if ($this->db === null) @@ -449,7 +449,7 @@ class Authorizationdb extends Authorization /** Return the ownerid for an object if all his parents are readable for the user @param string $object Object path to examine - @return the ownerid or an exception with the error message */ + @return integer the ownerid or an exception with the error message */ public function lsown ($object) { if ($this->db === null) @@ -487,7 +487,7 @@ class Authorizationdb extends Authorization /** Return the groupid for an object if all his parents are readable for the user @param string $object Object path to examine - @return the groupid or an exception with the error message */ + @return integer the groupid or an exception with the error message */ public function lsgrp ($object) { if ($this->db === null) @@ -527,7 +527,7 @@ class Authorizationdb extends Authorization //////////////////// /** Check if all the parent objects are executable @param string $object The object to test - @return TRUE or an exception in case of error */ + @return boolean TRUE or an exception in case of error */ private function treecheckExecute ($object) { if ($this->db === null) @@ -602,7 +602,7 @@ class Authorizationdb extends Authorization /** Check if the parent of object is writeable @param string $object The object to found - @return TRUE or an exception */ + @return boolean TRUE or an exception */ private function treecheckWrite ($object) { $parent = dirname ($object); diff --git a/src/Console.php b/src/Console.php index 761ce21..3edbee9 100644 --- a/src/Console.php +++ b/src/Console.php @@ -270,7 +270,7 @@ class Console * @param string $propo Preset the text for the user * @param boolean|string $stopperChar The chars to stop the analysis and * return the result - * @return The typed string + * @return string The typed string */ public function readline ($propo = "", $stopperChar = false) // {{{ diff --git a/src/Mail.php b/src/Mail.php index a64bf26..1142b6d 100644 --- a/src/Mail.php +++ b/src/Mail.php @@ -921,7 +921,7 @@ class Mail /** Get an attachment of the mail * @param integer $number the number of attach to get starting to 0 * @param boolean|null $inline Return only the attachments Inline if true - * @return the content of the attachment. Can be binary + * @return string the content of the attachment. Can be binary */ public function getAttachment ($number, $inline = false) // {{{ diff --git a/src/Password.php b/src/Password.php index a666e74..3dd99af 100644 --- a/src/Password.php +++ b/src/Password.php @@ -69,7 +69,7 @@ class Password // }}} /** Create a salt, based on openssl_random_pseudo_bytes function - * @return a string salt + * @return string a string salt */ public function salt () // {{{ @@ -165,7 +165,7 @@ class Password * chars). * A maximum of 20% for special chars in the size * @param integer|null $nbChars The number of chars (12 by default) - * @return The random password + * @return string The random password */ static public function generateASCII ($nbChars = 12) // {{{ @@ -194,7 +194,7 @@ class Password /** Create a random password with $nbChars chars, Alphanumericals chars * (without special chars) * @param integer|null $nbChars The number of chars (12 by default) - * @return The random password + * @return string The random password */ static public function generateAlphanum ($nbChars = 12) // {{{ @@ -219,7 +219,7 @@ class Password /** Create a random password with $nbChars chars, Alphabeticals chars * (without special chars, neither numbers) * @param integer|null $nbChars The number of chars (12 by default) - * @return The random password + * @return string The random password */ static public function generateAlphabetical ($nbChars = 12) // {{{ diff --git a/src/Route.php b/src/Route.php index e1e1cab..40c49e1 100644 --- a/src/Route.php +++ b/src/Route.php @@ -709,7 +709,7 @@ class Route } /** Return the last valid get page to return - * @return The last valid page URL + * @return string The last valid page URL or "" if not set */ public function lastValidGetPage () { diff --git a/src/Smtp.php b/src/Smtp.php index 9d4cc97..b6e1348 100644 --- a/src/Smtp.php +++ b/src/Smtp.php @@ -168,7 +168,7 @@ class Smtp * @param string|array $to the recipient of the email. Not displayed in the * email content * @param string $completeMail The content of the email - * @return the message from the server (where is stored the message queue + * @return string the message from the server (where is stored the message queue * identifier */ public function send ($from, $to, $completeMail) diff --git a/src/Spfcheck.php b/src/Spfcheck.php index 35b2ded..7cb6f5f 100644 --- a/src/Spfcheck.php +++ b/src/Spfcheck.php @@ -205,8 +205,7 @@ class Spfcheck /** Get the DNS values set for the provided $domain/$part(/$entity) * @param string $search The search entity - * @return array The array of result from DNS - * @return false if not exists + * @return array|boolean The array of result from DNS or false if not exists */ public function getDNSEntries ($search) { diff --git a/src/Sse.php b/src/Sse.php index 4153948..f4508bf 100644 --- a/src/Sse.php +++ b/src/Sse.php @@ -309,7 +309,7 @@ class Sse /** Initialize the backend for one specific file. * @param string $event The event to start * @param string $filePath The file path where the event data are stored - * @return false if the file doesn't exists + * @return boolean false if the file doesn't exists */ private function backendInitEvent ($event, $filePath) // {{{ diff --git a/src/Tcpclient.php b/src/Tcpclient.php index 69199ad..bf69835 100644 --- a/src/Tcpclient.php +++ b/src/Tcpclient.php @@ -198,8 +198,8 @@ class Tcpclient * @param boolean $val True to activate, false to disable SSL * @param integer|null $cryptoMethod The cryptoMethod allowed * @param array|null $options Can overload the SSL options if needed - * @return false if the client can not found a encryption method with the - * server + * @return boolean false if the client can not found a encryption method + * with the server */ public function cryptoEnable ($val, $cryptoMethod = null, $options = array ()) // {{{ @@ -258,7 +258,7 @@ class Tcpclient * In text mode, the read return when found the first \r\n, and doesn't * returns the \r\n. * @param integer $maxLength Limit the length of the data from the server - * @return The content + * @return string The content */ public function read ($maxLength = 1024) // {{{ diff --git a/src/Tcpserver.php b/src/Tcpserver.php index 1c9051a..35c4973 100644 --- a/src/Tcpserver.php +++ b/src/Tcpserver.php @@ -350,7 +350,7 @@ class Tcpserver // }}} /** Start the main loop in background and do not wait its end - * @return the PID of the child + * @return integer the PID of the child */ final public function loopInBackgroundStart () // {{{ @@ -507,7 +507,7 @@ class Tcpserver * Use the readMode in text or binary (text by default) * In text mode, the read return when found the first \r or the first \n. * @param integer $maxLength Limit the length of the data from the server - * @return The content + * @return string The content */ final public function read ($maxLength = 1024) // {{{ diff --git a/src/Xmppclient.php b/src/Xmppclient.php index 13781b6..4fb6731 100644 --- a/src/Xmppclient.php +++ b/src/Xmppclient.php @@ -208,7 +208,7 @@ class Xmppclient // PRIVATE METHODS // /** Read fron socket - * @return the read value + * @return string the read value */ private function read () // {{{