diff --git a/Account/AccountManager.php b/Account/AccountManager.php index 91460f148..d39425f57 100644 --- a/Account/AccountManager.php +++ b/Account/AccountManager.php @@ -115,7 +115,7 @@ class AccountManager implements \Countable * * @return int * - * @throws + * @throws \Exception Throws this exception if the account to login is not found in the AccountManager. * * @since 1.0.0 * @author Dennis Eichhorn @@ -123,7 +123,7 @@ class AccountManager implements \Countable public function login(int $account, string $login, string $password) : int { if (!isset($this->accounts[$account])) { - throw new \Exception('Account not loaded'); + throw new \Exception('Account not found in the account manager.'); } return $this->auth->login($login, $password); diff --git a/DataStorage/Database/Connection/ConnectionFactory.php b/DataStorage/Database/Connection/ConnectionFactory.php index 4564ecf72..3d06ec94e 100644 --- a/DataStorage/Database/Connection/ConnectionFactory.php +++ b/DataStorage/Database/Connection/ConnectionFactory.php @@ -49,7 +49,7 @@ class ConnectionFactory * * @return ConnectionInterface * - * @throws \Exception + * @throws \InvalidArgumentException Throws this exception if the database is not supported. * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index 3aa0c9651..ae0efef24 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -62,7 +62,7 @@ class HttpSession implements SessionInterface * @param int $liftetime Session life time * @param string|int|bool $sid Session id * - * @throws \Exception + * @throws \Exception Throws this exception if the session is alrady locked for further interaction. * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Localization/ISO3166CharEnum.php b/Localization/ISO3166CharEnum.php index 838bf8a3c..1d8a43137 100644 --- a/Localization/ISO3166CharEnum.php +++ b/Localization/ISO3166CharEnum.php @@ -15,7 +15,7 @@ */ namespace phpOMS\Localization; -use phpOMS\Datatypes\EnumArray; +use phpOMS\Datatypes\Enum; /** * Country codes ISO list. @@ -28,7 +28,7 @@ use phpOMS\Datatypes\EnumArray; * @link http://orange-management.com * @since 1.0.0 */ -class ISO3166CharEnum extends EnumArray +class ISO3166CharEnum extends Enum { const _AFG = 'AFG'; const _ALA = 'ALA'; diff --git a/System/File/Local/File.php b/System/File/Local/File.php index e9b09bdfa..7c4e59e13 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -210,6 +210,16 @@ class File extends FileAbstract implements FileInterface return $changed; } + /** + * Gets the size of a file in bytes. + * + * @param string $path Path of the file to get the size for. + * + * @return int Returns the size of the file. + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function size(string $path) : int { if (!file_exists($path)) { @@ -219,6 +229,16 @@ class File extends FileAbstract implements FileInterface return filesize($path); } + /** + * Gets the id of the owner of the file. + * + * @param string $path Path of the file to get the owner for. + * + * @return int Returns the owner of the file. + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function owner(string $path) : int { if (!file_exists($path)) { @@ -228,6 +248,16 @@ class File extends FileAbstract implements FileInterface return fileowner($path); } + /** + * Gets the permission of a file. + * + * @param string $path Path of the file to get the permission for. + * + * @return int Returns the permission of the file. + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function permission(string $path) : int { if (!file_exists($path)) { @@ -237,6 +267,16 @@ class File extends FileAbstract implements FileInterface return fileperms($path); } + /** + * Gets the directory name of a file. + * + * @param string $path Path of the file to get the directory name for. + * + * @return string Returns the directory name of the file. + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function dirname(string $path) : string { return dirname($path); @@ -325,9 +365,9 @@ class File extends FileAbstract implements FileInterface } /** - * Get file content. + * Gets the content of the current file. * - * @return string + * @return string Content of the file. * * @since 1.0.0 * @author Dennis Eichhorn