From d1eac075214df8ed0710d31d284c9c4632f2f1ba Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 5 Nov 2017 15:56:40 +0100 Subject: [PATCH] Fix docblocks --- Business/Programming/Metrics.php | 2 +- DataStorage/Database/Query/Builder.php | 23 +++++++++++++++---- .../Database/Query/Grammar/Grammar.php | 2 +- Log/FileLogger.php | 2 +- Math/Matrix/LUDecomposition.php | 6 ++--- Message/Mail/EmailAbstract.php | 22 +++++++++--------- Message/ResponseAbstract.php | 2 -- Module/PackageManager.php | 18 ++++++++++++--- System/File/ContainerInterface.php | 2 +- System/File/Ftp/Directory.php | 2 -- Utils/Converter/Currency.php | 1 - Utils/EDI/AnsiX12/Component/GS.php | 2 +- Utils/IO/Zip/Zip.php | 1 - 13 files changed, 53 insertions(+), 32 deletions(-) diff --git a/Business/Programming/Metrics.php b/Business/Programming/Metrics.php index 7d87c2bea..050187b9d 100644 --- a/Business/Programming/Metrics.php +++ b/Business/Programming/Metrics.php @@ -51,7 +51,7 @@ class Metrics { * @latex r = com^{2} \times (1 - cov)^{3} + com * * @param int $complexity Complexity - * @param int $coverage Coverage + * @param float $coverage Coverage * * @return int * diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index b7c166ae7..0cfc3941d 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -229,6 +229,7 @@ class Builder extends BuilderAbstract * Constructor. * * @param ConnectionAbstract $connection Database connection + * @param bool $readOnly Query is read only * * @since 1.0.0 */ @@ -352,6 +353,8 @@ class Builder extends BuilderAbstract * * @return Builder * + * @throws \Exception + * * @since 1.0.0 */ public function raw(string $raw) : Builder @@ -420,7 +423,7 @@ class Builder extends BuilderAbstract * * @since 1.0.0 */ - public function distinct(...$columns) : Builder + public function distinct() : Builder { $this->distinct = true; @@ -551,6 +554,8 @@ class Builder extends BuilderAbstract * Where and sub condition. * * @param Where $where Where sub condition + * @param mixed $operator Operator + * @param mixed $values Values * * @return Builder * @@ -565,6 +570,8 @@ class Builder extends BuilderAbstract * Where or sub condition. * * @param Where $where Where sub condition + * @param mixed $operator Operator + * @param mixed $values Values * * @return Builder * @@ -853,6 +860,8 @@ class Builder extends BuilderAbstract * * @return Builder * + * @throws \Exception + * * @since 1.0.0 */ public function insert(...$columns) : Builder @@ -958,10 +967,12 @@ class Builder extends BuilderAbstract /** * Update columns. * - * @param array $columns Column names to update + * @param array $tables Column names to update * * @return Builder * + * @throws \Exception + * * @since 1.0.0 */ public function update(...$tables) : Builder @@ -1130,16 +1141,20 @@ class Builder extends BuilderAbstract /** * Get bind parameter type. * + * @param mixed $value Value to bind + * * @return mixed * + * @throws \Exception + * * @since 1.0.0 */ public static function getBindParamType($value) { if (is_int($value)) { - return PDO::PARAM_INT; + return \PDO::PARAM_INT; } elseif (is_string($value) || is_float($value)) { - return PDO::PARAM_STR; + return \PDO::PARAM_STR; } throw new \Exception(); diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index ab1815159..7821c823d 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -172,7 +172,7 @@ class Grammar extends GrammarAbstract * Compile select. * * @param Builder $query Builder - * @param array $columns Columns + * @param array $table Table * * @return string * diff --git a/Log/FileLogger.php b/Log/FileLogger.php index fa773e1d7..777aee6b5 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -197,7 +197,7 @@ class FileLogger implements LoggerInterface * * @param string $id the ID by which this time measurement gets identified * - * @return int The time measurement in ms + * @return float The time measurement in ms * * @since 1.0.0 */ diff --git a/Math/Matrix/LUDecomposition.php b/Math/Matrix/LUDecomposition.php index 27b7c9270..124681658 100644 --- a/Math/Matrix/LUDecomposition.php +++ b/Math/Matrix/LUDecomposition.php @@ -165,7 +165,7 @@ class LUDecomposition for ($k = 0; $k < $this->n; ++$k) { for ($i = $k + 1; $i < $this->n; ++$i) { for ($j = 0; $j < $nx; ++$j) { - $X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k]; + $X[$i][$j] -= $X[$k][$j] * $this->LU[$i][$k]; } } } @@ -173,11 +173,11 @@ class LUDecomposition // Solve U*X = Y; for ($k = $this->n - 1; $k >= 0; --$k) { for ($j = 0; $j < $nx; ++$j) { - $X->A[$k][$j] /= $this->LU[$k][$k]; + $X[$k][$j] /= $this->LU[$k][$k]; } for ($i = 0; $i < $k; ++$i) { for ($j = 0; $j < $nx; ++$j) { - $X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k]; + $X[$i][$j] -= $X[$k][$j] * $this->LU[$i][$k]; } } } diff --git a/Message/Mail/EmailAbstract.php b/Message/Mail/EmailAbstract.php index 3902ee8a6..11efc441f 100644 --- a/Message/Mail/EmailAbstract.php +++ b/Message/Mail/EmailAbstract.php @@ -32,7 +32,7 @@ class EmailAbstract * @var string * @since 1.0.0 */ - private $host = ''; + protected $host = ''; /** * Port. @@ -40,7 +40,7 @@ class EmailAbstract * @var int * @since 1.0.0 */ - private $port = 25; + protected $port = 25; /** * Use ssl. @@ -48,7 +48,7 @@ class EmailAbstract * @var bool * @since 1.0.0 */ - private $ssl = false; + protected $ssl = false; /** * Mailbox base. @@ -56,7 +56,7 @@ class EmailAbstract * @var string * @since 1.0.0 */ - private $mailbox = ''; + protected $mailbox = ''; /** * Timeout. @@ -64,7 +64,7 @@ class EmailAbstract * @var int * @since 1.0.0 */ - private $timeout = 30; + protected $timeout = 30; /** * Construct @@ -92,21 +92,21 @@ class EmailAbstract /** * Decode * - * @param string $host Content to decode + * @param string $content Content to decode * @param int $encoding Encoding type * + * @return string + * * @since 1.0.0 */ public static function decode(string $content, int $encoding) { if ($encoding == 3) { return imap_base64($content); + } elseif ($encoding == 1) { + return imap_8bit($content); } else { - if ($encoding == 1) { - return imap_8bit($content); - } else { - return imap_qprint($content); - } + return imap_qprint($content); } } diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index 413dba1ed..462b0e7ba 100644 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -15,8 +15,6 @@ declare(strict_types = 1); namespace phpOMS\Message; -use phpOMS\Utils\ArrayUtils; - /** * Response abstract class. * diff --git a/Module/PackageManager.php b/Module/PackageManager.php index a7d5b5bed..b32b81871 100644 --- a/Module/PackageManager.php +++ b/Module/PackageManager.php @@ -20,6 +20,7 @@ use phpOMS\System\File\Local\File; use phpOMS\System\File\Local\Directory; use phpOMS\System\File\Local\LocalStorage; use phpOMS\Utils\IO\Zip\Zip; +use phpOMS\Utils\StringUtils; /** * Package Manager model. @@ -128,13 +129,11 @@ class PackageManager /** * Hash array of files * - * @param array $files Files to hash - * * @return string Hash value of files * * @since 1.0.0 */ - private function hashFiles(array $files) : string + private function hashFiles() : string { $files = Directory::list($this->extractPath . '/package'); $state = \sodium_crypto_generichash_init(); @@ -155,6 +154,8 @@ class PackageManager * * @return void * + * @throws \Exception + * * @since 1.0.0 */ public function install() /* : void */ @@ -172,6 +173,8 @@ class PackageManager /** * Move files + * + * @param mixed $components Component data * * @return void * @@ -186,6 +189,8 @@ class PackageManager /** * Copy files + * + * @param mixed $components Component data * * @return void * @@ -204,6 +209,8 @@ class PackageManager /** * Delete files + * + * @param mixed $components Component data * * @return void * @@ -218,6 +225,8 @@ class PackageManager /** * Execute commands + * + * @param mixed $components Component data * * @return void * @@ -245,6 +254,9 @@ class PackageManager /** * Authenticate package + * + * @param string $signedHash Hash to authenticate + * @param string $rawHash Hash to compare against * * @return bool * diff --git a/System/File/ContainerInterface.php b/System/File/ContainerInterface.php index bcb322718..997e1862a 100644 --- a/System/File/ContainerInterface.php +++ b/System/File/ContainerInterface.php @@ -66,7 +66,7 @@ interface ContainerInterface * * @param string $path Path of the resource * - * @return string Permissions (e.g. 0644); + * @return int Permissions (e.g. 0644); * * @since 1.0.0 */ diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index ba6103f45..4ce22b8e0 100644 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -17,8 +17,6 @@ namespace phpOMS\System\File\Ftp; use phpOMS\System\File\ContainerInterface; use phpOMS\System\File\DirectoryInterface; -use phpOMS\System\File\PathException; -use phpOMS\Utils\StringUtils; use phpOMS\System\File\Local\FileAbstract; use phpOMS\System\File\Local\Directory as DirectoryLocal; diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index d3e57e1ce..2063be591 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -19,7 +19,6 @@ use phpOMS\Localization\ISO4217CharEnum; use phpOMS\Message\Http\Rest; use phpOMS\Message\Http\Request; use phpOMS\Message\Http\RequestMethod; -use phpOMS\Localization\Localization; use phpOMS\Uri\Http; /** diff --git a/Utils/EDI/AnsiX12/Component/GS.php b/Utils/EDI/AnsiX12/Component/GS.php index 7bafe1a01..29055f235 100644 --- a/Utils/EDI/AnsiX12/Component/GS.php +++ b/Utils/EDI/AnsiX12/Component/GS.php @@ -162,7 +162,7 @@ class GS public function unserialize($raw) { - $split = explode($raw); + $split = explode($raw, '*'); $this->setFunctionalGroupHeader(trim($split[0])); $this->setFunctionalIdentifierCode(trim($split[1])); diff --git a/Utils/IO/Zip/Zip.php b/Utils/IO/Zip/Zip.php index dcce7101d..e634fb9b8 100644 --- a/Utils/IO/Zip/Zip.php +++ b/Utils/IO/Zip/Zip.php @@ -16,7 +16,6 @@ declare(strict_types = 1); namespace phpOMS\Utils\IO\Zip; use phpOMS\System\File\FileUtils; -use phpOMS\Utils\StringUtils; /** * Zip class for handling zip files.