From 4be0ececde078d059e9cdc41fd051dbdaea65605 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 17 Jul 2016 10:26:30 +0200 Subject: [PATCH] Fix warnings about return types --- wcfsetup/install.php | 2 +- .../install/files/lib/data/package/PackageCache.class.php | 2 +- .../install/files/lib/data/session/SessionAction.class.php | 2 +- wcfsetup/install/files/lib/system/email/Email.class.php | 4 ++-- wcfsetup/install/files/lib/system/io/Tar.class.php | 2 +- .../system/package/PackageInstallationDispatcher.class.php | 2 +- .../lib/system/worker/StatDailyRebuildDataWorker.class.php | 5 ++--- wcfsetup/install/files/lib/util/DOMUtil.class.php | 4 ++-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/wcfsetup/install.php b/wcfsetup/install.php index d635109148..4e1d79b7c0 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -633,7 +633,7 @@ class Tar { * Unpacks file header for one file entry. * * @param string $binaryData - * @return array $fileheader + * @return array|boolean */ protected function readHeader($binaryData) { if (strlen($binaryData) != 512) { diff --git a/wcfsetup/install/files/lib/data/package/PackageCache.class.php b/wcfsetup/install/files/lib/data/package/PackageCache.class.php index 2342ae4c70..86fa5879b9 100644 --- a/wcfsetup/install/files/lib/data/package/PackageCache.class.php +++ b/wcfsetup/install/files/lib/data/package/PackageCache.class.php @@ -59,7 +59,7 @@ class PackageCache extends SingletonFactory { * @return Package[] */ public function getPackages() { - return $this->packages; + return $this->packages['packages']; } /** diff --git a/wcfsetup/install/files/lib/data/session/SessionAction.class.php b/wcfsetup/install/files/lib/data/session/SessionAction.class.php index 2f58be643b..84b44d5040 100644 --- a/wcfsetup/install/files/lib/data/session/SessionAction.class.php +++ b/wcfsetup/install/files/lib/data/session/SessionAction.class.php @@ -51,7 +51,7 @@ class SessionAction extends AbstractDatabaseObjectAction { public function keepAlive() { // ignore sessions created by this request if (WCF::getSession()->lastActivityTime == TIME_NOW) { - return; + return []; } // update last activity time diff --git a/wcfsetup/install/files/lib/system/email/Email.class.php b/wcfsetup/install/files/lib/system/email/Email.class.php index e4eaf8b361..9178af0c27 100644 --- a/wcfsetup/install/files/lib/system/email/Email.class.php +++ b/wcfsetup/install/files/lib/system/email/Email.class.php @@ -45,13 +45,13 @@ class Email { /** * References header - * @var Mailbox[] + * @var string[] */ protected $references = []; /** * In-Reply-To header - * @var Mailbox[] + * @var string[] */ protected $inReplyTo = []; diff --git a/wcfsetup/install/files/lib/system/io/Tar.class.php b/wcfsetup/install/files/lib/system/io/Tar.class.php index ae126b65ed..e560bcdc8f 100644 --- a/wcfsetup/install/files/lib/system/io/Tar.class.php +++ b/wcfsetup/install/files/lib/system/io/Tar.class.php @@ -284,7 +284,7 @@ class Tar implements IArchive { * Unpacks file header for one file entry. * * @param string $binaryData - * @return array $fileheader + * @return array|boolean */ protected function readHeader($binaryData) { if (strlen($binaryData) != 512) { diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 652946dc9c..0c6a735ceb 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -532,7 +532,7 @@ class PackageInstallationDispatcher { * Executes a package installation plugin. * * @param mixed[] $nodeData - * @return boolean + * @return PackageInstallationStep * @throws SystemException */ protected function executePIP(array $nodeData) { diff --git a/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php index 9253f381ac..32d8c80715 100644 --- a/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php @@ -79,12 +79,11 @@ class StatDailyRebuildDataWorker extends AbstractRebuildDataWorker { } /** - * Gets the start timestamp. - * - * @return integer + * Determines the start timestamp. */ protected function getStartDate() { if ($this->startDate) return; + $sql = "SELECT MIN(registrationDate) FROM wcf".WCF_N."_user"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/util/DOMUtil.class.php b/wcfsetup/install/files/lib/util/DOMUtil.class.php index 68ab736e7d..24f40dfdb5 100644 --- a/wcfsetup/install/files/lib/util/DOMUtil.class.php +++ b/wcfsetup/install/files/lib/util/DOMUtil.class.php @@ -74,7 +74,7 @@ final class DOMUtil { * * @param \DOMNode $node1 first node * @param \DOMNode $node2 second node - * @return \DOMElement|null common ancestor or null + * @return \DOMNode|null common ancestor or null */ public static function getCommonAncestor(\DOMNode $node1, \DOMNode $node2) { // abort if both elements share a common element or are both direct descendants @@ -436,7 +436,7 @@ final class DOMUtil { * @param \DOMNode $node reference node * @param \DOMElement $ancestor ancestor element that should not be split * @param boolean $splitBefore true if nodes before `$node` should be moved into a new node, false to split nodes after `$node` - * @return \DOMElement parent node containing `$node`, direct child of `$ancestor` + * @return \DOMNode parent node containing `$node`, direct child of `$ancestor` */ public static function splitParentsUntil(\DOMNode $node, \DOMElement $ancestor, $splitBefore = true) { if (!self::contains($ancestor, $node)) { -- 2.20.1