From bf49942244db2ed7891d5566794287b8a84250cb Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 2 Dec 2017 18:37:33 +0100 Subject: [PATCH] Extend dockblocks --- DataStorage/Database/DataMapperAbstract.php | 13 +++++++++---- DataStorage/Database/Query/Grammar/Grammar.php | 11 +++++++++++ DataStorage/Session/HttpSession.php | 7 +++++++ System/File/Ftp/File.php | 12 ++++++++++++ System/File/Local/File.php | 15 ++++++++++++--- Utils/Barcode/C128Abstract.php | 18 ++++++++++++++++++ Utils/JsonBuilder.php | 16 +++++----------- 7 files changed, 74 insertions(+), 18 deletions(-) diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 8d0f8f4bb..53e71df8d 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -633,8 +633,8 @@ class DataMapperAbstract implements DataMapperInterface /** * Create has many * - * @param array $obj Object to create - * @param mixed $objId Id to set + * @param array $obj Object to create + * @param mixed $objId Id to set * * @return void * @@ -978,8 +978,6 @@ class DataMapperAbstract implements DataMapperInterface * * @return mixed * - * @throws \Exception - * * @since 1.0.0 */ private static function updateRelationTable(array $objsIds, $objId) @@ -1888,6 +1886,13 @@ class DataMapperAbstract implements DataMapperInterface return $obj; } + /** + * Creates the current null object + * + * @return mixed + * + * @since 1.0.0 + */ private static function getNullModelObj() { $class = static::class; diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 4f29e869b..6298dc55e 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -131,6 +131,17 @@ class Grammar extends GrammarAbstract return $sql; } + /** + * Get query components based on query type. + * + * @param int $type Query type + * + * @return array Array of components to build query + * + * @throws \InvalidArgumentException Throws this exception if the query type is undefined + * + * @since 1.0.0 + */ private function getComponents(int $type) : array { switch ($type) { diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index 3deb6d1b8..87454c6b5 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -207,6 +207,13 @@ class HttpSession implements SessionInterface $this->sid = $sid; } + /** + * Destroy the current session. + * + * @return void + * + * @since 1.0.0 + */ private function destroy() /* : void */ { session_destroy(); diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index 503c4594e..4585ae447 100644 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -40,8 +40,20 @@ use phpOMS\Uri\Http; */ class File extends FileAbstract implements FileInterface { + /** + * Ftp connection + * + * @var resource + * @since 1.0.0 + */ private $con = null; + /** + * Ftp connection uri. + * + * @var Http + * @since 1.0.0 + */ private $uri = null; public function __construct(string $path) diff --git a/System/File/Local/File.php b/System/File/Local/File.php index c2887b6b5..e145a3cac 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -169,7 +169,7 @@ class File extends FileAbstract implements FileInterface throw new PathException($path); } - return self::createFileTime($path, filemtime($path)); + return self::createFileTime(filemtime($path)); } /** @@ -181,10 +181,19 @@ class File extends FileAbstract implements FileInterface throw new PathException($path); } - return self::createFileTime($path, filectime($path)); + return self::createFileTime(filectime($path)); } - private static function createFileTime(string $path, int $time) + /** + * Create file time. + * + * @param int $time Time of the file + * + * @return \DateTime + * + * @since 1.0.0 + */ + private static function createFileTime(int $time) : \DateTime { $fileTime = new \DateTime(); $fileTime->setTimestamp($time); diff --git a/Utils/Barcode/C128Abstract.php b/Utils/Barcode/C128Abstract.php index 95c7c2d3e..43a7bac83 100644 --- a/Utils/Barcode/C128Abstract.php +++ b/Utils/Barcode/C128Abstract.php @@ -321,6 +321,15 @@ abstract class C128Abstract return $image; } + /** + * Calculate the code length for image dimensions + * + * @param string $codeString Code string to render + * + * @return int Length of the code + * + * @since 1.0.0 + */ private function calculateCodeLength(string $codeString) : int { $codeLength = 0; @@ -331,6 +340,15 @@ abstract class C128Abstract return $codeLength; } + /** + * Calculate the code dimensions + * + * @param string $codeString Code string to render + * + * @return array + * + * @since 1.0.0 + */ private function calculateDimensions(string $codeString) : array { $codeLength = $this->calculateCodeLength($codeString); diff --git a/Utils/JsonBuilder.php b/Utils/JsonBuilder.php index 23efb792d..3289a39f8 100644 --- a/Utils/JsonBuilder.php +++ b/Utils/JsonBuilder.php @@ -87,10 +87,7 @@ class JsonBuilder implements \Serializable, \JsonSerializable } /** - * String representation of object - * @link http://php.net/manual/en/serializable.serialize.php - * @return string the string representation of the object or null - * @since 5.1.0 + * {@inheritdoc} */ public function serialize() { @@ -98,19 +95,16 @@ class JsonBuilder implements \Serializable, \JsonSerializable } /** - * Constructs the object - * @link http://php.net/manual/en/serializable.unserialize.php - * @param string $serialized

- * The string representation of the object. - *

- * @return void - * @since 5.1.0 + * {@inheritdoc} */ public function unserialize($serialized) { $this->json = json_decode($serialized, true); } + /** + * {@inheritdoc} + */ public function jsonSerialize() { return $this->getJson();