From 808dd9dffca3922dd211c62ca899e7bf59bc442e Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 25 Feb 2020 22:15:28 +0100 Subject: [PATCH] minor cs fixes --- Model/Message/FormValidation.php | 7 ------- Model/Message/Notify.php | 7 ------- Model/Message/Redirect.php | 7 ------- Model/Message/Reload.php | 7 ------- Utils/Converter/File.php | 8 ++++---- Utils/Git/Repository.php | 2 +- Utils/IO/Zip/Tar.php | 5 ++++- Utils/IO/Zip/Zip.php | 5 ++++- Utils/RnG/Name.php | 2 +- 9 files changed, 14 insertions(+), 36 deletions(-) diff --git a/Model/Message/FormValidation.php b/Model/Message/FormValidation.php index c5c674e07..59c0dc183 100644 --- a/Model/Message/FormValidation.php +++ b/Model/Message/FormValidation.php @@ -66,13 +66,6 @@ final class FormValidation implements \Serializable, ArrayableInterface, \JsonSe return $this->__toString(); } - /** - * Render message. - * - * @return array - * - * @since 1.0.0 - */ /** * {@inheritdoc} */ diff --git a/Model/Message/Notify.php b/Model/Message/Notify.php index 391256a50..6c5063186 100644 --- a/Model/Message/Notify.php +++ b/Model/Message/Notify.php @@ -170,13 +170,6 @@ final class Notify implements \Serializable, ArrayableInterface, \JsonSerializab return $this->__toString(); } - /** - * Render message. - * - * @return array - * - * @since 1.0.0 - */ /** * {@inheritdoc} */ diff --git a/Model/Message/Redirect.php b/Model/Message/Redirect.php index 41d06bb09..8e0eb2580 100644 --- a/Model/Message/Redirect.php +++ b/Model/Message/Redirect.php @@ -112,13 +112,6 @@ final class Redirect implements \Serializable, ArrayableInterface, \JsonSerializ return $this->__toString(); } - /** - * Render message. - * - * @return array - * - * @since 1.0.0 - */ /** * {@inheritdoc} */ diff --git a/Model/Message/Reload.php b/Model/Message/Reload.php index 34a1e7b5f..d26d694c7 100644 --- a/Model/Message/Reload.php +++ b/Model/Message/Reload.php @@ -117,13 +117,6 @@ final class Reload implements \Serializable, ArrayableInterface, \JsonSerializab ]; } - /** - * Generate message json. - * - * @return array - * - * @since 1.0.0 - */ /** * {@inheritdoc} */ diff --git a/Utils/Converter/File.php b/Utils/Converter/File.php index a198d14a7..0093142d9 100644 --- a/Utils/Converter/File.php +++ b/Utils/Converter/File.php @@ -53,9 +53,9 @@ final class File return \rtrim(\rtrim(\number_format($bytes / 1000, 1, $decimal, $thousands), '0'), $decimal) . 'kb'; } elseif ($bytes > 999999 && $bytes < 1000000000) { return \rtrim(\rtrim(\number_format($bytes / 1000000, 1, $decimal, $thousands), '0'), $decimal) . 'mb'; - } else { - return \rtrim(\rtrim(\number_format($bytes / 1000000000, 1, $decimal, $thousands), '0'), $decimal) . 'gb'; } + + return \rtrim(\rtrim(\number_format($bytes / 1000000000, 1, $decimal, $thousands), '0'), $decimal) . 'gb'; } /** @@ -75,8 +75,8 @@ final class File return \rtrim(\rtrim(\number_format($kilobytes, 1, $decimal, $thousands), '0'), $decimal) . 'kb'; } elseif ($kilobytes > 999 && $kilobytes < 1000000) { return \rtrim(\rtrim(\number_format($kilobytes / 1000, 1, $decimal, $thousands), '0'), $decimal) . 'mb'; - } else { - return \rtrim(\rtrim(\number_format($kilobytes / 1000000, 1, $decimal, $thousands), '0'), $decimal) . 'gb'; } + + return \rtrim(\rtrim(\number_format($kilobytes / 1000000, 1, $decimal, $thousands), '0'), $decimal) . 'gb'; } } diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 95bd275c5..4e9bb9e25 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -100,7 +100,7 @@ class Repository } elseif (\is_file($this->path . '/config')) { // Is this a bare repo? $parseIni = \parse_ini_file($this->path . '/config'); - if ($parseIni['bare']) { + if ($parseIni !== false && $parseIni['bare']) { $this->bare = true; } } diff --git a/Utils/IO/Zip/Tar.php b/Utils/IO/Zip/Tar.php index f461f31f8..f50e68408 100644 --- a/Utils/IO/Zip/Tar.php +++ b/Utils/IO/Zip/Tar.php @@ -41,7 +41,10 @@ class Tar implements ArchiveInterface $tar = new \PharData($destination); - /** @var array $sources */ + /** + * @var string $source + * @var string $relative + */ foreach ($sources as $source => $relative) { if (\is_numeric($source) && \realpath($relative) !== false) { $source = $relative; diff --git a/Utils/IO/Zip/Zip.php b/Utils/IO/Zip/Zip.php index 0f7aee4e5..b5cb0ce06 100644 --- a/Utils/IO/Zip/Zip.php +++ b/Utils/IO/Zip/Zip.php @@ -44,7 +44,10 @@ class Zip implements ArchiveInterface return false; } - /** @var array $sources */ + /** + * @var string $source + * @var string $relative + */ foreach ($sources as $source => $relative) { if (\is_numeric($source) && \realpath($relative) !== false) { $source = $relative; diff --git a/Utils/RnG/Name.php b/Utils/RnG/Name.php index 6d90fc32d..d90e3afb8 100644 --- a/Utils/RnG/Name.php +++ b/Utils/RnG/Name.php @@ -24,7 +24,7 @@ namespace phpOMS\Utils\RnG; */ class Name { - private static $names = [ + private static array $names = [ 'western' => [ 'female' => [ 'Aaliyah', 'Cece', 'Heidi', 'Lilly', 'Rebekah', 'Aarushi', 'Cecelia', 'Helen', 'Lily', 'Reese',