From 65be63862faddc754f020f60d34f7fdf45f4d569 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 3 Dec 2017 22:22:42 +0100 Subject: [PATCH] Docblock improvements --- Localization/Localization.php | 62 +++++++++++++++------- Stdlib/Base/Exception/InvalidEnumValue.php | 4 +- System/File/Local/LocalStorage.php | 31 ++++++++++- Utils/Git/Repository.php | 2 + 4 files changed, 75 insertions(+), 24 deletions(-) diff --git a/Localization/Localization.php b/Localization/Localization.php index a4ae7f8c2..e4615a262 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -366,89 +366,111 @@ class Localization } /** - * @return string + * @return array * * @since 1.0.0 */ - public function getSpeed() : string + public function getSpeed() : array { return $this->speed; } /** - * @param string $speed + * @param array $speed * - * @return string + * @return array * * @since 1.0.0 */ - public function setSpeed(string $speed) /* : void */ + public function setSpeed(array $speed) /* : void */ { $this->speed = $speed; } /** - * @return string + * @return array * * @since 1.0.0 */ - public function getLength() : string + public function getWeight() : array + { + return $this->weight; + } + + /** + * @param array $weight + * + * @return array + * + * @since 1.0.0 + */ + public function setWeight(array $weight) /* : void */ + { + $this->weight= $weight; + } + + /** + * @return array + * + * @since 1.0.0 + */ + public function getLength() : array { return $this->length; } /** - * @param string $length + * @param array $length * - * @return string + * @return array * * @since 1.0.0 */ - public function setLength(string $length) /* : void */ + public function setLength(array $length) /* : void */ { $this->length = $length; } /** - * @return string + * @return array * * @since 1.0.0 */ - public function getArea() : string + public function getArea() : array { return $this->area; } /** - * @param string $area + * @param array $area * - * @return string + * @return array * * @since 1.0.0 */ - public function setArea(string $area) /* : void */ + public function setArea(array $area) /* : void */ { $this->area = $area; } /** - * @return string + * @return array * * @since 1.0.0 */ - public function getVolume() : string + public function getVolume() : array { return $this->volume; } /** - * @param string $volume + * @param array $volume * - * @return string + * @return array * * @since 1.0.0 */ - public function setVolume(string $volume) /* : void */ + public function setVolume(array $volume) /* : void */ { $this->volume = $volume; } diff --git a/Stdlib/Base/Exception/InvalidEnumValue.php b/Stdlib/Base/Exception/InvalidEnumValue.php index 489841bc2..ceea82620 100644 --- a/Stdlib/Base/Exception/InvalidEnumValue.php +++ b/Stdlib/Base/Exception/InvalidEnumValue.php @@ -32,13 +32,13 @@ class InvalidEnumValue extends \UnexpectedValueException /** * Constructor. * - * @param string $message Exception message + * @param mixed $message Exception message * @param int $code Exception code * @param \Exception $previous Previous exception * * @since 1.0.0 */ - public function __construct(string $message, int $code = 0, \Exception $previous = null) + public function __construct($message, int $code = 0, \Exception $previous = null) { parent::__construct('The enum value "' . $message . '" is not valid.', $code, $previous); } diff --git a/System/File/Local/LocalStorage.php b/System/File/Local/LocalStorage.php index 72e02302c..4ed8ac9f5 100644 --- a/System/File/Local/LocalStorage.php +++ b/System/File/Local/LocalStorage.php @@ -30,12 +30,30 @@ use phpOMS\System\File\PathException; */ class LocalStorage extends StorageAbstract { + /** + * Storage instance. + * + * @var LocalStorage + * @since 1.0.0 + */ private static $instance = null; - public function __construct() { - + /** + * Constructor. + * + * @since 1.0.0 + */ + public function __construct() + { } + /** + * Get instance. + * + * @return StorageAbstract + * + * @since 1.0.0 + */ public static function getInstance() : StorageAbstract { if (!isset(self::$instance)) { @@ -45,6 +63,15 @@ class LocalStorage extends StorageAbstract return self::$instance; } + /** + * Get the internal class type (directory or file) based on path. + * + * @param string $path Path to the directory or file + * + * @return string Class namespace + * + * @since 1.0.0 + */ protected static function getClassType(string $path) : string { return is_dir($path) || (!is_file($path) && stripos($path, '.') === false) ? Directory::class : File::class; diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 9b678188f..f8984d47a 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -288,6 +288,8 @@ class Repository * * @param string|array $files Files to remove * + * @return string + * * @throws \InvalidArgumentException * * @since 1.0.0